Determining if an Image is indexed or not

  • Thread starter Thread starter Jeff Stewart
  • Start date Start date
J

Jeff Stewart

Is there a procedure for determining whether or not an Image uses any of the
indexed pixel formats, short of checking against each one?
 
Jeff Stewart said:
Is there a procedure for determining whether or not an Image uses any of
the indexed pixel formats, short of checking against each one?

I am missing 'Image.IsIndexedPixelFormat'... A heuristic way would be
checking the number of items in the image's palette:

\\\
Dim img As Image = Image.FromFile(...)
MsgBox("Indexed format: " & CStr(img.Palette.Entries.Length > 0))
img.Dispose()
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top