Results 1 to 3 of 3

Thread: Drawing colored text

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    Far.. far away! (Netherlands)
    Posts
    169

    Drawing colored text

    Hi,

    In a program of mine, i'm using the DrawText api to draw text. But.. i can only draw black text. I can draw colored text by setting the forecolor property, but i dont want to do that. Anyone knows how to do this?

    Thanks in advance,

    Shell

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    There is an API named setTextColor it needs the DC of the window you are drawing the text on. under is it's declaration
    VB Code:
    1. Public Declare Function SetTextColor Lib "gdi32" Alias "SetTextColor" (ByVal hdc As Long, ByVal crColor As Long) As Long

    Call this API before calling DrawText

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    Far.. far away! (Netherlands)
    Posts
    169
    Argh!! It's that easy! Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width