×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    5

    How to change color of DrawLine

    Hi,
    I use method gc.DrawLine(TPoint a, TPoint b) and I need to change color of the line. Is it possible?
    Thanks
    Robert

  2. #2
    Registered User
    Join Date
    Mar 2006
    Location
    India
    Posts
    503

    Re: How to change color of DrawLine

    Hi Robert ,

    U can change the properties of graphic object Pen,Brush by default pen has KRgbBlack Color.

    void SetPenColor(const TRgb &aColor);

    ensure u use a solid pen.

    style could be set thru

    void SetPenStyle(TPenStyle aPenStyle);

    Refer to wiki graphic section :

    http://wiki.forum.nokia.com/index.ph...phics_Articles
    Regards
    Kamal :)
    ------------------
    You never expect what expects you.

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: How to change color of DrawLine

    Quote Originally Posted by roborobo View Post
    Hi,
    I use method gc.DrawLine(TPoint a, TPoint b) and I need to change color of the line. Is it possible?
    Thanks
    Robert
    Code:
    CWindowGc& gc = SystemGc();
    
    gc.SetDrawMode(CGraphicsContext::EDrawModePEN);
    gc.SetPenColor(KRgbRed);
    gc.SetPenStyle(CGraphicsContext::ESolidPen);
    TPoint startPoint(0,45);
    TPoint endPoint(175,45);
    gc.DrawLine(startPoint,endPoint);
    Should do the trick for you.

    Cheers,
    Mayank

Similar Threads

  1. Replies: 5
    Last Post: 2009-10-26, 06:58
  2. rename application
    By sunny_singh in forum Symbian
    Replies: 6
    Last Post: 2009-05-18, 09:57
  3. Is it possible to change theme programmatically on S60 3rd addition?
    By jain_0882 in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2009-03-10, 16:16
  4. How to change Grid Selected Text Item?
    By ardc_21 in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-06-29, 09:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •