473,804 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copy from A Graphics to another Graphice ?

Hi all
is it possible in C# to copy content of a graphics object to another like
BitBlt API??

thanks
May 24 '06 #1
3 9321
Don't Graphics.DrawIm age() help?

"perspolis" <re*****@hotmai l.com> ¼¶¼g©ó¶l¥ó·s»D: ep************* *@TK2MSFTNGP05. phx.gbl...
Hi all
is it possible in C# to copy content of a graphics object to another like
BitBlt API??

thanks

May 24 '06 #2
I don't think that will help. DrawImage draws images over the graphics
objects. Even though the Bitmap class has a constructor that accepts
Graphics object as a parameter it uses it only to initialize certain
properties, but it doesn't copy the pixels.

If it goes for Graphcis objects created for controls I don't think in .NET
1.x there is managed solution to the problem. .NET 2.0 introduces
Graphics.CopyFr omScreen that can be used in some cases to accomplish this.

If the graphcis object is for an image then use the image instead and copy
the image over the new graphics.
--

Stoitcho Goutsev (100)

"Lau Lei Cheong" <le****@yehoo.c om.hk> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Don't Graphics.DrawIm age() help?

"perspolis" <re*****@hotmai l.com>
¼¶¼g©ó¶l¥ó·s»D: ep************* *@TK2MSFTNGP05. phx.gbl...
Hi all
is it possible in C# to copy content of a graphics object to another
like BitBlt API??

thanks


May 24 '06 #3
I think you may have to use Graphics.GetHdc () to call BitBlt() yourself
then, as I can't find the .NET way to do this too...

"Stoitcho Goutsev (100)" <10*@100.com> ¼¶¼g©ó¶l¥ó·s»D: Ok************* *@TK2MSFTNGP05. phx.gbl...
I don't think that will help. DrawImage draws images over the graphics
objects. Even though the Bitmap class has a constructor that accepts
Graphics object as a parameter it uses it only to initialize certain
properties, but it doesn't copy the pixels.

If it goes for Graphcis objects created for controls I don't think in .NET
1.x there is managed solution to the problem. .NET 2.0 introduces
Graphics.CopyFr omScreen that can be used in some cases to accomplish this.

If the graphcis object is for an image then use the image instead and copy
the image over the new graphics.
--

Stoitcho Goutsev (100)

"Lau Lei Cheong" <le****@yehoo.c om.hk> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Don't Graphics.DrawIm age() help?

"perspolis" <re*****@hotmai l.com> ¼¶¼g©ó¶l¥ó·s»D: ep************* *@TK2MSFTNGP05. phx.gbl...
Hi all
is it possible in C# to copy content of a graphics object to another
like BitBlt API??

thanks



May 25 '06 #4

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

Similar topics

12
2389
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the graphics object of the form/pictureBox. Should It be better if make a graphics object from my pictureBox in load event handler of the form and store it as member variable of the form , make
5
2384
by: Stan Shankman | last post by:
C# -- Visual Studio.Net – Windows Application Greetings all, How do I copy a Form’s image to a bitmap? – And do so before it gets to the screen. I haven’t been able to find anyone that knows how to do this - - all I want to do is copy a Form’s image to a bitmap. - - In effect, I want to take a window-shot of a Form, (as opposed to a “screen-shot”) but it must be done before that Form hits the screen. Anyone? Ideas?
2
2538
by: John | last post by:
The following 4 lines add a border to a bitmap and save it into clipboard, however it also add a border to the bitmap on the screen. I want to create a temp copy of the bitmap and add a border to it without affecting the bitmap on the screen. Any suggestions? Thanks ''''' Dim g As Graphics = Graphics.FromImage(MyPpic.Image) Dim pen As New Pen(Color.Gray) g.DrawRectangle(pen, 0, 0, MyPpic.Image.Width - 1,
27
3394
by: JoeC | last post by:
I am still working on my game and my program is getting better. Most of what I want to works. I think I am having trouble with copy constructor. Basically I want it to copy the gdata array. My gdata will work if I do: gdata = this->get(lp); But that is not what I want to do I get some cryptic errors when I write the code like that is commented out. 49 C:\Documents and Settings\Work\My Documents\C++\Dungeon Adventure2\gaphic.cpp...
5
4501
by: Ajith Menon | last post by:
I want to copy a part of the windows form into clipboard as .bmp file. The usecase is the user drags using the mouse and creates a rectangular selection any where on the form. This part has to be copied into clipboard. Can anybody help me in implementing this using C#? Thanks, Ajith
9
4822
by: Alan T | last post by:
Any source code example I can use to save the clipboard content to an object, then I will do a copy and paste, finally put back the 'saved' clipboard content back to clipboard ?
1
3512
by: icepick72 | last post by:
On an academic note, I want to copy a Graphic to an Image (Bitmap). I have the Graphic object but not the origin image from which it originates; this is because I'm overriding the PrintDocument class OnPagePrint method which only provides me an e.Graphic (see code sample below). The FCL doesn't seem to natively support Graphic =(Image)Bitmap. I have tried BitBlt workaround in the source code to copy printer e.Graphic into the bmp...
13
1803
by: carlos123 | last post by:
ok the following code , is the code for my program, basicly, i use bluej, so i can just copy and paste some code into the forums and someone else can copy it in to their editor, so basicly i want someone to show me how to make this set of code to be able to run itself, i have marked the main areas of the code like the main and graphics panel etc sorry about the load of code, but this is important to me that i get this all working together....
1
1602
by: sfuo | last post by:
I am trying to make a window pop up that has 2 fields called IDC_NEW_TEXTURE_NAME and IDC_NEW_TEXTURE_BROWSE_FIELD. When I enter a name for the texture and a path name either with the browse pop up or a manual type in then click OK the code should copy a file from the browse field to my set directory with the new texture name with .png as the extension. the code for the window callback is: LRESULT CALLBACK NewTexture(HWND NewTextureDlg,...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
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 we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.