Tags: bitmap, class, code, convert, example, hangs, image, images, net, pixelformatformat8bppindexed, reduce, sharp, size

PixelFormat.Format8bppIndexed in Bitmap Hangs!

On .Net » .Net C# (C sharp)

981 words with 0 Comments; publish: Mon, 02 Jun 2008 17:55:00 GMT; (10093.75, « »)

Hello,

I'm trying to convert Images using Bitmap class. I want to use

different options for example

reduce the size of image.

In my code I tried to create a Bitmap class instance with a Bitmap's

constructor:

new Bitmap(source.Width, source.Height, PixelFormat.Format8bppIndexed);

The result was that program stopped executing and started to hang. If I

create a Bitmap

with a constructor Bitmap(source.Width, source.Height) everything is

ok.

Does anyone know what happends when I give PixelFormat class as an

third parameter

to Bitmap's constructor?

So, If this does not work how should I create different type of Bitmaps

with different features?

My purpose is to convert Color Tiff image to as light GrayScale Tiff

image as possible (ligth = size of the file is smallest). Can C#'s

Image handling classes help me or not.. anyone know

about this?

Cheers.

All Comments

Leave a comment...

  • 0 Comments