SRL Archive - S.M.A.R.T. Questions and Answers.

takeScreen with SMART and SMART drawing


Floor66

2015-02-17 12:21:00

Hi there,

I use takeScreen to bookmark important events in my scripts (randoms, breaks) but I'd like to include my SMART-drawn (TGraphics.DrawClippedText) progress report in the screenshot. How do I go about doing this? Currently (using AeroLib's takeScreen) I'm just getting the game window in a screenshot, without my drawn text.

Thanks,

Floor66

ineedbot

2015-02-17 13:34:45

Olly helped me with this;
procedure doProggy;
var w, h, bmp, graphic : integer;
begin
graphic := OS_Smart.__Graphics.ToBitmap;
getClientDimensions(w, h);
bmp := bitmapFromClient(0, 0, w, h);
SetTransparentColor(graphic, 0);
fastDrawTransparent(0, 0, graphic, bmp);
saveBitmap(bmp, ProggieLocation);
writeln('Saving Proggy to: '+ProggieLocation+' Time Running: '+TimeRunning);
FreeBitmap(bmp);
FreeBitmap(graphic);
end;

ProggieLocation is the location where you want to save the picture to.

Brandon

2015-02-17 14:08:24

From: ineedbot
ProggieLocation is the location where you want to save the picture to.




Change this to:


procedure doProggy;
var w, h, bmp, graphic : integer;
begin
graphic := OS_Smart.Graphics().ToBitmap(false); //set to false.. don't copy it.. Get it directly..

//other stuff..

//FreeBitmap(graphic); delete this line.
end;

Source: https://github.com/J-Flight/AeroLib/blob/master/misc/Graphics.simba#L106

Floor66

2015-02-17 17:51:30

Thanks both of you! :-)