Solved

Combine several System.Drawing.Graphics into a new or existing Graphics object

Posted on 2007-03-30
3
387 Views
Last Modified: 2013-11-07
Is it possible to add/combine/merge several System.Drawing.Graphics objects into a new or existing Graphics object.

e.g. when using a printdocument and building the printout within the PrintPage and using e.Graphics, is it possible to have several graphics objects that I can combine into the e.Graphics object without making them into images first. purpose is to handle header, content, and footer in different sections when building the document.

Using:
DotNet 2.0
VS2005 / Csharp

/ Mikael
0
Comment
Question by:activephoto
  • 2
3 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
Not sure exactly what you are tyring to do here...

But you can pass the Graphics instance to another sub if you need to:

    Public Sub MakeHeader(ByVal G As Graphics)
        G.DrawString(....)
    End Sub

Just pass in "e.Graphics" from your PrintPage:

    MakeHeader(e.Graphics)

Is that what you are asking?...
0
 
LVL 6

Author Comment

by:activephoto
Comment Utility
Hi Idle Mind,
it is not exacly what I am looking for, I have e.g. 3 graphics obect already that I want to combin after each other into e.g. e.Graphics.

/ Mikael
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
"I have e.g. 3 graphics obect already"

But WHERE did these three graphics come from if they are not "e.Graphics"?

A Graphics is a context for drawing onto SOMETHING so there has to be a drawing surface of some kind associated with them already.

Did you make Bitmaps and get a Graphics from that?

But in answer to your question I don't know of any way to merge two EXISTING Graphics.

You can create a NEW Graphics using Graphics.FromHDC() but eventually you have to use the graphics supplied to you in "e.Graphics"...you can't replace it with something else.


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now