WPF MakeTransparent

索引サイト

Image Bitmap BitmapImage Media Drawimg が、ごちゃごちゃになって混乱中。とりあえず動作するもの。
透過は Bitmap 表示は BitmapImage を使用




Bitmap w_Bitmap = new Bitmap(@"h:/png/test-1.png");
w_Bitmap.MakeTransparent(System.Drawing.Color.FromArgb(w_alpha, w_red, w_green, w_blue));
w_Bitmap.Save(@"h:/png/test-2.png", ImageFormat.Png);




BitmapImage w_bitmapImage = new BitmapImage(new Uri(@"h:/png/test-2.png"));
this.image1.Source = w_bitmapImage;

中央の透過はマスク、全体の半透明はアルファ値を操作



AX