|
-
April 4th, 2008, 12:47 PM
#1
How to make a bitmap image cover part of a picturebox?
I created a bitmap object and used it to draw a 2D terrain programatically. Then I also added a picturebox control to display an image near the terrain.
However, the picturebox control is blocking out part of the bitmap.
How do I make the bitmap "cover" part of the picturebox control instead?
Is there a "layers" method which the form can use to draw one bitmap over another control?
-
April 6th, 2008, 06:49 AM
#2
Re: How to make a bitmap image cover part of a picturebox?
Correct me if I am confused on the exact issue.
As I read it, you have a control of some type which you are using to display a terrain (Control1). You then have a second control(Control2). Your problem is that Control1 is being partially obscured by Control2.
It would seem to me this is a simple layout problem. You have two options:
A) Resize and/or move Control2 so that it no longer conflicts with Control1
B) Use some combination of SendToBack()/BringToFront() to adjust the draw order of the controls. Likely doing Control1.BringToFront() would be enough. However the question is why would you want Control1 to partially obscure Control2? It seems like Option A) would make more sense.
Eggman
Using: VS 2008 w. Net 3.5
-
April 6th, 2008, 07:42 AM
#3
Re: How to make a bitmap image cover part of a picturebox?
Or, draw the image directly onto the bitmap of the terrain.
This to my mind is the best solution as it'll prevent 'flickering' you might see if you have one control covering another.
Darwen.
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
|