Bitmap croppedImage = bitmap.Clone(new Rectangle(0, top, bitmap.Width, limit - top), bitmap.PixelFormat);
System.Drawing.Image cha = image;
Graphics g = null;
ImageCodecInfo imageCodecInfo = null;
System.Drawing.Imaging.Encoder encoder;
EncoderParameter encoderParameter;
EncoderParameters encoderParameters;
ImageCodecInfo[] encoders;
encoders = ImageCodecInfo.GetImageEncoders();
for (int j = 0; j < encoders.Length; ++j)
if (encoders[j].MimeType == "image/tiff")
imageCodecInfo = encoders[j];
encoder = System.Drawing.Imaging.Encoder.Compression;
encoderParameters = new EncoderParameters(1);
encoderParameter = new EncoderParameter(encoder, (long)EncoderValue.CompressionLZW);
encoderParameters.Param[0] = encoderParameter;
string path = this.TempFileName("tif");
croppedImage.Save(path, imageCodecInfo, encoderParameters);
System.Drawing.Image m = Metafile.FromFile(path);
Wednesday, September 19, 2012
How to crop and compress an bitmap file and load it as a Meta File
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Why we need asynchronous tasks? Execute a time consuming operations in parallel to the CLR thread which execute the request If you have ...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
No comments:
Post a Comment