-
-
Save CC58/2dd65fd935b63d14db311148506080e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## IronPython Script for SharpCap | |
## SCREEN CAPTURE of video to new window for 2nd monitor v1.1 | |
import clr | |
clr.AddReference("System.Windows.Forms") | |
clr.AddReference("System.Drawing") | |
from System.Drawing import Bitmap, Graphics, Point, Size | |
from System.Windows.Forms import ( | |
Application, Button, Form, FormWindowState, | |
PictureBox, Screen | |
) | |
frm = Form(Text="Capture Screen") | |
frm.ClientSize = Size(720, 576) | |
pb = PictureBox() | |
pb.Location = Point(0,0) | |
pb.Size = Size(720, 576) | |
frm.Controls.Add(pb) | |
def cmdScreenUpdate (): | |
bmp = Bitmap(720, 576) | |
g = Graphics.FromImage(bmp) | |
## SharpCap.ReticuleForm | |
## SharpCap.TransparentMouseCaptureForm | |
g.CopyFromScreen(SharpCap.MainWindow.Location.X+10, SharpCap.MainWindow.Location.Y+80, 0, 0, bmp.Size) | |
g.Dispose() | |
pb.Image = bmp | |
pb.Size = bmp.Size | |
frm.Text=("Capture Screen - Object Name = <<< %s >>>" % SharpCap.TargetName) ## print object name to 2nd screen | |
def main(): | |
SharpCap.AddCustomButton("<Snap>", None, None, cmdScreenUpdate) | |
Application.EnableVisualStyles() | |
Application.Run(frm) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment