2009/2/16 vallef <fabien.val...@gmail.com> > > I would like to load my png to a surface filled with the colorKey. > In a perfect world, I would like to have all the PNG's pixels with alpha > > 50 % copied to my surface. > ( if alpha > 50% use RGB values, else do nothing).
Did you try to use simply GIF with transparency color? In fact, you want to have alpha with two states. Then try the ARGB1555 for example. There alpha has only 1 bit. > > > However, I cannot get this result. > Best way i've found is to : > > 1) create a tmp ARGB surface . > 2) render the bitmap with the ImageProvider to my tmp surface. > 3) fill my final ARGB surface with colorKey (255,0,255,0) > 3) blit my tmp surface to my final surface with DSBLIT_BLEND_ALPHACHANNEL > blitting flag Why you don't want to render the pgn into the final surface at once? > This is working fine when my source alpha pixels values are 255 or 0 ( even > if performances are not so good). > However, when the PNG contains intermediate opacity values, the blit of my > tmp surface to my final surface (using alpha) blend the destination pixels > with the source pixels. Therefore, it mixes my PNG data with the colorKey > RGB and I get dirty purple pixels. > > What you want is what you get ;-) > -- > View this message in context: > http://www.nabble.com/Rendering-ARGB-to-colorKey-filled-surface-tp21980722p21980722.html > Sent from the DirectFB Users mailing list archive at Nabble.com. > > _______________________________________________ > directfb-users mailing list > directfb-users@directfb.org > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users > -- Best Regards Nikita Egorov nik...@gmail.com nik...@varma-el.com
_______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users