You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
This works ! Thank you very much !
I've never heard before of the Merge function and wasn't aware of all the nice possibilities !
BTW : is the ThinBasic really written entirely in PBasic ?
Last edited by Frank Kestens; 18 May 2008, 04:02 AM.
if you have latest PB/WIN or PB/CC, you can try to use GRAPHIC commands and %MIX_MERGESRC mode for rendering the image.
Here is minimal sample:
Code:
FUNCTION PBMAIN () AS LONG
LOCAL hWin AS DWORD
GRAPHIC WINDOW "Demo", -1, -1, 240, 240 TO hWin
GRAPHIC ATTACH hWin, 0
GRAPHIC CLEAR %BLACK
GRAPHIC SET MIX %MIX_MERGESRC
GRAPHIC ELLIPSE (10, 10) - (110, 110),%RED, %RED
GRAPHIC ELLIPSE (30, 30) - (130, 130),%GREEN, %GREEN
GRAPHIC ELLIPSE (60, 60) - (160, 160),%BLUE, %BLUE
SLEEP 5000 ' show it for 5 seconds, then end
END FUNCTION
You could also use additive blending in OpenGL or Direct3D.
And the most straightforward way is to just extract Red, Green, Blue components of the two fragments, combine them to create new one ( just check to not go over 255 in each component ).
You can use GetRValue, GetGValue, GetBValue from Win32 API to get the components, or use other way.
I'm writing a program in which I need to superimpose two or more colors.
Is this possible ? and with which instructions ?
For example : I draw a circle in red and nearby a circle in green . The intersected region should appear in red+green = yellow . Adding also blue should give white .
??
Last edited by Frank Kestens; 17 May 2008, 06:27 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: