Example #1
0
 //in safari, when canvas is captured, that has transparency, it fills transparent areas with 255 not black
 //we force transparent areas to be black instead
 static void PreProcessBitmap(RasterImage derivedImage)
 {
     using (RasterImage alpha = derivedImage.CreateAlphaImage())
     {
         alpha.AddColorRgbRangeToRegion(new RasterColor(0, 0, 0), new RasterColor(3, 3, 3), RasterRegionCombineMode.Set);
         derivedImage.SetRegion(null, alpha.GetRegion(null), RasterRegionCombineMode.Set);
         FillCommand fill = new FillCommand(new RasterColor(0, 0, 0));
         fill.Run(derivedImage);
     }
 }