I On Fri, Oct 28, 2016 at 11:28 AM, Mike Copeland mike@ggisoft.com wrote:
Man-wai Chang wrote:
Is there a VFP function that does it? Win32API needed?
Here's what I use. It creates a snapshot of the entire screen and saves it as "error.emf" which is a bit-map format that compresses extremely well.
[...]
f you don't mind pulling GDIPlusX, into your program, you can do something like:
* Screengrab cf http://www.mail-archive.com/profox@leafe.com/msg56529.html If Type("_Screen.ActiveForm") = "O" Do System.App loBmp = _Screen.System.Drawing.Bitmap.Fromscreen(_Screen.ActiveForm.HWnd) loBmp.Save(lcErrDir + "offending_form.png", _Screen.System.Drawing.Imaging.ImageFormat.Png) loBmp.Dispose() lcAttachmentList = lcAttachmentList + CRLF + lcErrDir + "offending_form.png" Endif
As you can see, I stole\W was inspired by a post by Christof Wollenhaupt back in 2008.