AlexCode Posted July 16, 2004 Posted July 16, 2004 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 Quote Software bugs are impossible to detect by anybody except the end user.
rifter1818 Posted July 17, 2004 Posted July 17, 2004 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! Quote
AlexCode Posted July 17, 2004 Author Posted July 17, 2004 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 Quote Software bugs are impossible to detect by anybody except the end user.
AlexCode Posted July 17, 2004 Author Posted July 17, 2004 Here's my answer: http://www.vb-helper.com/howto_net_save_form_image.html Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.