请问如何调用Windows画图来编辑Picture中的图片?

SafeF8 2004-08-10 12:01:14
我做了个抓图的小程序,是用Picture控件来存放捕获了的图片的,想调用Windows画图来编辑它,不知道如何实现?
只是知道用shell函数可以把它调用出来,但是怎样使捕获了的图片放到window画图中去呢?
...全文
321 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
SafeF8 2004-08-11
  • 打赏
  • 举报
回复
楼上的厉害,搞定了.谢谢!
James0001 2004-08-11
  • 打赏
  • 举报
回复
'来个复杂的
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (ByRef lpExecInfo As SHELLEXECUTEINFO) As Long
Private Const SEE_MASK_CLASSNAME = &H1

Private Sub Command1_Click()
Dim exeinf As SHELLEXECUTEINFO
With exeinf
.cbSize = LenB(exeinf)
.fMask = SEE_MASK_CLASSNAME
.hwnd = Me.hwnd
.lpVerb = "edit"
'----------------------------
.lpFile = "d:\temp.bmp" '要编辑的文件!
'----------------------------
.lpParameters = vbNullString
.lpDirectory = vbNullString
.nShow = vbNormalFocus
.lpClass = "Paint.Picture"
End With
ShellExecuteEx exeinf
End Sub

// 还有人在么?
northwolves 2004-08-10
  • 打赏
  • 举报
回复
呵呵,小兄弟最近比较活跃。
BlueBeer 2004-08-10
  • 打赏
  • 举报
回复
哇,楼上的好快啊。。。。
BlueBeer 2004-08-10
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
'Picture1.Picture = Picture1.Image
SavePicture Picture1.Picture, "c:\tmp.bmp"
Shell "PBRUSH.EXE c:\tmp.bmp", 1
End Sub
northwolves 2004-08-10
  • 打赏
  • 举报
回复
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Private Sub Command1_Click()
SavePicture Picture1.Picture, "d:\temp.bmp"
ShellExecute Me.hwnd, "open", "d:\temp.bmp", "pbrush.exe", vbNullString, 1
End Sub
_1_ 2004-08-10
  • 打赏
  • 举报
回复
一个是用粘贴版

还有是把图片保存下来 再叫画笔打开来
northwolves 2004-08-10
  • 打赏
  • 举报
回复
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Private Sub Command1_Click()
SavePicture Picture1.Picture, "d:\temp.bmp"
ShellExecute Me.hwnd, "open", "d:\temp.bmp", "C:\Program Files\Accessories\mspaint.exe", vbNullString, 1
End Sub
SafeF8 2004-08-10
  • 打赏
  • 举报
回复
结果还是pbrush.exe(Windows图片查看器)来打开的?
有些郁闷了.为什么还是这样呢?麻烦各位了
SafeF8 2004-08-10
  • 打赏
  • 举报
回复
谢谢各位!
To northwolves(狼行天下)
ShellExecute Me.hwnd, "open", "d:\temp.bmp", "pbrush.exe", vbNullString, 1
这样是用Windows图片查看器打开而已,我是想用Windows画图工具来打开.而我把"Pbrush.exe"改为了"mspaint.exe"(Windows画图),但是结果还是pbrush.exe(Windows图片查看器)来打开的,是怎么回事呢?

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧