Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 9,047 times

Related Categories

Encoding A Picture For Viewing With Red Filter Glasses

Michael H

For this to work you need a picturebox called Picture1 and it's scalemode set to "Pixels". Just call Encode_for_red_glasses for it to go. This method is also alittle slow so be patient.

Private Sub Encode_for_red_glasses()
On Error Resume Next

Dim x, y, a, bz, c As Long

For x = 1 To Picture1.ScaleWidth

    For y = 1 To Picture1.ScaleHeight

        DoEvents

        a = Picture1.Point(x + 1, y)

        bz = Picture1.Point(x, y + 1)

        c = Picture1.Point(x + 1, y + 1)

        Picture1.PSet (x, y), RGB(CInt(Val(Mid$(CStr(a), 1, 2))), CInt(Val(Mid$(CStr_(bz), 3, 2))), CInt(Val(Mid$(CStr(c), 5, 2))))

        'make the previous two lines into one.

        Next

Next

End Sub

Comments