Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: PictureVal reassign the same OS object picture
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Titre:
BUG: PictureVal reassign the same OS object picture
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01020236
Message ID:
01020236
Vues:
92
Reassign the same OS's object reference to a Image.PicturVal,
the OS's picture object it is released.

Repro:
CLEAR
oPicture1 = LOADPICTURE(HOME(4)+"\Bitmaps\Tlbr_w95\ARC.BMP")
oPicture2 = LOADPICTURE(HOME(4)+"\Bitmaps\Tlbr_w95\BACK.BMP")

WITH CREATEOBJECT("image")
	.PictureVal = m.oPicture1
	.PictureVal = m.oPicture2
	.PictureVal = m.oPicture1
	.PictureVal = m.oPicture2
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	* reassign the same image
	.PictureVal = m.oPicture2
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	.PictureVal = m.oPicture1
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	* reassign the same image
	.PictureVal = m.oPicture1
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
ENDWITH

RELEASE oPicture1,oPicture2

* workaround it is obvious : clear the PictureVal before to reassign

? "WORKAROUND"

oPicture1 = LOADPICTURE(HOME(4)+"\Bitmaps\Tlbr_w95\ARC.BMP")
oPicture2 = LOADPICTURE(HOME(4)+"\Bitmaps\Tlbr_w95\BACK.BMP")

WITH CREATEOBJECT("image")
	.PictureVal = m.oPicture1
	.PictureVal = m.oPicture2
	.PictureVal = m.oPicture1
	.PictureVal = m.oPicture2
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	* reassign the same image
	.PictureVal = 0h
	.PictureVal = m.oPicture2
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	.PictureVal = m.oPicture1
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
	* reassign the same image
	.PictureVal = 0h
	.PictureVal = m.oPicture1
	? "handles",m.oPicture1.Handle,m.oPicture2.Handle,"objects" at 40,m.oPicture1,m.oPicture2
ENDWITH

RELEASE oPicture1,oPicture2
Work with Pictures collection, remove the collection Item.

Fabio
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform