exchanging

بیاید تو که براتون مفید (((پردازش تصویر با vb.net ))) خودم نوشتم .:blink:

شروع موضوع توسط saeed_1369 ‏8 فوریه 2008 در انجمن Visual Basic.Net

  1. saeed_1369

    saeed_1369 کاربر تازه وارد

    تاریخ عضویت:
    ‏7 دسامبر 2007
    نوشته ها:
    53
    تشکر شده:
    0
    بیاید تو که براتون مفید (((پردازش تصویر با vb.net ))) خودم نوشتم
    این یه پروژه در مورد پردازش تصویر بود که من در پروژه برنامه سازی پیشرفته 1 ارائه کردم تعدادی از کد آن را میارم .هر کس میخواد با من ارتباط برقرار کنه با این آدرس([email protected]) میتونه.
     
  2. saeed_1369

    saeed_1369 کاربر تازه وارد

    تاریخ عضویت:
    ‏7 دسامبر 2007
    نوشته ها:
    53
    تشکر شده:
    0
    Public Shared Sub Process(ByVal pshow As PictureBox, ByVal pProcess As PictureBox, ByVal speed As Boolean, ByVal Quality As Integer)
    Dim Orgimage, Changedimage As Bitmap
    Dim s As Color
    Dim sumokey, i, j, Q, W As Integer
    pshow.CreateGraphics.Clear(pshow.BackColor)
    Orgimage = pProcess.Image
    Changedimage = pProcess.Image
    For i = 5 To 355 Step 44
    For j = 5 To 290 Step 36
    If j < 290 Or (i < 350) Then
    s = Orgimage.GetPixel(i, j)
    If s.R < Quality And s.B < Quality And s.G < Quality Then
    If i < 44 Or j < 37 Then
    If i < 44 And j > 37 Then
    For Q = i To i + 44
    For W = j - 36 To j + 37
    If (Q < 351) Then
    If (W < 280) Then
    s = Changedimage.GetPixel(Q, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Then
    If speed = False Then pshow.CreateGraphics.DrawLine(New Pen(Color.Green, 2), Q, W, Q + 1, W + 1)
    s = Changedimage.GetPixel(Q + 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W + 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W - 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    If sumokey >= 1 And sumokey <= 2 Then
    pProcess.CreateGraphics.DrawLine(New Pen(Color.Red, 1), Q, W, Q + 1, W + 1)
    sumokey = 0
    End If
    If sumokey > 2 Then sumokey = 0
    End If
    End If
    End If
    Next W
    Next Q
    End If
    If j < 36 And i > 45 Then
    For Q = i - 44 To i + 45
    For W = j To j + 36
    If (Q < 351) Then
    If (W < 280) Then
    s = Changedimage.GetPixel(Q, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Then
    If speed = False Then pshow.CreateGraphics.DrawLine(New Pen(Color.Green, 2), Q, W, Q + 1, W + 1)
    s = Changedimage.GetPixel(Q - 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q + 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W + 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    If sumokey >= 1 And sumokey <= 2 Then
    pProcess.CreateGraphics.DrawLine(New Pen(Color.Red, 1), Q, W, Q + 1, W + 1)
    sumokey = 0
    End If
    If sumokey > 2 Then sumokey = 0
    End If
    End If
    End If
    Next W
    Next Q
    End If
    If j < 37 And i < 47 Then
    For Q = i To i + 45
    For W = j To j + 37
    If (Q < 351) Then
    If (W < 289) Then
    s = Changedimage.GetPixel(Q, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Then
    If speed = False Then pshow.CreateGraphics.DrawLine(New Pen(Color.Green, 2), Q, W, Q + 1, W + 1)
    s = Changedimage.GetPixel(Q - 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q + 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W + 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W - 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    If sumokey >= 1 And sumokey <= 3 Then
    pProcess.CreateGraphics.DrawLine(New Pen(Color.Red, 1), Q, W, Q + 1, W + 1)
    sumokey = 0
    End If
    If sumokey > 3 Then sumokey = 0
    End If
    End If
    End If
    Next W
    Next Q
    End If
    Else
    For Q = i - 44 To i + 44
    For W = j - 36 To j + 36
    If (Q < 351) Then
    If (W < 283) Then
    s = Changedimage.GetPixel(Q, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Then
    If speed = False Then pshow.CreateGraphics.DrawLine(New Pen(Color.Green, 2), Q, W, Q + 1, W + 1)
    s = Changedimage.GetPixel(Q - 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q + 1, W)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W + 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    s = Changedimage.GetPixel(Q, W - 1)
    If (s.R < Quality And s.B < Quality And s.G < Quality) Or (s.R = 255 And s.B = 0 And s.G = 0) Then
    sumokey += 1
    End If
    If sumokey >= 1 And sumokey <= 3 Then
    pProcess.CreateGraphics.DrawLine(New Pen(Color.Red, 1), Q, W, Q + 1, W + 1)
    sumokey = 0
    End If
    If sumokey > 3 Then sumokey = 0
    End If
    End If
    End If
    Next W
    Next Q
    End If
    End If
    End If
    Next j
    Next i
    End Sub
    :wacko: