Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I center a .Picture on my _SCREEN?
Message
From
08/01/1999 11:15:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00174015
Message ID:
00174047
Views:
27
>>>I want an image to display as a backdrop to my app but when assigning it to _SCREEN.Picture it gets stuck in the upper left corner of my screen.
>>>
>>>How do I center it?
>>>
>>>(This must be easy for SOMEBODY...)
>>>
>>>Thanx,
>>>Joe
>>
>>You can add image object to _SCREEN and then center it:
>>_screen.addobject("MyImage","Image")
>>_screen.myimage.left=(_screen.width-_screen.myimage.width)/2
>>_screen.myimage.top=(_screen.height-_screen.myimage.height)/2
>>_screen.myimage.visible=.t.
>
>Is there something missing here?
>This code doesn't appear to reference an actual image file.
>I am no longer setting _SCREEN.PICTURE, but the following code is STILL leaving the image plastered in the upper left corner
>
>._screen.addobject("MyImage", "Image")
>WITH _SCREEN.myimage
> .picture = "BMPS\Lw2000.Bmp"
> .left = int( (_screen.Width - .width ) / 2 )
> .top = int( (_screen.Height - .height ) / 2 )
> .visible = .t.
>ENDWITH
>
>What am I doing wrong?

MyImage.Strecth=1
Also, it's reasonable to set MyImage.Width/Height explicitly.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform