[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
How to change the alpha value of a pixmap?
From: arne hoch ####@####.#### Date: 23 Jun 2012 19:55:15 -0000 Message-Id: <4FE61F07.1070809@derhoch.de> Hello, how can I efficiently change the alpha value of all pixels in a pixmap? I want to do a fadein/-out effect. In a previous version I could do sth like this: GrCopyArea(trg, gc, 0, 0, w, h, src, 0, 0, MWROP_BLENDCONSTANT | (fadelevel & 0xFF)); But this does not work anymore, since the constant is now fixed at 150. Regards, arne | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] How to change the alpha value of a pixmap?
From: Greg Haerr ####@####.#### Date: 5 Jul 2012 05:34:27 -0000 Message-Id: <CF4771E7-5E20-4E85-A521-FFAC3127513F@censoft.com> > how can I efficiently change the alpha value of all pixels in a pixmap? > I want to do a fadein/-out effect. In a previous version I could do sth > like this: > > GrCopyArea(trg, gc, 0, 0, w, h, src, 0, 0, > MWROP_BLENDCONSTANT | (fadelevel & 0xFF)); > > But this does not work anymore, since the constant is now fixed at 150. Arne, This one will be a little complicated, because of the way that all the blit code was rewritten in 0.93. Here is a way that should make it work; we essentially need to make room for the lower eight bits to hold the fade level as a parameter to blendconstant, like the old version did: 1. Redefine MWROP_BLENDCONSTANT to 0x100 in mwtypes.h. This will make room, for this ROP only, for the alpha param in the lower 8 bits. 2. Move the code handling MWROP_BLENDCONSTANT out of the switch statement in convblit_frameb.c to just above the switch statement, and check for "if ((op & 0xff00) == MWROP_BLENDCONSTANT) {…} else switch ... to handle this ROP. 3. Get the alpha value as "int alpha = op & 0xff;'" Things should work as before. I may have forgotten something, but that seems from visual inspection that it should work. Regards, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |