Win8.1 Blit Transparent Ink

May 15, 2014 at 2:26 PM
I'm working on an app where the user is "marking up" an underlying image with the Ink API. One of the ink types is a Highlight tool. When I blit the ink strokes and background image together the transparency is lost leading to what was highlighted in the background image being completely blocked out. Here is what my code looks like any ideas how to preserve the transparency?
var backgroundBmp = await BitmapFactory.New(1, 1).FromStream(await file.OpenAsync(FileAccessMode.Read), Windows.Graphics.Imaging.BitmapPixelFormat.Unknown);
WriteableBitmap foregroundBmp;
using (InMemoryRandomAccessStream a = new InMemoryRandomAccessStream())
   await inkManager.SaveAsync(a);
   foregroundBmp = await new WriteableBitmap(1, 1).FromStream(a, Windows.Graphics.Imaging.BitmapPixelFormat.Bgra8);
backgroundBmp.Blit(new Rect(inkManager.BoundingRect.X, inkManager.BoundingRect.Y, foregroundBmp.PixelWidth, foregroundBmp.PixelHeight),
                    foregroundBmp, new Rect(0,0, foregroundBmp.PixelWidth, foregroundBmp.PixelHeight),
Jun 9, 2014 at 1:14 PM
Edited Jun 9, 2014 at 1:14 PM
i have the same problem when i Blit for scrolling purpose the bitmap and the new bitmap lost the trasparency (it's painted white on background)
I'm using the wrong calling method?
     public void Blit(int pixelToBlit)
         Rect s = new Rect(pixelToBlit, 0, wBitmap.Width, wBitmap.Height);
         Rect d = new Rect(0, 0, wBitmap.Width - pixelToBlit, wBitmap.Height);

        wBitmap.Blit(d, wBitmap, s, System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.None);
        this.Source = wBitmap;