SRL Archive - General

GetClientCanvas


Jason2gs

2007-06-28 01:01:10

Here's something new I found out about SCAR :)

I've always only used GetClientCanvas for copying from, but did you know that you can also use it as a destination for a bitmap?

Target your desktop, and run this script:

program New;

var
Bitmap: Integer;
W, H: Integer;

begin
Bitmap := CreateBitmapMaskFromText('Hello, World!', UpChars);
GetBitmapSize(Bitmap, W, H);
CopyCanvas(GetBitmapCanvas(Bitmap), GetClientCanvas, 0, 0, W, H, 0, 0, W, H);
end.

Not sure if you already know this or not. Just figured I'd show you :)

Markus

2007-06-28 05:35:34

This is cool :D :D :D
Great for onscreen progress reports ;)

edit: Try this code :p

program New;

begin
GetClientCanvas.Font.color := clAqua;
Getclientcanvas.Font.Name := 'Arial';
repeat
GetClientCanvas.TextOut(10, 10, 'Hello World!!!!!');
until(isfkeydown(12));
end.

Jason2gs

2007-06-28 18:01:59

Ooh, I like that :)

shaunthasheep

2007-06-28 18:15:22

i was actually thinking this a few days ago (im not lying), but I didn't think it was gonna work because runescape refreshes every few ms. some of it doesn't tho.

Smartzkid

2007-06-28 18:42:02

program New;
{.include SRL/SRL.scar}

begin
SetupSRL;
Getclientcanvas.Font.Name := 'Arial';
repeat
GetClientCanvas.TextOut(100, 438, 'Running for ' + ScriptTime2(2));
wait(250);
until(isfkeydown(12));
end.

It seems that some parts of the client don't constantly refresh

Yakman

2007-06-28 19:11:47

i also knew about this for quite a while, but that repainting issue was what got in the way of anything
but now that i think of it, it could be done that you have another Scar which constants draws onto it, and use SendInterScarMessage
also bear in mind this would be seen by FindColor and stuff

Smartzkid

2007-06-28 19:19:43

Would it be possible for them to detect it?

The only place I can think of that won't interfere with anything is the chat-input line

shaunthasheep

2007-06-28 19:28:25

well it also works right above the chatbox too. (theres other places but are not wide enough)

Jason2gs

2007-06-29 00:05:03

I was also wondering if Jagex would detect it.

Hmm…