BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"safe maskcolor"
, by hyena
client's colour depth may be different to yours, and the classic mask 255,0,255 may acquire a different value. This function avoids that pitfall.
Code
;================================================================== ;Project Title: failsafe mask colour ;Author: hyena ;Date: 5:38 AM 15/12/04 ;Notes: client's colour depth may be different to yours, and the classic ; mask: 255,0,255 may be reported as 248,0,248, so it wont mask! ; this function avoids that pitfall ;usage: MaskImage MyImage,Mask("R"),Mask("G"),Mask("B") ;================================================================== Graphics 320,200 SetBuffer BackBuffer() R=Mask("R") G=Mask("G") B=Mask("B") Color R,G,B Rect 90,10,150,70,0 Color 255,255,255 Text 100,20,"R: "+R Text 100,40,"G: "+G Text 100,60,"B: "+B Flip WaitKey() End Function Mask(C$) Color 255,0,255 Plot 1,1 GetColor 1,1 If C="R" Return ColorRed() If C="G" Return ColorGreen() If C="B" Return ColorBlue() End Function
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations