User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 426,521 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,904 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 211 | Replies: 2
Reply
Join Date: Jul 2008
Posts: 1
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 2:22 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
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: 458
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 79
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 10:46 am.
KSG
Reply With Quote  
Reply

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

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 6:24 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC