On Fri, 29 Jun 2007 14:54:11 -0700, bern11 <be****@yahoo.comwrote:
But CopyFromScreen doesn't take a bitmap or 2nd graphics as an argument.
And that's relevant how? My point is that it's the wrong method to use,
given what it _appears_ you asked about doing. The parameters it takes or
does not take aren't relevant because you shouldn't be using it. It is
specifically for taking an image from the screen, and copying it somewhere
else (for example, a Graphics instance you got from a different Bitmap
instance). If you don't want to start by drawing to the screen in the
first place, you can't use CopyFromScreen.
It appears to copy from one part of a graphics object to another.
The CopyFromScreen method copies a specified area from the screen _to_ the
Graphics instance on which it's called. It does not "copy from one part
of a graphics object to another" unless the Graphics instance used to call
the method turns out to represent the screen itself.
I could extend the graphics object to have an off-screen area, draw
there, then copy (with the desired effects options). That is the way I
am thinking now.
How, exactly, do you intend to "extend the graphics object"? If you have
a Graphics instance that currently represents the screen, it's not like
you can just tell it "okay, you're now twice as big".
Conversely, if your Graphics instance doesn't represent the screen, then
you're already dealing with an off-screen image.
It _seems_ to me that you are trying to take advantage of the
CopyPixelOperation enumeration without actually drawing the source image
to the screen, but unfortunately there's just no way (that I know of) to
do that using the Graphics class in .NET.
Now, all that said, the underlying source for this enumeration is the
drawing modes found in the native Windows HDC object. So, if what you
want is off-screen drawing that uses something more complex than the two
compositing modes that the Graphics class does offer, that's one approach.
It may be that the Windows Presentation Foundation also offers something
along these lines. I haven't used it, so I don't know. Guess I ought to
upgrade to .NET 3.0 some day. :)
Pete