Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Kevin
  Where is Kevin?
 edwardsville
 Illinois - United States
 Kevin
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: Image in a screen
Thread ID: 143416 Message ID: 143592 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Thursday, August 30, 2007 5:58:07 AM         
   


> >
> >
> >
> > what would be a good way to center a logo that could be any shape or size?
>
> Kevin,
>
> Centering a logo is simple, as long as you know how wide and high your screen is. SYSMETRIC() can do this for you. The following will center an image on _Screen regardless of the resolution selected by the user. I would not normally do this - I would use a top level form instead and center the image on that form.
>
>
> ***** TOTALLY UNTESTED AND OFF THE TOP OF MY HEAD *****
> _screen.AddObject([loImage],[Image]) && Create an image object
> WITH _Screen.loImage
>    .Picture = lcMyImageFile && A variable holding the path and file name of your image
>    .Stretch = 1 && Isometric
>    .Height = lnMyDesiredHeight && set this to the height you wish to display
>    .Left = (SYSMETRIC(1)/2)-(_Screen.loImage.Width/2) && Center the image horizontally
>    .Top = (SYSMETRIC(2)/2)-(_Screen.loImage.Height/2) && Center the image vertically
>    .Visible = .t. && Show it
> ENDWITH
> 

> If you were to do this with a top level form, you would add the image object to your form and then use the form's .Width and .Height properties rather than SYSMETRIC(). Of course, if you were doing this on a form, you could also do it visually. Drop an image object on the form, center it using the Format->Align menu option and you are good to go. Much simpler.
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)


Thanks Ken
This is causing an error when I take it out it works fine
what should I be doing with this line?
Height = lnMyDesiredHeight && set this to the height you wish to display

ENTIRE THREAD

Image in a screen Posted by FoxGuy Degante @ 8/28/2007 5:39:11 PM
RE: Image in a screen Posted by tushar @ 8/28/2007 5:54:23 PM
RE: Image in a screen Posted by FoxGuy Degante @ 8/28/2007 6:21:43 PM
RE: Image in a screen Posted by tushar @ 8/28/2007 7:01:38 PM
RE: Image in a screen Posted by Kevin @ 8/29/2007 1:23:46 AM
RE: Image in a screen Posted by Ken Murphy @ 8/29/2007 4:07:03 AM
RE: Image in a screen Posted by Kevin @ 8/30/2007 5:58:07 AM
RE: Image in a screen Posted by tushar @ 8/30/2007 6:41:11 AM
RE: Image in a screen Posted by Ken Murphy @ 8/30/2007 1:04:06 PM
RE: Image in a screen Posted by Andy Kramek @ 8/28/2007 5:55:11 PM
RE: Image in a screen Posted by FoxGuy Degante @ 8/28/2007 6:22:45 PM
RE: Image in a screen Posted by Ken Murphy @ 8/28/2007 6:32:24 PM
RE: Image in a screen Posted by Andy Kramek @ 8/30/2007 1:13:26 PM