Jump to content
Bixby Sayz

Drawing to SMART using SCAR

Recommended Posts

Trying to port one of my scripting aids over to SCAR and OSI and having a devil of a time. It would appear SCAR's implementation of TBitmap is slightly different than Simba's?

 

The code below runs without error in Simba (using SRL of course). In SCAR it generates an access violation on line 21.

 

NB: Yes this is a contrived example that doesn't do much of anything.

 

program New;

{$DEFINE SMART}                   // Comment out to disable SMART
{$DEFINE RS2}
{$I OSI\OSI.scar}

var
 SmartCanvas: TBitmap;
 EmptyBitmap: Integer;

procedure ScriptTerminate;
begin
 FreeOSI;
end;

begin
 SetUpOSI;

 SmartSetDebug(True);
 SmartCanvas := TBitmap.Create;
 SmartCanvas.Canvas.Handle := SmartGetDebugDC;  // Access Violation here

 EmptyBitmap := BitmapFromString(SmartCanvas.Width , SmartCanvas.Height, '');
 SafeDrawBitmap(EmptyBitmap, SmartCanvas.Canvas, 0, 0);
 FreeBitmap(EmptyBitmap);
end.

 

Frustrating when things behave differently and there is precious little documentation.

Link to comment
Share on other sites

 

Frustrating when things behave differently and there is precious little documentation.

 

Quite possibly the most frustrating thing I've endured since simba has come around.

 

This doesn't look too too hard though, I will try to help you out in a few hours when I get back home again.. if someone doesn't beat me to it ;-P

Link to comment
Share on other sites

For the mean time I run my debug tools in Simba to help me with scripts I'm writing in SCAR using OSI. It works but it just feels wrong somehow.

 

Edit: And now out of the blue SMART has starting giving me that blasted "Applet Error" (but only with SCAR). I know when I am defeated. I am off to bed.

Edited by Bixby Sayz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...