Home All Groups Group Topic Archive Search About
Author
28 Jul 2006 1:37 PM
mark.milley@binaryswitch.com
Hi all -

I'm a complete noob when it comes to using the system.drawing
namespace.

I'd like to draw a control to an image instead of on screen (the object
shouldn't appear on screen at all). Any ideas?

I was trying to use control.createGraphics, but it doesn't appear to
have any options to save the data to a different surface...

Is there any way to use the graphics object to draw to multiple
surfaces simultaneously?

Thanks,

-Mark

Author
28 Jul 2006 1:57 PM
Chris
mark.mil***@binaryswitch.com wrote:
Show quoteHide quote
> Hi all -
>
> I'm a complete noob when it comes to using the system.drawing
> namespace.
>
> I'd like to draw a control to an image instead of on screen (the object
> shouldn't appear on screen at all). Any ideas?
>
> I was trying to use control.createGraphics, but it doesn't appear to
> have any options to save the data to a different surface...
>
> Is there any way to use the graphics object to draw to multiple
> surfaces simultaneously?
>
> Thanks,
>
> -Mark
>

"I'd like to draw a control to an image instead of on screen"

What does that mean?
Author
28 Jul 2006 2:06 PM
mark.milley@binaryswitch.com
> "I'd like to draw a control to an image instead of on screen"
>
> What does that mean?

Instead of drawing it to the form surface (or simultaneously), I'd like
the control to paint itself onto a blank canvas in memory, so I can
save that as an image.

In this case, my end goal is to save a thumbnail of a web page *WITHOUT
SHOWING IT ON SCREEN*. However, this same technique could be used to
save a frame of a video, or anything else, for that matter.

-M
Author
28 Jul 2006 3:09 PM
Chris
mark.mil***@binaryswitch.com wrote:
Show quoteHide quote
>
>> "I'd like to draw a control to an image instead of on screen"
>>
>> What does that mean?
>
> Instead of drawing it to the form surface (or simultaneously), I'd like
> the control to paint itself onto a blank canvas in memory, so I can
> save that as an image.
>
> In this case, my end goal is to save a thumbnail of a web page *WITHOUT
> SHOWING IT ON SCREEN*. However, this same technique could be used to
> save a frame of a video, or anything else, for that matter.
>
> -M
>
Ah, ok...

Do a search on drawing to a bitmap.

http://www.samspublishing.com/articles/article.asp?p=29477&seqNum=8&rl=1

Chris
Author
28 Jul 2006 4:42 PM
mark.milley@binaryswitch.com
> Do a search on drawing to a bitmap.

No, I know how to draw to a bitmap. I'm trying to get (essentially) a
screenshot of a control without that control ever appearing on screen.

I can draw a bitmap.

I can get a screenshot if it's on screen.

What I can't do (yet) is have the control, without drawing itself to
the screen, draw itself to an image instead--(or some other technique
that would have the same result).

I've tried putting the control on an offscreen form and trying to
bitblt that, but it's not working.