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: Fri Oct 03, 2003 5:53 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:

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: Sat Oct 04, 2003 6:58 am    Post subject: Re: How to get jpeg color depth? Reply with quote



Joćo Pereira wrote:
Quote:
How is it possible to do that

Please do not refer to the Subject of your post. Put all info
in the body.

Quote:
with TJPEGImage or else...
I've try this:

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

switch(bmp->PixelFormat)

.....
but it always return pf24bit.

That could be possible if during

bmp->Assign(Jpeg);

the colordepth was converted to pf24bit regardless of the
colordepth of the TJPEGImage.

If you want the original colordepth of the TJPEGImage then
you should investigate the TJPEGImage *Jpeg.

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.