I am trying to save a visual object with a transparent background into a bitmap using RenderTargetBitmap ...
public static RenderTargetBitmap RenderToBitmap(this Visual Source, int Width, int Height) { var Result = new RenderTargetBitmap(Width, Height, 96, 96, PixelFormats.Default); Result.Render(Source); return Result; }
This works, but transparent pixels are displayed in black. What is the easiest way to change these transparent pixels to a different color?
wpf
Néstor Sánchez A.
source share