borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB Home | News Home | Forum Home | Downloads | Register | Search | PM | Profile

Previous Topic (Using the DataGrid control)Next Topic (Force Network Shutdown) New Topic Post Reply
AndreaVB OnLine : VB General : from gray scale to threshold, inverse, convolution
Poster Resource
aiena
Level: Trainee

Registered: 18-09-2006
Posts: 1
icon from gray scale to threshold, inverse, convolution

Option Explicit

Private Sub Command1_Click()
    Dim x As Long
    Dim y As Long
    Dim c As Long
    Dim r, g, b As Byte

    Picture1.Picture = LoadPicture("d:\disegni\fridgedoor_1683_28908208.gif")
    'convert picture lo grayscale
    With Picture1
    For x = 1 To .ScaleX(.Picture.Width, vbHimetric, vbPixels)
        For y = 1 To .ScaleY(.Picture.Height, vbHimetric, vbPixels)
            c = .Point(.ScaleX(x, vbPixels, .ScaleMode), .ScaleY(y, vbPixels, .ScaleMode))
            If c > 0 Then
                b = c Mod 256
                c = c \ 256
                g = c Mod 256
                r = c \ 256
                c = (r + g + b) / 3
                Picture1.PSet (.ScaleX(x, vbPixels, .ScaleMode), .ScaleY(y, vbPixels, .ScaleMode)), RGB(c, c, c)
            End If
        Next
    Next
    End With
End Sub



From this, how to convert gray scale to threshold, smoothing filter, Convolution – Laplacian sharpening filter (3x3 mask),Edge detection – Sobel kernel (3x3 mask), inverse.

18-09-2006 at 01:28 PM
View Profile Send Email to User Show All Posts | Add Comment
AndreaVB OnLine : VB General : from gray scale to threshold, inverse, convolution
Previous Topic (Using the DataGrid control)Next Topic (Force Network Shutdown)New Topic Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder