SRL Archive - OSR Help

SMART_DrawBox Puzzle


loragnor

2013-08-10 22:24:13

Greets - I have the following code snippet:

Procedure test;
var
w,h,ccx,ccy,x1,y2,x2,y2: Integer;
begin
// Get the client dimensions
GetClientDimensions(w,h);
// Get the client center point
ccx:=round(w/2);
ccy:=round(h/2);
SRL_Warn('test','The client center is '+tostr(Point(ccx,ccy)),warn_Debug);
// Move the mouse to client center
mmouse(ccx,ccy,0,0);
// Set the box limits
x1:=ccx-125;
y1:=ccy-120;
x2:=ccx+135;
y2:=ccy-15;
// Draw the box
SRL_Warn('test','The box will be drawn at '+tostr(Point(x1,y1))+', '+tostr(Point(x2,y2)),warn_Debug);
SMART_DrawBox(inttobox(x1,y1,x2,y2));
end;

This is supposed to locate the center of the client, move the mouse there, then draw a box. It should look like this:

[ATTACH=CONFIG]22056[/ATTACH]

However, what it really looks like is this:

[ATTACH=CONFIG]22057[/ATTACH]

Any ideas? Would really appreciate any help as this is making me crazy. :confused:

Olly

2013-08-10 22:28:12

Did you update the size of the TMufasaBitmap (SMART_CANVAS).

loragnor

2013-08-10 22:35:02

From: Olly
Did you update the size of the TMufasaBitmap (SMART_CANVAS).


Since I have no idea what you are talking about, I would have to say no. How do I do that?

Edit:

Thank you @Olly. I went into smartgraphics and changed
SMART_Canvas.SetPersistentMemory(SmartDebugArray, 765, 553);
to
SMART_Canvas.SetPersistentMemory(SmartDebugArray, 960, 640);
and it works just fine.

Thanks !!!!!

Olly

2013-08-10 22:50:52

see you solved it…. :)