簡體   English   中英

Progress-4GL中活動窗口的屏幕截圖

[英]Screenshot of an active Window in Progress-4GL

我正在使用In Progress 4GL,在我的應用程序中,我希望對任何KeyStroke事件(例如(CTRL + F9))上的活動窗口進行屏幕快照,並將其保存在預先指定的文件夾中。 有人可以幫我嗎?

如評論中所述,可以通過從Progress ABL調用.NET來完成。 這是一個截取整個屏幕截圖的示例。 您將需要使其適應您的需求。

USING System.Drawing.*.
USING System.Drawing.Imaging.*.
USING System.Windows.Forms.Screen.

DEFINE VARIABLE bmpScreenshot AS Bitmap NO-UNDO.
DEFINE VARIABLE gfxScreenshot AS Graphics NO-UNDO.

bmpScreenshot = NEW Bitmap(Screen:PrimaryScreen:Bounds:Width,
                           Screen:PrimaryScreen:Bounds:Height,
                           PixelFormat:Format32bppArgb).

gfxScreenshot = Graphics:FromImage(bmpScreenshot).

gfxScreenshot:CopyFromScreen(Screen:PrimaryScreen:Bounds:X,
                            Screen:PrimaryScreen:Bounds:Y,
                            0,
                            0,
                            Screen:PrimaryScreen:Bounds:Size,
                            CopyPixelOperation:SourceCopy).

/* Use ImageFormat:[Png|Gif|Bmp|Tiff] etc for different image formats */
bmpScreenshot:SAVE("c:\temp\Screenshot.png", ImageFormat:Png).

這是SO此問題的C#到ABL的翻譯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM