Issues with Blit() when inserting a symbol on an bitmap

Oct 4, 2012 at 10:26 AM
Edited Oct 4, 2012 at 10:27 AM

I've not fully understand the basics of the Blit function.

I'm using the WriteableBitmapEx framework with WPF. My bitmap represents a map and what I wanna achieve is to copy a (moving) symbol into that map.

For actual copying, I use the function Blit:

  _bitmap.Blit(myObject.Value.Location.ToWindowsPoint(), symbol, rect, Colors.Cyan, WriteableBitmapExtensions.BlendMode.Additive);

 

where symbol is a png image(transparent background).

This works in principal but I do not understand how the color (Colors.Cyan) is applied by the blend mode. I've tried out all available blend modes but I've not succeeded in getting Cyan as the color of the symbol or I got the color but then the transparent background was also copied to the source bitmap (black background).

Is 'Bliting' the wrong approach for my use case?

Thanks.

Developer
Oct 4, 2012 at 5:41 PM

I don't think you want additive blend mode, have you tried Alpha?

Oct 14, 2012 at 1:34 PM

My approach was wrong, anyways...now I've realized it is much easier when I draw the symbols as independent ui elements above the map.