[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-03-30
3
Medium Priority
?
401 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 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 21 hours left to enroll

873 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