|
-
Apr 14th, 2010, 10:20 PM
#1
Thread Starter
New Member
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
-
Apr 14th, 2010, 10:36 PM
#2
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.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Apr 14th, 2010, 10:52 PM
#3
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.
-
Apr 14th, 2010, 10:56 PM
#4
Thread Starter
New Member
Re: Bringing colored rectangle to the front

This is the code I used to create that image. How do i get the black rectangle over the white?
-
Apr 14th, 2010, 10:59 PM
#5
Fanatic Member
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
-
Apr 14th, 2010, 11:01 PM
#6
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.
-
Apr 14th, 2010, 11:02 PM
#7
Thread Starter
New Member
Re: Bringing colored rectangle to the front
 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
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
|