Hi,
I am really having trouble understanding the concept of this.
The code below is said to center an image in a canvas:
Where on earth is the width and height of the image called myImage defined in this code???
Dim p as Picture = new picture(Canvas1.Width, Canvas1.Height, 32)
p.graphics.forecolor = &cFFFFFF
p.graphics.rectfill(0,0,Canvas1.Width,Canvas1.Height)
p.Graphics.DrawPicture (myImage, (Canvas1.Width/2)-(p.Width/2),(Canvas1.Height/2)-(p.Height/2))
Line 1 seems to create a picture object, the width and height of the canvas
Line 2 sets the forecolor
Line 3 creates a rectangle the same width and height of the canvas
Line 4 makes no sense to me - as p seems to be equal to the Canvas1 width and height???