On Apr 2, 2007, at 4:31 PM, Robert Fang wrote:

> Thanks Joe... Here's an example:
>
> I have a canvas on a window. The canvas width is 260, and height is  
> 195. I
> have a pushbutton with the following code in the Action event:
>
> Dim MyRect as New RectShape
> Dim MyGroup as New Group2D
>
> MyRect.FillColor=RGB(255,0,0)
> MyRect.BorderColor=RGB(0,0,0)
> MyRect.BorderWidth=2
> MyRect.Border=100
>
> MyRect.Width=50
> MyRect.Height=50
> MyRect.x=20
> MyRect.y=20
>
> MyGroup.Append(MyRect)
>
> Canvas1.Graphics.DrawObject(MyGroup,0,0)
>
> In this example, I would expect the rectangle object to be drawn 20  
> pixels
> from both the left and top edges of the canvas. However, the rectangle
> object is drawn beyond the left and top edges, to where the entire  
> rectangle
> is not visible. Changing the width and height of the RectShape (to 100
> pixels each) will cause it to shift further to the left and top,  
> moving even
> further out of the boundaries of the canvas.
>

The x, y coordinates of MyRect locate the <center> of your rectangle,  
so yes, a portion will be off the canvas using x = 20, y = 20. Change  
these coordinates to locate the center where you want the center to  
be, and just do: Canvas1.Graphics.DrawObject MyGroup.

Best,

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to