hi!
how to give height and widht of image. means i give a image height 100 and width 100. when i insert images that images height and width is changed to 100x100. all images are same height and width. how to write code like this.
please give a solution and give a sample code.
i take like
private function GetImageSize(BY val height as integer,width as integer)
how to write this type function code.please help me. give a function code of GetImageSize()
Thank u sir.
How to give height and width of image
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Hirendra SisodiyaRank #258 · 9.8K reputationPosted Feb 24, 2010, 5:21 AM EST
try this code:
Private Function GetImage(ByVal img As System.Drawing.Image, ByVal height As Integer, ByVal width As Integer) As System.Drawing.Image
Dim grp As Drawing.Graphics = Drawing.Graphics.FromImage(img)
grp.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
grp.DrawImage(img, New Drawing.Rectangle(0, 0, width, height), New Drawing.Rectangle(0, 0, img.Width, img.Height), Drawing.GraphicsUnit.Pixel)
Return img
End Function
thank you
if you like this answere please check
ajay rajuRank #4,639 · 333 reputationPosted Feb 25, 2010, 2:37 AM EST
Thank u for giving code. how to call this GetImage function in button click.
i write code like this:
GetImage(Image.FromFile("~/ProductThumbnails/" & fuThumbnail.PostedFile.FileName), 100, 120)
but not working please correct this line. or give a code to call the GetImage function
thanks u.