473,513 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert smaller images into one Image object

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
3 1592
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7306
by: Gregory | last post by:
Hello, I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the...
2
3940
by: Display Name | last post by:
I can't insert an image using the "add a new stylesheet" function- the function, on dreamweaver MX (i'm on Windows 2k Pro) seems to work as it generates the code... but the image never shows up in...
7
10409
by: John A. | last post by:
Hello all! I've got a big bunch of pages using tables for layout. Eventually I'll get them set up with more modernized code, but in the meantime I'd like to slip in a little quick holiday...
2
1462
by: E. Paul Wileyto | last post by:
Can anyone help. I would like to create a table that contains references to a series of JPG files, so that I can view each image and related data in a form, page by page. It seems that the only...
13
1595
by: moondaddy | last post by:
Happy Holidays All! I want to load a datagrid with images and text (Image, text, image, text, etc...). The data for this datagrid will be coming from sql server and the images are stored as files...
1
13209
by: ahujasatna | last post by:
Hi all!! i am working on C#, ASP.Net with Sql server2000 and i am facing a problem, my Question is: "How to insert and retrieve images to/from Sqlserver2000 Database" I created a table...
0
1595
by: avisekrishi | last post by:
Hi , I have 100 image . I need to follow the following steps 1. Open a word document 2. Click on Insert -> Picture -> File and then open the image file 3. The Image gets opened in Word.
1
1143
by: wvueagle84 | last post by:
I have the following code in which I am attempting to break a large image up in 16x16 blocks and perform some processing on those blocks. For debugging I would like to save each of the 16x16 blocks...
1
3138
by: Pedro Rosas Silva | last post by:
Hi everyone, Is anybody aware of a way how to insert an image in a WordML document programmatically, through C#? I have a C# application that loads into memory a WordML document...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.