473,489 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

System.Drawing question

Hello,

I want to draw from one System.Drawing.Bitmap to another. All I can find is
how to draw to a Graphics object.
System.Drawing, System.Drawing.Drawing2D or System.Drawing.Imaging have no
functionality for this.

"The Graphics class provides methods for drawing to the display device."
But I want to draw to an 'off-screen' image.

How does one do this?

Thank you.

Nov 21 '05 #1
3 1344
Check out Graphics.FromImage. You can create a Graphics object from a
bitmap, draw on it, then save it as a bitmap or display it in a picturebox,
etc.

"Qwert" wrote:
Hello,

I want to draw from one System.Drawing.Bitmap to another. All I can find is
how to draw to a Graphics object.
System.Drawing, System.Drawing.Drawing2D or System.Drawing.Imaging have no
functionality for this.

"The Graphics class provides methods for drawing to the display device."
But I want to draw to an 'off-screen' image.

How does one do this?

Thank you.

Nov 21 '05 #2
"Qwert" <no**@nosp.com> schrieb:
I want to draw from one System.Drawing.Bitmap to another. All I can find
is how to draw to a Graphics object.


\\\
Dim bmp As New Bitmap(...)
Dim g As Graphics = Graphics.FromImage(bmp)
g.DrawImage(...)
....
g.Dispose()
....
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Thank you both, just what I need.

I was looking wrong, assuming the image or bitmap class would provide the
functionality to copy from one image to another.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:ew**************@TK2MSFTNGP14.phx.gbl...
"Qwert" <no**@nosp.com> schrieb:
I want to draw from one System.Drawing.Bitmap to another. All I can find
is how to draw to a Graphics object.


\\\
Dim bmp As New Bitmap(...)
Dim g As Graphics = Graphics.FromImage(bmp)
g.DrawImage(...)
...
g.Dispose()
...
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2373
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
7
7444
by: WALDO | last post by:
I have an interesting quandary. I have developed a program in VB.Net to extract an icon resource from an exe/dll or from an ico file and enumerate its formats (16x16,256 color;32x32,true...
1
3615
by: DBC User | last post by:
Hi Sharpies, This is a very basic question. I am using .Net IDE 2003 and System.Drawing.dll (1.1.4322). I wrote a simple program like this (ommitting the commons) using System.Drawing; .....
2
2076
by: Markus Eßmayr | last post by:
Hello, I'm writing an extension class for the winforms button control using MC++. I created a class, derived from System::Windows::Forms::Button. In my class I want to extend the functionality...
5
2304
by: benoit | last post by:
Hi, I have this question. When I use the FileUpload WebControl to post an Image (= SourceFile) that I want to resize and write to the server, I keep getting this situation. If that SourceFile...
3
8898
by: J | last post by:
I tried to inherit 'Shot' class from 'Image' class, only to fail. It gives me the CS0122 error, which says that it can't access 'System.Drawing.Image.Image()'. What am I missing? using...
3
3956
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
7820
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
2
4487
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
0
7142
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,...
1
6847
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...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4875
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
3078
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
1383
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
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.