PDA

View Full Version : سوال: چگونه روی عکس picturebox زووم کنیم؟



sina.lor.boy
یک شنبه 26 آبان 1392, 15:41 عصر
سلام میخوام روی عکی که تو PictureBox دارم zoom کنم راهنمایی کنید ...

mohammad_f.n
یک شنبه 26 آبان 1392, 16:45 عصر
یه نمونه کد برای زوم داشتم این رو برات گذاشتم



Public Function ZoomImage(ByVal img As System.Drawing.Image, ByVal ZoomValue As Int32) As System.Drawing.Image
Dim width As Int32 = Convert.ToInt32(img.Width * ZoomValue) / 100
Dim height As Int32 = Convert.ToInt32(img.Height * ZoomValue) / 100
'Create a new image based on the zoom parameters we require
Dim zoomImage As New System.Drawing.Bitmap(img, width, height)

'Create a new graphics object based on the new image
Dim converted As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(zoomImage)

'Clean up the image
converted.InterpolationMode = InterpolationMode.HighQualityBicubic

'Return the zoomed image
Return zoomImage
End Function

sagggad
یک شنبه 26 آبان 1392, 17:01 عصر
سلام دوست عزیز یه سورس برات میذارم خیلی خیلی ساده است.اما مال محمد آقا عملکردش بهتره! ازلینک زیر دانلودش کن
http://www.uplooder.net/cgi-bin/dl.cgi?key=e96a1e5037d4e7138b4c3fb5b71f7b8b

mesiiran
یک شنبه 26 آبان 1392, 18:09 عصر
مشترک گرامی دسترسی به این پست امکانپذیر نمی باشد

sina.lor.boy
یک شنبه 26 آبان 1392, 19:02 عصر
دمتون گرم :تشویق: :بوس: