Vote count:
0
I have a form with opacity set to 0. How would I be able to paint a filled rectangle inside that form, that is 50% transparent ?
//transparency at 128 (50%)
SolidBrush brush1 = new SolidBrush(Color.FromArgb(128, 100, 100, 100));
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Grapics.FillRectangle(brush1, rectangle1);
}
If I paint using e.Graphics
,nothing is drawn on the screen, since the form's opacity is 0.
I tried drawing using Graphics g = Graphics.FromHwnd(IntPtr.Zero);
but it is so slow, that is absolutely ineffective.
asked 35 secs ago
Draw filled rectangle on transparent form
Aucun commentaire:
Enregistrer un commentaire