At 1:04 PM +0930 4/6/06, Chris Nillissen wrote:
Hi, I am using Realbasic 2006 demo, I just converted a simple VB
app
that draws to a Picture Box using the PictureBox.PSet command.
How do I
do this in RealBasic? and what control do I replace the Picture Box
with?
You would replace VB's PictureBox with a Canvas control.
In Rb, properties and methods such as Pixel(X,Y) belong to the
Graphics class. Instances of the Graphics class are available in the
Canvas control, and also in Windows, in Container controls and from
an OpenPrinter() object. Additionally, there is a Picture class for
offscreen images which also provides a Graphics context if created
using NewPicture.
In the Canvas, put your drawing code in the Paint event so that it
will be sustained when refreshed, as with AutoRedraw in VB. For example:
Sub Paint(g As Graphics)
dim i as integer
For i = 0 to g.Width
g.Pixel(i, g.Height/2) = &cFF0000
Next
End Sub
Best,
Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>