ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Incorrect color with ImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

michaeldca

Brazil
8 Posts

Posted - Dec 26 2016 :  14:04:21  Show Profile  Reply
I'm using the ImageEnView component to check the color of a TIFF file.

When doing the check it shows that the file is ImageEnView.IEBitmap.IsGrayScale = True, but the file is colored.

How do I make this differentiation?

Note: I need to know if the file is colored, grayscale or black and white.

Thank you very much in advance,

Michael

w2m

USA
1990 Posts

Posted - Dec 26 2016 :  14:19:42  Show Profile  Reply
I already showed you how to do this with your pdf question.

This functions here so I have no idea why it does not work for you.

function GetColorType(AIEBitmap: TIEBitmap): TIEColorType;
begin
  if AIEBitmap.Bitcount = 1 then
    Result := ieBlackWhite
  else if AIEBitmap.IsGrayScale then
    Result := ieGrayScale
  else if AIEBitmap.PaletteUsed > 2 then
    Result := ieColor
  else
    Result := ieUnknown;
end;

You have to show the code you use to load the IEBitmap and the code you are using to test the color.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

michaeldca

Brazil
8 Posts

Posted - Dec 26 2016 :  14:32:01  Show Profile  Reply
I pass the whole component.

Function GetColorType (ImageEnView: TImageEnView): String;
Begin
   If (ImageEnView <> nil) then
   Begin
     If ImageEnView.IEBitmap.BitCount = 1 then
       Result: = 'PB'
     Else if ImageEnView.IEBitmap.IsGrayScale then
       Result: = 'GRAY'
     Else if ImageEnView.IEBitmap.PaletteUsed> 2 then
       Result: = 'COLOR'
     Else
       Result: = ''
   End;
End;
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 26 2016 :  14:42:10  Show Profile  Reply
You still did not show all your code. My code does indeed work so you must be doing something else wrong. Submit a demo that shows the problem.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: