I'm using PXCV_DrawPageToDC to produce a TBitmap in Delphi from the PDF Page.
Is there a way to know what the PixelFormat is of the image contained in the PDF page before I convert the page to a Bitmap. I want to keep my Bitmap size down as much as I can especially for black and white image.
Currently, I set the Bitmap pixel format to 24bit because I don't know if the PDF page I'm rasterizing is B&W or Color.
I need a way either before or after calling PXCV_DrawPageToDC to know if I have a B&W, grayscale, or color image.
PXCV_DrawPageToDC
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: PXCV_DrawPageToDC
No, there is no way to automatically know the 'minimum possible' format for the page.
You can calculate the number of colors in your TBitmap and reduce its format to Palette, Gray or B&W after conversion if the number of colors <= 256.
You can calculate the number of colors in your TBitmap and reduce its format to Palette, Gray or B&W after conversion if the number of colors <= 256.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.