Jpg Height and Width?
Jpg Height and Width?
Hi fw's,
is possible to know the dimensions (Height and Width) of an Jpg with Fwh?
is possible to know the dimensions (Height and Width) of an Jpg with Fwh?
Ciao, best regards,
Ugo
Ugo
- Enrico Maria Giordano
- Posts: 7356
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Jpg Height and Width?
Load it in a TImage control and then use nHeight() and nWidth() methods.
EMG
EMG
Re: Jpg Height and Width?
Enrico,EnricoMaria wrote:Load it in a TImage control and then use nHeight() and nWidth() methods.
is possible to load only in memory?
(not in an object/resource?)
I want use this info only for know if the image is horizontal or vertical.
thank you.
Ciao, best regards,
Ugo
Ugo
Re: Jpg Height and Width?
Enrico,EnricoMaria wrote:Load it in a TImage control and then use nHeight() and nWidth() methods.
I test this code:
Code: Select all
oImg := TImage():Define( , cImage, oDlg )
nHorDim := oImg:nWidth()
nVerDim := oImg:nHeight()
oImg := Nil // is correct for release the lib?
MsgInfo( "Altezza " + cValToChar( nVerDim ) + CRLF +;
"Larghezza " + cValToChar( nHorDim ), "" )
in cImage there is a correct path and jpg file name,
use the standard nviewlib;
where is my error?
and
Code: Select all
oImg := Nil
is correct to release the lib?
Thank you.
Ciao, best regards,
Ugo
Ugo
- Enrico Maria Giordano
- Posts: 7356
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Jpg Height and Width?
This is a working sample:
EMG
Code: Select all
#include "Fivewin.ch"
STATIC hLib
FUNCTION MAIN()
LOCAL oDlg, oImg
DEFINE DIALOG oDlg
@ 0, 1 BUTTON "Sizes" ACTION SHOWSIZES( oDlg )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
STATIC FUNCTION SHOWSIZES( oDlg )
LOCAL oImg := TImage():Define( , "SFONDO.JPG", oDlg )
? oImg:nWidth(), oImg:nHeight()
oImg:End()
RETURN NIL
- Enrico Maria Giordano
- Posts: 7356
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Jpg Height and Width?
No, you need oImg:End() or RELEASE IMAGE oImg.Ugo wrote:Code: Select all
oImg := Nil
is correct to release the lib?
EMG
Re: Jpg Height and Width?
Enrico,EnricoMaria wrote:This is a working sample:
...
work but in any case return 0 and 0
it is correct?
Ciao, best regards,
Ugo
Ugo
Re: Jpg Height and Width?
EnricoMaria wrote:No, you need oImg:End() or RELEASE IMAGE oImg.

Thank you.
Ciao, best regards,
Ugo
Ugo
- Enrico Maria Giordano
- Posts: 7356
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Jpg Height and Width?
Which cases? Can I reproduce the problem? How?Ugo wrote:Enrico,EnricoMaria wrote:This is a working sample:
...
work but in any case return 0 and 0
it is correct?
EMG
Re: Jpg Height and Width?
Yes, the case is the jpg create from my camera!EnricoMaria wrote:Which cases? Can I reproduce the problem? How?

Can I send to your mail?
Ciao, best regards,
Ugo
Ugo
- Enrico Maria Giordano
- Posts: 7356
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: