Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Background Screen Setting
Message
De
12/01/2021 10:22:30
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01677804
Message ID:
01677807
Vues:
37
Thanks for the assistance. I didn't notice that uppercase/lowercase discrepancy. Let me adjust that and see what it results.

Wjere is your checking for lcBgType = "CENTER"?
Also lcBgType is lowercase and you compare it with UPPER case words I thing all will go to the OTHERWISE part of DO CASE


>Howdy all,
>
>I am trying to setup a background screen image upon FP 9.0 application opening up (after succesful login). The code listed below works but when I run it on different monitor sizes, the image isn't centered on the monitor. Is there a way to ensure that regardless of which size the monitor is, the screen background image is centered on the monitor size?
>
>lcImage = "mainlogo_g.png"
>
>lcBgType = "center"
>
>IF NOT PEMSTATUS(_Screen, "oImg", 5)
> _Screen.AddObject("oImg", "Image")
>ENDIF
>
>WITH _Screen.oImg
> .Visible = .F.
> .Stretch = 0
> .Picture = lcImage
> DO CASE
> CASE lcBgType == "STRETCH"
> .Top = 0
> .Left = 0
> .Stretch = 2
> .Height = _Screen.Height
> .Width = _Screen.Width
> CASE lcBgType == "ISOMETRIC"
> .Stretch = 1
> .Height = _Screen.Height
> .Width = _Screen.Width
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
> CASE lcBgType == "CENTER"
> .Stretch = 0
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
>
> OTHERWISE
> .Top = 0
> .Left = 0
> .Stretch = 0
> ENDCASE
> .Visible = .T.
>
>endwithlcImage = "mainlogo_g.png"
>* Center Image
>*lcBgType = "CENTER"
>* Stretch image
>lcBgType = "center"
>
>IF NOT PEMSTATUS(_Screen, "oImg", 5)
> _Screen.AddObject("oImg", "Image")
>ENDIF
>
>WITH _Screen.oImg
> .Visible = .F.
> .Stretch = 0
> .Picture = lcImage
> DO CASE
> CASE lcBgType == "STRETCH"
> .Top = 0
> .Left = 0
> .Stretch = 2
> .Height = _Screen.Height
> .Width = _Screen.Width
> CASE lcBgType == "ISOMETRIC"
> .Stretch = 1
> .Height = _Screen.Height
> .Width = _Screen.Width
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
> CASE lcBgType == "CENTER"
> .Stretch = 0
> .Top = (_Screen.Height - .Height) / 2
> .Left = (_Screen.Width - .Width) / 2
>
> OTHERWISE
> .Top = 0
> .Left = 0
> .Stretch = 0
> ENDCASE
> .Visible = .T.
>
>endwith
Thanks in Advance.

J. Turner
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform