Solved GDI Drawing how to double buffering

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

cruzz

Newbie
Sep 14, 2015
3
314
0
Hey guys :)

I have some troubles with drawing stuff.. it draws nothing :FeelsBadMan:
C++:
void paint()
{
HDC hdc =  BeginPaint(hWnd, &ps);
HPEN OldPen;
HPEN drawPen;
COLORREF LineColor;
LineColor = RGB(255,0,0);
drawPen = CreatePen(PS_SOLID, 7, LineColor);
OldPen = (HPEN)SelectObject(hdc, drawPen);
MoveToEx(hdc, myX, myY, NULL);
LineTo(hdc, enemyX, enemyY);
SelectObject(hdc, OldPen);
DeleteObject(drawPen);
}
but this one works:
C++:
void paint()
{
RECT rect;
HDC wdc =  GetDC(hWnd);
GetClientRect (hWnd, &rect) ;
SetTextColor(wdc, 0xDC143C);
SetBkMode(wdc,TRANSPARENT);
rect.top=(enemyYcalc); //y
rect.left=(enemyXcalc); //x
DrawText( wdc, "Nice its working!", -1, &rect, DT_SINGLELINE | DT_NOCLIP  ) ;
ReleaseDC(hWnd,wdc);
}
it works, but its flickering.
so ... how to double buffering DrawText() and why is the first one not working?
And sorry for my english :p ..
cya..

cruzz
 
Last edited:

0x123

Russians are so good at hacking ._.
Dank Tier Donator
Nobleman
Oct 18, 2015
71
623
2
Hey guys :)

I have some troubles with drawing stuff.. it draws nothing :FeelsBadMan:
C++:
void paint()
{
HDC hdc =  BeginPaint(hWnd, &ps);
HPEN OldPen;
HPEN drawPen;
COLORREF LineColor;
LineColor = RGB(255,0,0);
drawPen = CreatePen(PS_SOLID, 7, LineColor);
OldPen = (HPEN)SelectObject(hdc, drawPen);
MoveToEx(hdc, myX, myY, NULL);
LineTo(hdc, enemyX, enemyY);
SelectObject(hdc, OldPen);
DeleteObject(drawPen);
}
but this one works:
C++:
void paint()
{
RECT rect;
HDC wdc =  GetDC(hWnd);
GetClientRect (hWnd, &rect) ;
SetTextColor(wdc, 0xDC143C);
SetBkMode(wdc,TRANSPARENT);
rect.top=(enemyYcalc); //y
rect.left=(enemyXcalc); //x
DrawText( wdc, "Nice its working!", -1, &rect, DT_SINGLELINE | DT_NOCLIP  ) ;
ReleaseDC(hWnd,wdc);
}
it works, but its flickering.
so ... how to double buffering DrawText() and why is the first one not working?
And sorry for my english :p ..
cya..

cruzz
(-(-(-_(-_-)_-)-)-) push
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods