Solved

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

Posted on 2007-03-30
3
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 18824425
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
ID: 18841479
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 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18846246
"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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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