Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP HWND problem
Message
De
03/07/1998 03:08:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
VFP HWND problem
Divers
Thread ID:
00113986
Message ID:
00113986
Vues:
64
I have using the HWND control to display image...

and I want to adjust the image size according to my defined ratio!

But I found that even the loadpicture() has loaded a small picture,
the control do not readjust the height, width, properties but the image has been smallen!

So, my coding Thisform.RightPictureRatio() is totally failed now!
~~>_<~~

This fx. will be called when change item record and assigning the
path of image! (Item.Photo as normal text field carry the pathname)
* Thisform.RightPictureRatio()
#DEFINE OWIDTH 432
#DEFINE OHEIGHT 240
#DEFINE OTOP 196
#DEFINE OLEFT 318

LOCAL IHEIGHT, IWIDTH
IF !EMPTY(ITEM.PHOTO)
	ThisForm.OLEITEM.VISIBLE = .F.
	ThisForm.OLEITEM.TOP = 0
	ThisForm.OLEITEM.LEFT = 0
	ThisForm.OLEITEM.WIDTH = 758
	ThisForm.OLEITEM.HEIGHT = 482
	ThisForm.OLEITEM.PICTURE = LOADPICTURE(ITEM.PHOTO)
	ThisForm.OLEITEM.BORDERSTYLE = 1
ELSE
	ThisForm.OLEITEM.BORDERSTYLE = 0
ENDIF

IWIDTH = ThisForm.OLEITEM.WIDTH
IHEIGHT = ThisForm.OLEITEM.HEIGHT

IF ((OWIDTH / IWIDTH ) * IHEIGHT < OHEIGHT)
	ThisForm.OLEITEM.WIDTH = OWIDTH
	ThisForm.OLEITEM.HEIGHT = IHEIGHT * OWIDTH / IWIDTH
ELSE
	ThisForm.OLEITEM.WIDTH = IWIDTH * OHEIGHT / IHEIGHT 
	ThisForm.OLEITEM.HEIGHT = OHEIGHT
ENDIF

ThisForm.OLEITEM.TOP = OTOP
ThisForm.OLEITEM.LEFT = OLEFT
ThisForm.OLEITEM.VISIBLE = .T.

ENDIF
What can I do to detect the actually height and width of image so that
I can readjust the image to fit the fixed rectange with corresponding image size RATIO

Thanks!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Répondre
Fil
Voir

Click here to load this message in the networking platform