|
-
March 29th, 2010, 08:39 AM
#1
2 questions about drawing pixels
Hi
I was asked to write a custom control (button) that renders itself. I need to render it pixel by pixel. I was wondering what is the most efficient way of drawing 1 pixel in C#. Drawing a bunch of retangle of 1 pixel?
Also, another question is that how can I draw a transparent pixel? (where 0<alpha<1) The thing is the form that the button lives on has a custom paint function as well, and if I just try using a solid brush to draw the object, the graphic seems to always use black as back color. For example: if I create a color object using Color.FromArgb(128, Color.White) and draw the object, I always get gray at the end no matter where I draw it; if I create a color using Color.FromArgb(0, Color.Red) and draw, I always get black. How can I make it so the graphic object knows where the actual back color is (the form's color at that pixel) instead of black.
I have researched a bit online with no luck. I hope I can find some answer here. Thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|