473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 9262
Don't Graphics.DrawImage() help?

"perspolis" <re*****@hotmail.com> ¼¶¼g©ó¶l¥ó·s»D:ep**************@TK2MSFTNGP05.phx.g bl...
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.CopyFromScreen 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.com.hk> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Don't Graphics.DrawImage() help?

"perspolis" <re*****@hotmail.com>
¼¶¼g©ó¶l¥ó·s»D:ep**************@TK2MSFTNGP05.phx.g bl...
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.g bl...
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.CopyFromScreen 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.com.hk> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Don't Graphics.DrawImage() help?

"perspolis" <re*****@hotmail.com> ¼¶¼g©ó¶l¥ó·s»D:ep**************@TK2MSFTNGP05.phx.g bl...
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
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...
5
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...
2
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...
27
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...
5
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...
9
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
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...
13
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...
1
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.