hi everyone. I have written a program that convert from color image to gray image in asp.net with visual basic, but I have a problem am new in asp.net and I want to display the gray image but I don't know how. please help me. this is a code.
If (FileUpload1.HasFile) Then
FileUpload1.SaveAs(MapPath(FileUpload1.FileName))
Image1.ImageUrl = FileUpload1.FileName
End If
Dim current As Bitmap = New Bitmap(Server.MapPath(Image1.ImageUrl))
Dim pic1 As Bitmap = New Bitmap(current)
Dim gray As Bitmap = New Bitmap(pic.Width - 1, pic.Height - 1)
For a = 0 To (pic1.Width) - 1
For b = 0 To (pic1.Width) - 1
Dim c As Color = pic1.GetPixel(a, b)
Dim rx As Single = c.R
Dim g As Single = c.G
Dim b1 As Single = c.B
Dim d As Integer = CInt(rx * 0.3 + g * 0.5 + b1 * 0.11)
gray.SetPixel(a, b, Color.FromArgb(d, d, d))
Next
Next