使图像全屏显示

使图像全屏显示

我有一堆电视,用于数字标牌,由运行 Windows 10 的英特尔 NUCS 驱动。我目前正在使用 Visual Basic 脚本,它运行良好,但我想知道是否有更好的方法通过系统执行此操作。图像需要进入全屏模式,这样它才能作为标牌工作。这是否可以通过 PowerShell 脚本或注册表来实现,以使照片或绘画始终以全屏方式打开?欢迎提出任何想法。

以下是我现在使用的 Visual Basic 代码:

strFileName = "FILE PATH OF IMAGE"
Dim objshell : Set objshell=createobject("wscript.shell")

objshell.run "mspaint " & strFileName

wscript.sleep 1000
objshell.AppActivate("NAME_OF_IMAGE - Paint")
wscript.sleep 1000
objshell.SendKeys "{F11}"
wscript.sleep 1000
objshell.SendKeys "{F11}"
wscript.sleep 1000
objshell.SendKeys "{F11}"

答案1

不需要 3rdP 软件,正如 arthur kamande 所建议的那样。

没有什么可以阻止您使用 SendKeys 和 PowerShell。只需将 VBS 转换为 PowerShell 代码,因为它们实际上是相同的。

使用 SendKeys 的 Powershell 示例。

[void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic") 

Start-Process -FilePath 'notepad.exe'

[Microsoft.VisualBasic.Interaction]::AppActivate("Untitled - Notepad")
Start-Sleep -Seconds 2

[System.Windows.Forms.SendKeys]::SendWait("%(fs)")
Start-Sleep -Seconds 2

[System.Windows.Forms.SendKeys]::SendWait("%{F4}")
Start-Sleep -Seconds 2

[System.Windows.Forms.SendKeys]::SendWait("x")

相关内容