7,655
社区成员
发帖
与我相关
我的任务
分享
ImageAttributes attrib = new ImageAttributes();
Bitmap img = new Bitmap(Properties.Resources.qian透明);
Color color = Color.Transparent;
attrib.SetColorKey(color, color);
e.Graphics.DrawImage(img, new Rectangle(40, 55, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, attrib);
foreach (Control C in this.Controls)
{
if (C is Label)
{
Label L = (Label)C;
L.Visible = false;
e.Graphics.DrawString(L.Text, L.Font, new SolidBrush(Color.White), L.Left, L.Top);
}
}
把这个放在form的paint里面就OK了
Color color = img.GetPixel(0, 0);