Bringing colored rectangle to the front
I am working with graphic methods. I am trying to create a piano using brushes, pens, and rectangles. I have 14 white keys and started making the black keys. For some reason I cant get the black keys to overlap the white ones. Is there a command to send the black rectangles to the front? Thanks
Drew
Re: Bringing colored rectangle to the front
You mean in the designer? I think that should reflect on its position during runtime...
Right click the component and you'll find the option you're looking for.
Re: Bringing colored rectangle to the front
If you were drawing on a piece of paper, how would you do this? If you drew the black keys first and then the white ones, the black ones would be covered by the white ones and you wouldn't see them, right? You'd have to draw the white ones first, then the black ones over the top.
The same goes for GDI+. Each pixel only displays the last thing that was drawn on it, so you need to draw the black rectangles last if you want to be able to see them over the white ones.
1 Attachment(s)
Re: Bringing colored rectangle to the front
Attachment 77470
This is the code I used to create that image. How do i get the black rectangle over the white?
Re: Bringing colored rectangle to the front
instead of giving such a huge screenshot,just copy your code and paste it in the CODE tag
Re: Bringing colored rectangle to the front
You may have posted without seeing my post but, as I said, you need to draw the black rectangles AFTER drawing the white rectangles if you don't want the white to cover the black. It's just like two coats of paint. Each coat hides whatever is underneath it.
Re: Bringing colored rectangle to the front
Quote:
Originally Posted by
jmcilhinney
If you were drawing on a piece of paper, how would you do this? If you drew the black keys first and then the white ones, the black ones would be covered by the white ones and you wouldn't see them, right? You'd have to draw the white ones first, then the black ones over the top.
The same goes for GDI+. Each pixel only displays the last thing that was drawn on it, so you need to draw the black rectangles last if you want to be able to see them over the white ones.
Thanks, that makes sense :) I just switched the black and white around and it works. Sorry about the huge picture, thought it would be smaller. Thanks for the help guys.
Drew