Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I place a logo in the center of the _Screen? 3

Status
Not open for further replies.

drumsticks

Programmer
Jun 5, 2004
18
0
0
US
I'm trying to find documentation on placing a logo in the center of the _Screen. I've seen a couple apps that have it, but I can't find anything on how to do it. Any ideas?

Regards,
Drumsticks
 
In the begining of you main program do this:

_Screen.Picture = "Images\MyImage.bmp" &&Your image path


I'm not sure if this is the best way to do it, but it works for me.

-Kevin
 
Code:
LOCAL oImage, oRemoveIt

* Just to remove the object after
* a predetermined time interval
oRemoveIt = CREATEOBJECT("clsTimer")

[green]* This is the only code needed[/green]
*{
[blue]_SCREEN.ADDOBJECT("image1","image")

oImage = _SCREEN.image1
oImage.PICTURE = "c:\windows\Prairie Wind.bmp"
oImage.LEFT = _SCREEN.WIDTH / 2 - oImage.WIDTH / 2
oImage.TOP  = _SCREEN.HEIGHT / 2 - oImage.HEIGHT / 2
oImage.VISIBLE = .T.[/blue]
* }

oRemoveIt.ENABLED = .T.

READ EVENTS

_SCREEN.REMOVEOBJECT("image1")


DEFINE CLASS clsTimer AS TIMER
  INTERVAL = 2000 && wait 2 secs before firing
  ENABLED = .F.

  PROCEDURE TIMER
    THIS.ENABLED = .F.
    CLEAR EVENTS
  ENDPROC

ENDDEFINE

Darrell
 
Drumsticks,

Both of the above suggestions will work fine. However, Kevin's approach (using _SCREEN.Picture) will cause the image to "tile" (repeat) across the screen, whereas Darrell's code will give you a single centred image.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Thank you guys for all your recommendations. All were helpful!

Regards,
Drumsticks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top