Page 1 of 1

"Draw" on screen?

Posted: Wed Jul 07, 2010 5:18 pm
by Ritterkreuzträger
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...

Re: "Draw" on screen?

Posted: Thu Jul 08, 2010 5:39 pm
by Sethioz
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 ?

Re: "Draw" on screen?

Posted: Sat Jul 10, 2010 6:08 pm
by Ritterkreuzträger
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).

Re: "Draw" on screen?

Posted: Sat Jul 10, 2010 6:34 pm
by Sethioz
i will take a look into it when i get a chance, probably in month.