By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

Insert smaller images into one Image object

P: n/a
I have a windows forms project done in vb.net. One of the forms
creates graphs based on the data supplied to it. I want to take
multiple graphs and paste them into a larger Image object. I already
have the code to create a single graph. I'm hoping that I can take
these graphs and paste them into a given spot in the larger image.
I've heard of bitblt and stretchblt but I'm not certain if those
functions are out of date with the ,net framework. What is the best
way to solve this problem?

Brian
Nov 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Brian" <mc*******@wright.eduschrieb
I have a windows forms project done in vb.net. One of the forms
creates graphs based on the data supplied to it. I want to take
multiple graphs and paste them into a larger Image object. I
already have the code to create a single graph. I'm hoping that I
can take these graphs and paste them into a given spot in the larger
image. I've heard of bitblt and stretchblt but I'm not certain if
those functions are out of date with the ,net framework. What is
the best way to solve this problem?
Use the large image's CreateGraphics method and paint on the returned
Graphics object using DrawImage. When done, don't forget to Dispose the
graphics object. (VB2005: "Using" keyword is available)
Armin

Nov 17 '07 #2

P: n/a
On Nov 17, 1:20 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"Brian" <mcrave...@wright.eduschrieb
I have a windows forms project done in vb.net. One of the forms
creates graphs based on the data supplied to it. I want to take
multiple graphs and paste them into a larger Image object. I
already have the code to create a single graph. I'm hoping that I
can take these graphs and paste them into a given spot in the larger
image. I've heard of bitblt and stretchblt but I'm not certain if
those functions are out of date with the ,net framework. What is
the best way to solve this problem?

Use the large image's CreateGraphics method and paint on the returned
Graphics object using DrawImage. When done, don't forget to Dispose the
graphics object. (VB2005: "Using" keyword is available)

Armin
Is there a way to take my already created smaller graphics objects
(graphs) and insert them into the larger graphics object or are you
saying that I should draw the smaller graphs in the confines of the
larger object using the normal graphics drawing functions?

Also to dispose of a graphics object properly do I just use
the .dispose() function of the graphics object?

Brian
Nov 17 '07 #3

P: n/a
Brian wrote:
Is there a way to take my already created smaller graphics objects
(graphs) and insert them into the larger graphics object or are you
saying that I should draw the smaller graphs in the confines of the
larger object using the normal graphics drawing functions?
A Graphics objects is used to draw on a drawing surface. The drawing
surface can be something like the screen or a Bitmap object.

In this case you will be creating a Graphics object to draw on the
larger Bitmap. Use the Graphics.FromImage method to do that. You use the
DrawImage method to draw the smaller Bitmaps onto the larger Bitmap.
Also to dispose of a graphics object properly do I just use
the .dispose() function of the graphics object?
Yes.

Alternatively, in VB 2005 you can use the Using keyword. That will wrap
the code in a Try...Finally block and call the Dispose method in the
Finally part, so that the object is always properly disposed no matter
what happens.

--
Göran Andersson
_____
http://www.guffa.com
Nov 18 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.