Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi!

The subject says it all...

 

How can I capture part of my form, defined as a rectangle, into a bmp/jpg whatever...

 

Thank you very much...

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.
Posted

here it is in C# pretty much the same in vb

bitmap = form.backgroundimage.clone();
bitmap = bitmap.clone(rectangle,bitmap.pixelformat);
bitmap.save(FileName,ImageFormat);

The Image format is a enum in System.Drawing.Imaging and can be bmp or jpg plus many others, the rectangle can be either a Rectangle or a RectangleF, the form is well a System.Windows.Forms.Form and the bitmap is well a System.Drawing.Bitmap. Good luck!

Posted

HI...

 

Thanks for the repply.

 

In fact, that's almost it... the problem on your idea is that I only get the background image... I need to get everything that's on the specifyed rectangle... as possible controls for example!

 

I was thinking about making a print screen and calculate the form position and then the rectangle position... finally use something like you told on your post...

 

How can I do a print screen in .net? :p

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...