با سلام
من تقریبا 6 ماه پیش یه پروژه بهم خورد که با این کد تونستم عکس رو آپلود کنم
Dim result As DialogResult = OpenFileDialog1.ShowDialog()
If result = Windows.Forms.DialogResult.OK Then
Dim input As Bitmap
Dim output As Bitmap
Dim siz AsLong = 100
Dim wid AsLong
Dim hgt AsLong
Dim picname AsString = OpenFileDialog1.FileName
Try
input = Bitmap.FromFile(picname)
Catch ex As Exception
input =
New Bitmap(150, 150)
Dim grafinput As Graphics = Graphics.FromImage(input)
grafinput.FillRectangle(
New SolidBrush(Color.CornflowerBlue), 0, 0, 150, 150)
grafinput.Dispose()
EndTry
If siz > 0 Then
If input.Height > input.Width Then
wid = (siz * input.Width) / input.Height
hgt = siz
Else
hgt = (siz * input.Height) / input.Width
wid = siz
EndIf
ElseIf hgt > 0 Then
wid = (hgt * input.Width) / input.Height
ElseIf hgt > 0 Then
hgt = (wid * input.Height) / input.Width
EndIf
If (hgt < 1) Or (input.Height < hgt) Then
output = input
Else
output =
New Bitmap(input, wid, hgt)
EndIf
PictureBox1.Image = output
input.Dispose()
EndIf
اما الان همین کد رو وقتی تو vb مینویسم ارور میده!!!!!!
کسی میدونه باید چیکار کنم؟
اگه کدی شبیه اینم دارین و کارم و راه بندازه ممنون میشم بهم بدین.