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 391,923 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 3,725 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:
Views: 134 | 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  
31 Days Ago
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 : 30 Days Ago at 2:22 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 692
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 95
QVeen72's Avatar
QVeen72 QVeen72 is online now Online
Practically a Master Poster

Re: green screen problem

  #2  
31 Days Ago
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: 366
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 61
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Whiz

Re: green screen problem

  #3  
30 Days Ago
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 : 30 Days Ago 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.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
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 8:17 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC