我使用 PowerShell 开发一个程序,并像标准油漆一样组装 Windows 窗体。我可以加载图像并对其进行编辑,但我想添加一个新工具:单击图片后,我想在文本框中显示所选像素的坐标。
问题是如何从选定的像素中获取坐标?
感谢您的帮助!
PictureBox
类继承aMouseClick
事件您可以订阅:
$pictureBox.add_MouseClick({
param($sender, $mouseEventArgs)
Write-Host "PictureBox was clicked at location $($mouseEventArgs.Location)"
})