Hi,
If I want users to be able to drop a jpg image into my canvas - is my code below correct?
I understand that I also need to define the file types in a file type set, but just need to know if my code below is the correct way to do this.
Or is there a better way.
If Obj.PictureAvailable then
me.image=obj.picture
Elseif Obj.FolderItemAvailable then
me.image=Picture.Open(obj.FolderItem)
End if
you might want to create a global PICTURE object (call if P)
in your Canvas Paint Event put
if p<>nil then g.drawpicture p,0,0
In the canvas DROPOBJECT event
If Obj.PictureAvailable then
p=new picture(obj.picture.width,obj.picture.height)
p.graphics.drawpicture obj.picture,0,0
Elseif Obj.FolderItemAvailable then
p=Picture.Open(obj.FolderItem)
End if
me.invalidate