N
Narshe
I'm creating a thumbnail from an image saved in a db. If I write the
data directly to the stream, the image shows up perfectly.
Response.Clear();
Response.ContentType = myImage.ContentType;
Response.BinaryWrite( myImage.File );
But if i try and make a thumb, the image is distorted.
MemoryStream stream = new MemoryStream( myImage.File );
Bitmap bitmap = new Bitmap( stream );
Image image = bitmap.GetThumbnailImage( 100, 100, null, IntPtr.Zero );
image.Save( Response.OutputStream, bitmap.RawFormat );
Is there a way to make this clear?
data directly to the stream, the image shows up perfectly.
Response.Clear();
Response.ContentType = myImage.ContentType;
Response.BinaryWrite( myImage.File );
But if i try and make a thumb, the image is distorted.
MemoryStream stream = new MemoryStream( myImage.File );
Bitmap bitmap = new Bitmap( stream );
Image image = bitmap.GetThumbnailImage( 100, 100, null, IntPtr.Zero );
image.Save( Response.OutputStream, bitmap.RawFormat );
Is there a way to make this clear?