How do I save Image with a different resolution?
-
How do I save Image with a different resolution? I am using Image.Save(...) I think it might have to do with Image.PropertyItems and using SetPropertieItem, but I am only finding info on id, length, value, and type.
-
How do I save Image with a different resolution? I am using Image.Save(...) I think it might have to do with Image.PropertyItems and using SetPropertieItem, but I am only finding info on id, length, value, and type.
-
I haven't done much with the System.Drawing namespace, but a quick look and I found the SizeConverter Class. http://msdn2.microsoft.com/en-us/library/system.drawing.sizeconverter_members(VS.80).aspx[^]
I tried this... Bitmap b = new Bitmap(currentImage); b.SetResolution(150, 150); b.Save(saveImageDialog.FileName, System.Drawing.Imaging.ImageFormat.Tiff); and it didn't work, but I don't know why. I will look at the size converter class. Thanks.
-
I tried this... Bitmap b = new Bitmap(currentImage); b.SetResolution(150, 150); b.Save(saveImageDialog.FileName, System.Drawing.Imaging.ImageFormat.Tiff); and it didn't work, but I don't know why. I will look at the size converter class. Thanks.
aei_totten wrote:
I tried this... Bitmap b = new Bitmap(currentImage); b.SetResolution(150, 150); b.Save(saveImageDialog.FileName, System.Drawing.Imaging.ImageFormat.Tiff); and it didn't work, but I don't know why.
I think that it worked just fine, but it didn't do what you throught that it would do. The SetResolution method does set the resolution of the image, but what you want to do is to change the size of the image. Create a new
Bitmap
object with the size that you want. Create aGraphics
object for that bitmap using theGraphics.FromImage
method. Use theDrawImage
method to draw your image onto the bitmap with the desired size.--- single minded; short sighted; long gone;