You need to have the .bmp property in the draw method. For this you must define either a QBitmap ro a QImage. Here's what you need to write - (Using $resource, as you have done, integrates test.bmp into the executable file - you can shorten the program a bit by defining 'bl1.BMP = "test.bmp"', and removing the '$resource' and the 'bl1.BMPhandle' lines, but this means you have to distribute the bitmap with the executable as a separate file --- It's up to you.) $RESOURCE bl2 AS "test.bmp"
DIM bl1 AS QIMAGE
bl1.BMPhandle = bl2
DIM form AS QFORM
form.width = 300
form.height = 300
form.center
form.CAPTION = " Diona's eye"
DIM Image AS QCANVAS
Image.Height = 200
Image.Width = 200
Image.Left = 4
Image.Top = 4
Image.OnPaint = Image.Paint
Image.PARENT = Form
Form.SHOWMODAL
SUB Image.Paint
Image.rectangle (9,9,79,48,&hFFFFFF)
Image.draw (10,10,bl1.BMP)
Image.rectangle (0,0,200,200,&hFFFFFF)
END SUB
|