您现在的位置是:首页 > 综合信息网站首页综合信息
使透明
- 综合信息
- 2022-09-24 05:55:14
- 来源:
大家好,小必来为大家解答以上的问题。使透明这个很多人还不知道,现在让我们一起来看看吧!
1、using System;using System.Collections.Generic;using System.Text;using System.Drawing;namespace CuteGraph.WinUI.GoGame{ public class Chess { private ChessColor chessColor = ChessColor.Black; private Point location; private static Bitmap[] allImages = new Bitmap[2]; static Chess() { allImages[0] = Bitmap.FromStream( typeof(Chess).Assembly. GetManifestResourceStream("CuteGraph.WinUI.GoGame.blackchess.bmp")) as Bitmap; allImages[0].MakeTransparent(Color.Black); allImages[1] = Bitmap.FromStream( typeof(Chess).Assembly. GetManifestResourceStream("CuteGraph.WinUI.GoGame.whitechess.bmp")) as Bitmap; allImages[1].MakeTransparent(Color.Black); } // private Image chessImage = null; public Image ChessImage { get { if (this.chessColor == ChessColor.Black) { return allImages[0]; } else { return allImages[1]; }} } public ChessColor ChessColor { get { return chessColor; } set { chessColor = value; } }public Point Location { get { return location; } set { location = value; } }}}。
本文到此分享完毕,希望对大家有所帮助。