![](/img/trans.png)
[英]Can I add a .Net visual component on a Progress-4GL window?
[英]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).
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.