This is a migrated thread and some comments may be shown as answers.

How to resize an image?

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 29 Nov 2008, 07:14 AM
I have made a code through which i m retrieving images from database. Here`s the code:

byte

[] Image = Queries.GetImage(Id);

 

 

MemoryStream stream = new MemoryStream();

 

stream.Write(Image, 0, Image.Length);

 

Bitmap bitmap = new Bitmap(stream);

 

bitmap.Save(Response.OutputStream, System.Drawing.Imaging.

ImageFormat.Jpeg);

But, the images are to big for my radgrid to show in. I want to resize them before saving the bitmap into the output stream.
how can i resize it?

 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Dec 2008, 07:13 AM
Hi saadi,

Please check this article for more info:
http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx

Sincerely yours,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Saad
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or