"Draw" on screen?

c, c++, php, html, sql ..etc discussion. also includes codes and source codes.

"Draw" on screen?

Postby Ritterkreuzträger » Wed Jul 07, 2010 5:18 pm

I was making something game-related(hack\cheat or just some pointless shit :D Just experimenting). I was in need to draw something on screen(monitor, HDC), but it looks like in pascal there are only one famous enough method to draw something - to use TCanvas component. Its quiet powerful(And very easy to use - just like TCanvas.TextOut, TCanvas.Rectangle etc), but not enough for gaming purposes. The drawn thing will be erased with every screen update, so you have to redraw it. I made a timer for 1MSec, but it is not enough - the drawn thing will be blinking very fast, which is very annoying. Im not in need to see a solution on pascal, it can be written in C or in anything else(Im sure there are most be just few WinAPI functions). It is not needed to affect the application in any way, may be some kind of overlay...
Ritterkreuzträger
Allie
Allie
 
Posts: 105
Joined: Tue Jan 12, 2010 2:59 pm

Re: "Draw" on screen?

Postby Sethioz » Thu Jul 08, 2010 5:39 pm

sounds like the universal crosshair that TeamRetox wrote, which is blinking. its quite cool on crosshair, makes it easier to notice.
how about example code and tools ?
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: "Draw" on screen?

Postby Ritterkreuzträger » Sat Jul 10, 2010 6:08 pm

As about code - this is just too easy, there are no any real point to write it here... TCanvas - is pascal in-built library component. Can be used like this - for example, if you want some text to be displayed on window\whole monitor you have to write some initializing code and after this to use TCanvas component - TCanvas.TextOut(Y, X, String) (As about TextOut - analogue for WinAPI function, which is very similar - TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer)). Y and X are pixels. String - the text. I can write my own analogue of TCanvas, but it is not really needed - there are will stay the same problem with "blinking"(i just dont know how to avoid erasing thing).
Ritterkreuzträger
Allie
Allie
 
Posts: 105
Joined: Tue Jan 12, 2010 2:59 pm

Re: "Draw" on screen?

Postby Sethioz » Sat Jul 10, 2010 6:34 pm

i will take a look into it when i get a chance, probably in month.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown


Return to Programming / Coding / Debugging

Who is online

Users browsing this forum: No registered users and 2 guests

cron