×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VFP SCREEN CAPTURE UNDER PROGRAM CONTROL

VFP SCREEN CAPTURE UNDER PROGRAM CONTROL

VFP SCREEN CAPTURE UNDER PROGRAM CONTROL

(OP)
I need to capture a vfp form that I draw on using the shape control, after I finish drawing i want to triger a screen capture, write that capture image to a file and then print a form that has as a source the file just captured.
So exactly how do I capture the screen?   

RE: VFP SCREEN CAPTURE UNDER PROGRAM CONTROL

GDIPlusX can do this for you. This is a free community-developed library that you can download from:
http://vfpx.codeplex.com/wikipage?title=GDIPlusX&;referringTitle=Home

The code is very simple:

CODE

DO system.app
loImage = _SCREEN.System.Drawing.Bitmap.FromScreen(lnHwnd)
loImage.Save("MyImage.JPG", ;
 _SCREEN.System.Drawing.Imaging.ImageFormat.JPEG)

The first of the above lines stores an object reference to the main GDIPlus class in _Screen.

The second lne then uses that object to grab the screen shot. In this example, lnHwdn is the handle of the VFP form that you want to capture. You can get it form the form's hWnd property. If you want to capture the entire screen, use _Screeen.hWnd.

The third line saves the image to a file named MyImage.JPG in JPEG format. Yu can save in other formats as well.

I use this technique in one of my own applications. It works very well.

Mike
 

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 

RE: VFP SCREEN CAPTURE UNDER PROGRAM CONTROL

(OP)
Thanks Mike, it works
Jerry

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close