Results 1 to 4 of 4

Thread: DrawText

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131

    DrawText

    Hello,
    I loaded a bitmap into my window. Now I want to draw text on that image, but there is a white rectangle where my text is written. Is there a way to just draw letters whitout the white rectangle? If no, how can I change the color of the white rectangle? I'm using DrawTextEx to draw my text but anyother function should do.
    Khavoerm Irithyl

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There is some way to set the text background to transparent, but I forgot how.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131
    Ok that's right I discovered how to do it. Just had to SetBkMode to transparent... But now I would like to know how I could change the size of the text I draw.
    Khavoerm Irithyl

  4. #4
    Member
    Join Date
    Feb 2001
    Posts
    57
    Just use CreateFont to make the font. This function will return the font which you then select into a DC.

    Example:
    PHP Code:
    HFONT hFont CreateFont(301500FW_BOLD000ANSI_CHARSET,
                         
    OUT_DEFAULT_PRECISCLIP_DEFAULT_PRECISDEFAULT_QUALITY,
                         
    DEFAULT_PITCH FF_ROMAN"Arial" );

    SelectObject(SomeDChFont); 
    You can use SetTextColor to change the font color too.


    Chilibean

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