【发布时间】:2010-11-03 13:47:09
【问题描述】:
在 C++ MFC 应用程序中。使用 (CPaintDC dc(this);) 的 dc
如何绘制一个具有我可以调整的 alpha 透明度的矩形 (LPRECT)?
以下是我需要转换为 C++ 的示例 c# 代码
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Color color = Color.FromArgb(75,Color.Red); //sets color Red with 75% alpha transparency
Rectangle rectangle = new Rectangle(100,100,400,400);
g.FillRectangle(new SolidBrush(color), rectangle); //draws the rectangle with the color set.
}
【问题讨论】: