0

hi i'm creating a program with the same effect as the green screen used in the movies and i'm having problem in getting the right value of green colors, but when i uses black or white as a color to be mask it works but not with the green, can anyone give me an advise for this.

thanks

here is my codes

For k = 0 To pic1.ScaleHeight
          clr = GetPixel(pic1.hdc, i, k)
                If clr = vbGreen Then
                SetPixel pic3.hdc, i, k, vbWhite
        Else
               SetPixel pic3.hdc, i, k, vbBlack
3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by selvaganapathy
0

Hi,

Was that Complete code..? or you forgot one more Outside loop for ScaleWidth...?

Regards
Veena

0

Hi,
GetPixel() returns the combination of Red, Green and Blue. So the Color you are checking

clr = GetPixel(pic1.hdc, i, k)
If clr = vbGreen Then

This will check only Red is 0, Blue is 0 and Green is 255.
But you may need to separate the Color values.
Also u can use Point(X as Single, y as Single) to get the (x,y) Pixel Value instead of GetPixel().

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.