SRL Archive - Help and Support

Using a Script to create a Bitmap?


Special Ed

2007-05-04 04:26:10

IS there like a function or something that can make a bitmap of an area on the mainscreen like from 0,0 to 10,10 or something and then use it, within the script? Just thought I'd ask, it would be really helpful for my woodcutting procedure.

nielsie95

2007-05-04 05:01:52

Yes. I think for bitmaps it's CopyClientToBitmap.

Bobarkinator

2007-05-04 08:08:09

I think that there is a function to take a screenshot of a specific area then use it. It's like "TakeScreenShot…". I don't know the rest…

Special Ed

2007-05-05 00:02:20

Yea I tried CopyClientToBitmap but for some reason it didn't work, could you post an example please?

nielsie95

2007-05-05 03:47:37


var BmpScreen, length, width: integer;
begin
lenght:= MMX2 - MMX1;
width := MMY2 - MMY1;
bmpScreen := BitmapFromString(length, width, ''); //Prepares the source bitmap
CopyClientToBitmap(bmpScreen, MMX1, MMY1,MMX2, MMY2); //Copy's the bitmap

{THIS IS IF YOU WANT IT IN THE DEBUG WINDOW}
DisplayDebugImgWindow(length, width);
SafeCopyCanvas(GetBitmapCanvas(BmpScreen), GetDebugCanvas, 0, 0, length, width, 0, 0, length, width);
end;

BTW. How do you spell width? :p

Lorax

2007-05-05 12:23:16

From: nielsie95

...

BTW. How do you spell width? :p


width is correct spelt ;)