Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    How To Draw Text


    Geek4Ever
     Share

    Recommended Posts

    i dont know if this works didnt try it.

     

    First you want to make a new HFONT variable like so:

     

    HFONT fnt;

     

    Then you want to fill in the with the CreateFont Function:

    //Fill in the structure with default
    // values and use the Arial Font
    Fnt = CreateFont(14,0,0,0,0,0,0,0,0,0,0,0,0, "Arial")

     

     

    Draw Text Function

    void Draw_Text(char *text, int x,int y,
    		   COLORREF color,
    		   LPDIRECTDRAWSURFACE lpdds,
    		   HFONT fnt)
    {
    //this function draws text in 16-bit DX ( i am to stupid to write  ) mode
    // with the selected font
    HDC dc; // the dc
    // get the dc from surface
    lpdds->GetDC(&dc)
    // set the colors 
    SetTextColor(dc,color);
    // set background mode to transparent
    // so black isn't copied
    SetBkMode(dc, TRANSPARENT);
    // draw the text using the font
    Selectbject(dc, fnt);
    TextOut(dc,x,y,text,strlen(text));
    // release the dc
    lpdds->ReleaseDC(dc);
    } // end Draw_Text

     

    How To Use

    //First make the font
    HFONT fnt;
    Fnt = CreateFont(14,0,0,0,0,0,0,0,0,0,0,0,0,"Arial");
    //Draw the text in Arial
    Draw_Text("This text is in Arial at Size 14",
    	  0,0,RGB(255, 255, 255), lpddsback, fnt);

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...