I'm trying to create a resized image from a bitmap, set a new height / width and a new resolution and it I can save it to PNG directly from A. I) Image.FromFile (filename)
or B) New Bitmap (imageSource)
to A < Em> be given a bitmap to b . Both works are fine schmokay, but A I do not have permission to set a new width / height on construction (but this is to me useIcm = true
) And b does not allow me to set the prices.
OK, now on some codes and examples:
-
New bitmap as image source (ImagePath and IIMAZ1)
& Lt; - Not quite good (# 1 surcharge). Do not preserve things likehorizontal resolution
orPixelFormat
on. Save
-
Dim sourceBitmap2 as Bitmap = Image.FromFile (imagePath and myImage1 name, true)
& lt; -No good (# 5 surcharge). It does preserve things likehorizontal resolution
orPixelFormat
on. Save
, but it doesn \ t allows me to initialize the image in a new shape. -
Slow target bitmap as new bitmap (sourceBitmap2, newWidth, newHeight)
& lt; -not nice. AlthoughsourceBitmap2
(see # 2 above) was started withuseIcm = True
, but whenever I made it happen totargetBitmap
.
In fact, I use a new bitmap useIcm = true
and at the same time ( width
/ Once the property is read
I have gone Graphics. Drymage
also under the path and this is the same - Graphics. Frame image (sourcebitmap)
does not preserve values .
Why do I need them to preserve the values? Because I have to put these images in PNG (for file size) in a new resolution and to have the same physical dimension (W / H inches) for printing. I think the width of the new pixel / height is based on the resolution values, which I call me . Passes with. SATRsolution (xDpi, yDpi)
, to protect the physical dimensions, so there is no problem. The problem is that PixelFormatSize
needs to be unchanged (yes, I have tried it EncoderParameters
- They do not work. If you want, I can give you flawed details, but just enough to say, they just do not work).
Wow, got my chest! Okay, anyone who really knows how all these works can help?
Edit : PNG: BMP, TIF, GIF, WMF, EMF
Why not just new bitmap (image.phramefile (imagePath and myImage1 name, True), Nudity, NewHead) as a slow target bitmap?
Comments
Post a Comment