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.
Loading
Hirendra SisodiyaPosted Feb 24, 2010, 10:21 AM
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 rajuPosted Feb 25, 2010, 7:37 AM
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.