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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image in Full screen

Status
Not open for further replies.

jcanon

IS-IT--Management
Jun 7, 2001
33
CO
How can I put an Image in full screen? (without task bar)
 
Is the question how do I change the user's "wallpaper"? If so the answer is - you shouldn't! Windows settings should be up to the user - whether it's Wallpaper, colors, font sizes, screen resolution, etc. - your application should adapt.

If it's how do I add an image to my VFP application window, then this code works for me:

* Program....: SET_APPIMAGE.PRG
LPARAMETER p_cImageName

WITH _screen
**-- Add an image object
*
IF VARTYPE(.myPic) = "O"
.RemoveObject('myPic')
ENDIF
.cls()
.AddObject('myPic','image')

**-- Set the picture property
*
.myPic.Picture = p_cImageName
.myPic.stretch = 1 && isometric

l_nAspectRatio = .MyPic.Height/.MyPic.Width
IF (.Height/.Width) <= l_nAspectRatio
.MyPic.Height = .Height
.MyPic.Width = .Height / l_nAspectRatio
ELSE
.MyPic.Width = .Width
.MyPic.Height = .Width / l_nAspectRatio
ENDIF

**-- Center the control and show it
*
.MyPic.Top = (.Height * .5) - (.myPic.Height * .5)
.MyPic.Left = (.Width * .5) - (.myPic.Width * .5)

IF !EMPTY(.myPic.Picture)
.myPic.Visible = .T.
ENDIF
ENDWITH &&* _screen

*!* EOP: SET_APPIMAGE.PRG

Rick
 
Sorry for not been especific. I'm working on a image viewer and I want to have the option &quot;full screen&quot; I mean, to show an image that use the entire screen,without task bar nor tittle bar or anything but the image itself. ¿It`s it possible?
 
jcanon

Create a new form and set the non default properties to be:-

WITH THIS
[tab].AlwaysOnTop = .T.
[tab].Borderstyle = 0
[tab].ShowWindow = 2
[tab].Titlebar = 0
[tab].WindowState = 2
ENDW

Add an .Image control, size and position are immaterial.

In the .Init event of the form put:-

WITH THIS
[tab].Image1.Left = 0
[tab].Image1.Height = .Height
[tab].Image1.Top = 0
[tab].Image1.Width = .Width
[tab].Image1.Stretch = 1
[tab].Image1.Picture = [C:\Images\Image1.jpg]
ENDW

In the .Click event of .Image1 put:-

WITH THISFORM
[tab].Visible = .F.
[tab].Release()
ENDW

You will need to pass [C:\Images\Image1.jpg] as a parameter to the form and change the .Image1.Picture property accordingly.

Clicking on the .Image control will release the form.

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top