Re: Copying Format1bppIndexed Images
- From: "Michael Phillips, Jr." <mphillips53@xxxxxxxxxxxxxxx>
- Date: Thu, 8 Dec 2005 12:42:39 -0500
Assuming that your source image has a resolution of 204 DPI by 196 DPI,
then use SetResolution to set the new Bitmap's resolution to match the
source.
"Tom Bean" <tbean@xxxxxxxxxxxxxxxx> wrote in message
news:OUWM$iB$FHA.3872@xxxxxxxxxxxxxxxxxxxxxxx
> Michael,
>
> One of the problems with the method you suggested is that the new bitmap
> is created with a HorizontalResolution and VerticalResolution of 96,
> whereas my original image had a HorizontalResolution of 204 and a
> VerticalResolution of 196. If possible, I would like to preserve the
> resolution of the images.
>
> Do you have any suggestions about how I can use this method and keep the
> higher resolution?
>
> Tom
>
> "Michael Phillips, Jr." <mphillips53@xxxxxxxxxxxxxxx> wrote in message
> news:eermB74%23FHA.160@xxxxxxxxxxxxxxxxxxxxxxx
>> Assuming that you are checking to make sure that you
>> have a PixelFormat1bppIndexed image when you
>> call SelectActiveFrame, use Lockbits to obtain the BitmapData
>> and then create a new Bitmap with the constructor
>> Bitmap(int width, int height, int stride, PixelFormat format, IntPtr
>> Scan0)!
>>
>>
>> "Tom Bean" <tbean@xxxxxxxxxxxxxxxx> wrote in message
>> news:OS92Yn3%23FHA.2676@xxxxxxxxxxxxxxxxxxxxxxx
>>> My application breaks multi-page faxes into a collection of images, one
>>> for each page. The faxes are saved by our fax software as multi-frame
>>> TIFFs with a pixel format of Format1bppIndexed.
>>>
>>> While processing the pages, I am creating a new Bitmap of each frame and
>>> found the new Bitmap had a pixel format of Format32bppArgb. As a
>>> consequence of the change from Format1bppIndexed to Format32bppArgb, the
>>> page images are much larger and are causing out of memory errors.
>>>
>>> How can I copy the page image, after calling SelectActiveFrame(), so the
>>> Format1bppIndexed pixel format is preserved?
>>>
>>> Thanks,
>>> Tom
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: Copying Format1bppIndexed Images
- From: Tom Bean
- Re: Copying Format1bppIndexed Images
- References:
- Copying Format1bppIndexed Images
- From: Tom Bean
- Re: Copying Format1bppIndexed Images
- From: Michael Phillips, Jr.
- Re: Copying Format1bppIndexed Images
- From: Tom Bean
- Copying Format1bppIndexed Images
- Prev by Date: Re: Copying Format1bppIndexed Images
- Next by Date: Re: Copying Format1bppIndexed Images
- Previous by thread: Re: Copying Format1bppIndexed Images
- Next by thread: Re: Copying Format1bppIndexed Images
- Index(es):
Relevant Pages
|