Saving the Forms Image as a picture RRS feed

  • Question

  • Is it possible to save the forms face and only the form as apposed to the whole screen, OR even better part of the forms face, as an image/bmp?

    I have a homemade scanner that feeds data into the computer where it is processed as tiny panels of different colours until it forms a whole picture. I want to be able to save the form it's on OR the panels themselves as a group as an image. Is this possible?

    Tuesday, October 31, 2006 4:43 AM


  • Hi,

    I think this article http://msdn2.microsoft.com/en-us/library/6he9hz8c.aspx contains the code to do what you need.

    Quoting from the article, please refer to it for the full code.

        Dim memoryImage As Bitmap

        Private Sub CaptureScreen()
            Dim myGraphics As Graphics = Me.CreateGraphics()
            Dim s As Size = Me.Size
            memoryImage = New Bitmap(s.Width, s.Height, myGraphics)
            Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)
            memoryGraphics.CopyFromScreen(Me.Location.X, Me.Location.Y, 0, 0, s)
        End Sub

    Hope this helps,

    Tuesday, October 31, 2006 5:42 PM