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:
Posts (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...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
-
Demo : I am using asp.net UpdatePanel control to partial page update. As there is no keyup event for the asp.net TextBox control, I add an ...