Screen Capture

I want to be able to do a screen capture of a tab in tabpanel in my application, saving to a place and then attach the file into the database all i codes. So my question is how to do screen capture

In what OS? Or are you speaking of a solution inside Xojo?

both mac and windows … and yes inside Xojo.

Since System.Pixel went away I don’t think there is a way to do a screen capture in the framerwork…

But maybe you just need Rectcontrol.Drawinto? (in the past that was somewhat buggy for some controls but I have not tried for a long time)

just check the old RS forum and i think Christian has ScreenshotMBS for this purpose. Will give a try

ScreenshotRectMBS may be better.

I want to just capture the current window…

How do i do that?? Christian.

Doesn’t .drawInto allow you to copy the contents of a window (i.e. minus the borders /client area only) to a picture object?

Otherwise, there are (and I think, relatively simple APIs) to do it from the OS.

Just quickly searching, on windows I suspect it’s : http://msdn.microsoft.com/en-us/library/windows/desktop/dd144873(v=vs.85).aspx + “DCX_Window” and you’ll have the window device context (which should just be a bitmap) that you can copy/save.

i try ScreenshotWindowMBS which work really great BUT it is only available Mac. Is there anything for Windows??? Christian??

Did you try DrawInto for either the Tabpanel or the Window?

DrawInto normally has very bad quality.
ScreenshotRectMBS is the best we have for Windows.

Karen, i try DrawInto with the following codes which did what i need BUT then i see ghost image in my application after i click on the screen capture button. Also the captured does not show any button or tab panel.

  Dim p As New Picture(self.Width, self.Height, 32)
  self.DrawInto(p.Graphics, 0, 0)

Christian, how do i capture the value for the current window if using ScreenshotRectMBS??

never mind… i got it working now

  dim p as picture
  p=screenshotRectMBS(self.left,self.top,self.width,self.height)

got it… i have to use the following code for WinXP. not sure about win7 yet.

dim p as picture
p=screenshotRectMBS(self.left-5,self.top+35,self.width+10,self.height+20)