SRL Archive - RS3 Help

Having trouble displaying a proggy from BitmapFromString...


Taric

2015-01-04 17:13:39

Working on the proggy for mah cannonball script, and I'm encountering a problem I can't seem to find a solution to it.
I've got the bmp converted in to a string, but I'm having trouble displaying it… Whenever simba trys to print the bmp I get "Error: Access violation at line 50"
Searched the forums and the methods listed haven't solved mah problem, so I think my code is flawed…


procedure paintProgress();
begin

smartImage.clear();
smartImage.drawBitmap(proggyBmp, Point(3,461));

end

rj

2015-01-04 17:14:46

did you declare the bitmap

Taric

2015-01-04 17:16:43

Yessir.

...proggyBmp: integer;...
...proggyBmp := BitmapFromString(571, 136, 'meJyEvQd3G0e27+u17sycM862' +
'bI8iE5iRc27knHMGSALMlEgxKWcrS1bOwbYcJNmWbVm2Z+zJ9sQzc' +
'+45d967X+B9kvevqkYDlH3f49qrV6G6ADYaQP36v/eu3dZg3BZOOO' +
'NZRyxtiyRt4SQXitsjKWcsg05m6LQGSac9mkYbw9C2BmN6l19r9xg' +
'9IYM7oHV4NTY3DD0qi8PkDRk9QfRjDIy0PQF0WgJRwcz+iMkXxhid'...

Frement

2015-01-04 17:35:53

Most likely you are accessing the image before you have defined it.

var
proggyBmp: integer;

begin
proggyBmp := BitmapFromString();
smartImage.clear();
smartImage.drawBitmap(proggyBmp, Point(3,461));
end.

KeepBotting

2015-01-04 17:53:04

Code's fine, "Access violation" errors mean you're telling the script to work with something that doesn't exist.

I see that you've defined your bitmap, but have you called the procedure that defined it before you try to access it?

Taric

2015-01-04 20:23:46

Whelp, I'm a derp. Thanks guys!