EDN Admin
Well-known member
Hello again!
I need some help regarding pictureboxes.
I currently have one picturebox on a form. This picturebox contains an image, like this one:
<img alt="Mountain Highway.png" src="http://social.msdn.microsoft.com/Forums/getfile/180789
What I need to do, is to place another picturebox on top of the other one. This will act as a "layer" and its image will be a fully transparent PNG of the same dimensions. This can be generated at run-time. The user should be able to "draw" on this image
using the MouseDown, MouseMove and MouseUp events. I think I can figure out how to do that (although help will be appreciated here too).
Now, I want the content theyve drawn to be semi-transparently laid upon the other image. The pictures shall not be merged, one picturebox (containing the content the user has drawn) is on top of another picturebox (holding the background). The result may
for example look like this to the user:
<img alt="Mountain Highway Transparency.png" src="http://social.msdn.microsoft.com/Forums/getfile/180791
The alpha value of the applied line appears as it was drawn with alpha level 76 (~30%).
Now, I could try and go about making the user draw the line with some kind of semi-transparent brush (I dont even know if those exist), but heres the problem:
When the user clicks the image, it will in case apply a circle (or something) whose color is A76, R255, G0, B0. If the user clicks
again though, or continues to draw, if the user draws on a surface area hes already drawn on, it would draw on that surface
again leading the Alpha value to be raised from 76 to 152 since he drew where hed already draw, making the crosspoint further red, like this: (Someone confirm this, Ive not tested, but it would make the most sense.)
<img alt="Mountain Highway Cross Transparency.png" src="http://img1.uploadscreenshot.com/images/orig/10/29013175567-orig.png
I would want to avoid that, by letting the user draw with a fully opaque red brush (A255, R255, G0, B0), but on a semi-transparent PictureBox whose Alpha level is 76.
Now - how would I make that PictureBox?
<span style="font-weight:bold Please note - Im currently gathering information on how to do this in advance, so I dont have any useful code related to this yet.
I would highly appreciate some help
Sincerely yours,<br/>
- bilde2910 <hr class="sig If a post is helpful to you or solves a problem, remember to mark it as answer, propose it as answer or vote up.<br/>
http://bit.ly/b2910sd Check out my development so far!
View the full article
I need some help regarding pictureboxes.
I currently have one picturebox on a form. This picturebox contains an image, like this one:
<img alt="Mountain Highway.png" src="http://social.msdn.microsoft.com/Forums/getfile/180789
What I need to do, is to place another picturebox on top of the other one. This will act as a "layer" and its image will be a fully transparent PNG of the same dimensions. This can be generated at run-time. The user should be able to "draw" on this image
using the MouseDown, MouseMove and MouseUp events. I think I can figure out how to do that (although help will be appreciated here too).
Now, I want the content theyve drawn to be semi-transparently laid upon the other image. The pictures shall not be merged, one picturebox (containing the content the user has drawn) is on top of another picturebox (holding the background). The result may
for example look like this to the user:
<img alt="Mountain Highway Transparency.png" src="http://social.msdn.microsoft.com/Forums/getfile/180791
The alpha value of the applied line appears as it was drawn with alpha level 76 (~30%).
Now, I could try and go about making the user draw the line with some kind of semi-transparent brush (I dont even know if those exist), but heres the problem:
When the user clicks the image, it will in case apply a circle (or something) whose color is A76, R255, G0, B0. If the user clicks
again though, or continues to draw, if the user draws on a surface area hes already drawn on, it would draw on that surface
again leading the Alpha value to be raised from 76 to 152 since he drew where hed already draw, making the crosspoint further red, like this: (Someone confirm this, Ive not tested, but it would make the most sense.)
<img alt="Mountain Highway Cross Transparency.png" src="http://img1.uploadscreenshot.com/images/orig/10/29013175567-orig.png
I would want to avoid that, by letting the user draw with a fully opaque red brush (A255, R255, G0, B0), but on a semi-transparent PictureBox whose Alpha level is 76.
Now - how would I make that PictureBox?
<span style="font-weight:bold Please note - Im currently gathering information on how to do this in advance, so I dont have any useful code related to this yet.
I would highly appreciate some help
Sincerely yours,<br/>
- bilde2910 <hr class="sig If a post is helpful to you or solves a problem, remember to mark it as answer, propose it as answer or vote up.<br/>
http://bit.ly/b2910sd Check out my development so far!
View the full article