Solved

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

Posted on 2007-03-30
3
395 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
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 85

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

816 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

8 Experts available now in Live!

Get 1:1 Help Now