[Gambas-user] Drawing Area Issues

Christopher Brian Jack brian at ...1334...
Sun Jan 22 22:21:26 CET 2006


I believe I have discoverd an off-by-one problem with the DrawingArea
control.

It's easy enough to reproduce:

1. Create a form with a DrawingArea control 640x480 pixels
2. In the form create a private picture variable
3. In the form startup
   a) instantiate the picture variable with a 640x480 image
   b) draw some thin lines

Draw.Begin(thePicture)
  Draw.LineWidth=1
  Draw.ForeColor=&H000000&
  Draw.FillColor=&H000000&
  Draw.FillStyle=Fill.solid
  Draw.Rect(0,0,640,480)
  Draw.FillStyle=Fill.none
  Draw.ForeColor=&Hffff00&
  Draw.Rect(0,0,640,480)
Draw.End

4. Draw the image in the DrawingArea it will not show the extreme right
and lower edges.

Draw.Begin(theDrawingArea)
  ' Rectangle has no right or bottom edges
  Draw.Picture(thePicture,0,0,0,0,640,480)
  ' Rectangle will show right+bottom but left and top are gone
  Draw.Picture(thePicture,0,0,1,1,640,480)
Draw.End

Workaround:

  * Make the DrawingArea exactly 1 pixel wider and 1 pixel higher.

==================================================
Christopher BRIAN Jack aka "Gau of the Veldt"
==================================================
brian at ...1334...
brian at ...1335...
brian at ...1336...
brian at ...1337...
gau_veldt at ...67...
==================================================

-- Hi Spambots, my email address is sputnik at ...1334...




More information about the User mailing list