RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 350 | Replies: 2 | Thread Tools  Display Modes
Reply
Join Date: Jul 2008
Posts: 4
Reputation: mode17 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mode17 mode17 is offline Offline
Newbie Poster

green screen problem

  #1  
Jul 21st, 2008
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
Last edited by Tekmaven : Jul 21st, 2008 at 3:22 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 795
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 110
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: green screen problem

  #2  
Jul 21st, 2008
Hi,

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

Regards
Veena
Reply With Quote  
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 478
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 83
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro in Training

Re: green screen problem

  #3  
Jul 21st, 2008
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().
Last edited by selvaganapathy : Jul 21st, 2008 at 11:46 am.
KSG
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:40 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC