SRL Archive - OSR Help

Clearing SMART debug canvas


Cstrike

2010-11-16 18:48:37

I can get stuff on there but I can't seem to get it off. I see the procedure ClearRSCanvas, but I don't know what to put as the canvas (or rather what TCanvas goes in there). Is this even possible?



Also quick 2nd question: Any way to paste BMP's on the smart debug as well?

Shuttleu

2010-11-16 19:27:25

try this

procedure ClearSmart;
var
drawing : TBitmap;
begin
drawing := TBitmap.Create;
drawing.canvas.handle := SmartGetDebugDC;

ClearRSCanvas(drawing.canvas);

FreeBitmap(drawing);
end;

Narcle

2010-11-16 19:32:35

Off topic a little bit but the current Paintsmarts we have tend to paint stuff over each other instead of clearing it then painting it. I found this annoying so I just us my own function to place a report on the SMARTs debug canvas.

Perhaps this is the reason your asking for a clearing function as well?

Shuttleu

2010-11-16 19:45:40

From: Narcle
Off topic a little bit but the current Paintsmarts we have tend to paint stuff over each other instead of clearing it then painting it. I found this annoying so I just us my own function to place a report on the SMARTs debug canvas.

Perhaps this is the reason your asking for a clearing function as well?


maybe this could help?
http://villavu.com/forum/showthread.php?p=750034#post750034

~shut

Cstrike

2010-11-16 20:29:10

From: Shuttleu
try this

procedure ClearSmart;
var
drawing : TBitmap;
begin
drawing := TBitmap.Create;
drawing.canvas.handle := SmartGetDebugDC;

ClearRSCanvas(drawing.canvas);

FreeBitmap(drawing);
end;


Works beautifully, thank you :)

EDIT: Is it possible to draw BMP's on the debug? J/W


From: Narcle

Perhaps this is the reason your asking for a clearing function as well?


The reason I wanted this is so I can make a status bar to my next level :)
Maybe not the best use of the debug… XD



EDIT:
Error: Exception: The bitmap[203679864] does not exist at line 48
Crashes simba, highlights the Free Bitmap line

Shuttleu

2010-11-16 20:35:47

From: cstrike
Works beautifully, thank you :)

EDIT: Is it possible to draw BMP's on the debug? J/W

im sure there is, but i dont know how to do it, im terrible when it comes to canvas'

~shut

EDIT: try this
procedure ClearSmart;
var
drawing : TBitmap;
begin
drawing := TBitmap.Create;
drawing.canvas.handle := SmartGetDebugDC;

ClearRSCanvas(drawing.canvas);

try
FreeBitmap(drawing);
except end;
end;

Gu3st...

2010-11-17 09:55:13

Do you have to use TBitmap? If not, try using CreateBitmap(Bitmap); instead :)

Sir R. M8gic1an

2010-11-17 10:43:49

@Narcle

Then just fix PaintSmart…

~RM