Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GDIplusX
Message
De
19/11/2007 11:43:52
 
 
À
19/11/2007 11:34:29
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01269875
Message ID:
01269927
Vues:
24
>>>this code works if I have a multipage Tiff
>>>it shows nothing when its a one page TIFF
>>>What should be done in the case of a single page tiff?
>>>
>>>
>>>WITH _SCREEN.SYSTEM.Drawing
>>>	* Load the multiframe TIFF to GDI+
>>>	this.oMultif = .BITMAP.New(ALLTRIM(THIS.cSourceFile))
>>>	this.nFrames = this.oMultif.GetFrameCount()
>>>	this.txt3.Refresh()
>>>	IF this.nFrames > 1
>>>		this.nPictureCounter=0
>>>		this.oMultif.SelectActiveFrame(.Imaging.FrameDimension.PAGE, this.nPictureCounter)
>>>		This.Image1.PictureVal = this.oMultif.GetPictureVal(.Imaging.ImageFormat.Tiff)
>>>	ELSE
>>>		MESSAGEBOX("The selected file is not a Multiframe TIFF",0,'',5000)
>>>		*this.oMultif.SelectActiveFrame(.Imaging.FrameDimension.PAGE, this.nPictureCounter)
>>>		This.Image1.Picture = ALLTRIM(THIS.cSourceFile)
>>>		
>>>	ENDIF
>>>
>>>
>>>
>>>Thanks
>>>
>>>Peter
>>
>>
>>Hi Peter,
>>
>>What value does the expression
>>
>>
this.oMultif.GetFrameCount()
>>
>>Return to you ?
>
>
>It returns 0

Thanks Peter,

This is the correct behavior.

The first frame has the index number #0.
So, if you have only one frame, you'll receive a ZERO in GetFrameCount()

Changing this line will make it easier to work with.
this.nFrames = this.oMultif.GetFrameCount() + 1
Before you say. I agree it's really strange to receive the ZERO value when you have one frame, but that's how GdiPlus.dll works, and the .NET samples work too.

Here you can have more samples using TIFFs:
http://weblogs.foxite.com/cesarchalom/archive/2007/11/06/5338.aspx

HTH

Cesar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform