Hi.

I have the following code inside the right click event of the screen in
order to place an image at runtime. However the image is not being displayed.
Can anyone tell me what is wrong? It relates to a previous question I had on
drawing on the screen. As a test, I am using the fox.bmp

public loimage
loimage = CREATEOBJECT("image")
loimage.Picture = "c:\vfp8\fox.bmp"
loimage.top = 100
loimage.left = 100
thisform.refresh

TIA
MIke

Re: Placing Images At Runtime by Bernhard

Bernhard
Fri Jun 22 16:39:29 CDT 2007

Hi Michael,

> I have the following code inside the right click event of the screen in
> order to place an image at runtime. However the image is not being displayed.
> Can anyone tell me what is wrong? It relates to a previous question I had on
> drawing on the screen. As a test, I am using the fox.bmp
>
> public loimage
> loimage = CREATEOBJECT("image")
> loimage.Picture = "c:\vfp8\fox.bmp"
> loimage.top = 100
> loimage.left = 100
> thisform.refresh
loimage is an independent object and not a child of the form. So it never
becomes visible.
You must add this object to the form and you have to set .visible to .t.:
thisform.AddObject("oImage", "image")
thisform.oImage.Picture =
...
thisform.oImage.visible = .T.

Regards
Bernhard Sander

Re: Placing Images At Runtime by Dan

Dan
Fri Jun 22 16:45:24 CDT 2007

Createobject() creates an object in memory but it doesn't add it to any
form. You want form.AddObject() instead. And you'll need to set .visible=.t.

Dan

Michael wrote:
> Hi.
>
> I have the following code inside the right click event of the screen
> in order to place an image at runtime. However the image is not being
> displayed. Can anyone tell me what is wrong? It relates to a previous
> question I had on drawing on the screen. As a test, I am using the
> fox.bmp
>
> public loimage
> loimage = CREATEOBJECT("image")
> loimage.Picture = "c:\vfp8\fox.bmp"
> loimage.top = 100
> loimage.left = 100
> thisform.refresh
>
> TIA
> MIke



Re: Placing Images At Runtime by christophe

christophe
Sat Jun 23 07:55:36 CDT 2007

Michael,

you will need to create your own image class
based on the image base class.
something like this

thisform.AddObject("oImage", "myimage")
thisform.oImage.Picture =
...
thisform.oImage.visible = .T.

in your prg or create a vcx.
define class myimage as image

enddefine
--
Christophe Steyaert
Int. Repair Services Zeebrugge
L. Blondeellaan 5
8380 Zeebrugge
tel : 050 54 20 27
fax : 050 54 79 84
"Michael" <Michael@discussions.microsoft.com> schreef in bericht
news:7387DA66-267D-4179-B846-4FC39C720CCD@microsoft.com...
> Hi.
>
> I have the following code inside the right click event of the screen in
> order to place an image at runtime. However the image is not being
> displayed.
> Can anyone tell me what is wrong? It relates to a previous question I had
> on
> drawing on the screen. As a test, I am using the fox.bmp
>
> public loimage
> loimage = CREATEOBJECT("image")
> loimage.Picture = "c:\vfp8\fox.bmp"
> loimage.top = 100
> loimage.left = 100
> thisform.refresh
>
> TIA
> MIke