This project is read-only.

Alpha Opacity on DrawPolyline

Nov 16, 2011 at 8:43 PM


I'm trying to draw some lines over an image that's already loaded that have an Alpha opacity of #33 (20%), but it's drawing the line as gray without transparency.  I understand this might require some form of blitting, but I'm not exactly sure how to achieve this - or if I'm just doing it incorrectly.  I can certainly create another layer, create an all new wbmp with the same proportions and then overlay it in another image, but I'd prefer to do this in one pass. 

The following is the code I'm using:

WriteableBitmap wbmp = new WriteableBitmap(img, null);

 wbmp.DrawPolyline(pointlist, System.Windows.Media.Color.FromArgb(0x33, 0xFF, 0xFF, 0xFF));