converting images

  • Thread starter Thread starter stecus
  • Start date Start date
S

stecus

Hello All,

I am trying to convert an images BMP to an images GIF.
This works fine but I want to adjust de resolution from het GIF images.
Can I do this or is it not possibel? Does anyone have an example?

Bitmap mybmp = new Bitmap(strFileToConvert);

mybmp.Save(strFileToConvert + .gif",System.Drawing.Imaging.ImageFormat.Gif);

Image2.ImageUrl = strFileToConvert + ".gif";



Thanks,

Stefan
 
Hi Stefan,
Hello All,

I am trying to convert an images BMP to an images GIF.
This works fine but I want to adjust de resolution from het GIF images.
Can I do this or is it not possibel? Does anyone have an example?

Bitmap mybmp = new Bitmap(strFileToConvert);

mybmp.Save(strFileToConvert + .gif",System.Drawing.Imaging.ImageFormat.Gif);

Image2.ImageUrl = strFileToConvert + ".gif";

Do You want to resize bitmap (width/height) or something more
complicated? If true then do You want do resize "canvas" or
"scale" the bitmap?

To set resolution (dots per inch) you can call
Bitmap.SetResolution method.

Regards

Marcin
 
Hello Marcin,



I am developing a application where the user can choose the size of the
image (width/height) and the kind of image they want to have (bmp, png, gif,
....).

The basic image where I start from is a BMP or a JPEG.



THANKS,



Stefan
 
Hi Stefan,
I am developing a application where the user can choose the size of the
image (width/height) and the kind of image they want to have (bmp, png, gif,
...).

The basic image where I start from is a BMP or a JPEG.

Only way to define Bitmap size is to set its constructor parameters e.g.:
new Bitmap(int width, int height, PixelFormat pixelFormat)

or creates an image copy with defined size:
new Bitmap(Image originalImage, Size newSize)

I hope its an expected solution. If You want some more... then
don't affraid to feedback.

Regards

Marcin
 
Hello,

I can convert the images now and view them in paint and in de preview window
from microsoft windows xp, but I can't open the images(gif, jpeg, ...) in
fireworks and photoshop.
Does anybody know what I do wrong?

Bitmap bmpHulp = new Bitmap(strFileToConvert);

Bitmap mybmp = new Bitmap(bmpHulp,bmpSiz);


mybmp.SetResolution(intResX,intResY);

mybmp.Save(newFileName);

Thanks,

Stefan
 
Back
Top