BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get jpeg color depth?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Joćo Pereira
Guest





PostPosted: Mon Oct 06, 2003 12:08 pm    Post subject: How to get jpeg color depth? Reply with quote



How is it possible to do that with TJPEGImage or else...
I've try this:

Quote:
TJPEGImage *Jpeg = new TJPEGImage;
Graphics::TBitmap *bmp = new Graphics::TBitmap;
Jpeg->LoadFromFile(OpenDialog1->Files->Strings[num]);
bmp->Assign(Jpeg);

switch(bmp->PixelFormat)
{
case 0: LColorA->Caption="pfDevice";
break;
case 1: LColorA->Caption="pf1bit";
break;
case 2: LColorA->Caption="pf4bit";
break;
case 3: LColorA->Caption="pf8bit";
break;
case 4: LColorA->Caption="pf15bit";
break;
case 5: LColorA->Caption="pf16bit";
break;
case 6: LColorA->Caption="pf24bit";
break;
case 7: LColorA->Caption="Costum";
break;
}
...


but it always return pf24bit.

Thx in advance.





Back to top
Hans Galema
Guest





PostPosted: Mon Oct 06, 2003 1:11 pm    Post subject: Re: How to get jpeg color depth? Reply with quote



Joćo Pereira wrote:
Quote:
How is it possible to do that with TJPEGImage or else...

Please do not refer to the Subject. (Second time).

Quote:
I've try this:
...
...
but it always return pf24bit.

You were already told how that was possible. You did not reply
to that post, but instead replied to your own post thereby
neglecting the reply. Why ?

You also got a hint. To help you more: place the cursor in the
word TJPEGImage. Hit F1 and choose Properties. There you will
see a PixelFormat. You can also look at the Palette.

Hans.


Back to top
Joćo Pereira
Guest





PostPosted: Mon Oct 06, 2003 1:46 pm    Post subject: Re: How to get jpeg color depth? Reply with quote



sorry about that, but i've update my outlook and it has deleted my newsgroup
message.
So i haven't read your post, could you help me again?
what's wrong with the code that i've post?
Thx again


"Hans Galema" <j.m.galema.dontusethis (AT) maartens (DOT) nl> wrote

Quote:
Joćo Pereira wrote:
How is it possible to do that with TJPEGImage or else...

Please do not refer to the Subject. (Second time).

I've try this:
...
...
but it always return pf24bit.

You were already told how that was possible. You did not reply
to that post, but instead replied to your own post thereby
neglecting the reply. Why ?

You also got a hint. To help you more: place the cursor in the
word TJPEGImage. Hit F1 and choose Properties. There you will
see a PixelFormat. You can also look at the Palette.

Hans.




Back to top
Hans Galema
Guest





PostPosted: Mon Oct 06, 2003 2:26 pm    Post subject: Re: How to get jpeg color depth? Reply with quote

Joćo Pereira wrote:
Quote:
what's wrong with the code that i've post?

Just told you. And you could read my other posts too.

But to be more clear: do away with:

Quote:
switch(bmp->PixelFormat)

For determining the PixelFormat of a jpg file you should not
assign it to a bitmap but investigate the instance of TJPEGImage.

TJPEGImage *Jpeg = new TJPEGImage;
Jpeg->LoadFromFile(OpenDialog1->Files->Strings[num]);

Now you should have a look at

Jpeg->PixelFormat

or
Jpeg->Palette

Look in the help for more info.

Hans.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.