关于调用系统画图板

caiyan807 2008-12-22 02:36:30
我想在代码中调用windows系统中的画图板工具打开一幅图像,应该怎么做?
...全文
121 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
caiyan807 2008-12-22
  • 打赏
  • 举报
回复
谢谢,解决了,散分了
oyljerry 2008-12-22
  • 打赏
  • 举报
回复
Run中 -> mspaint "C:\pic12.jpg"
oyljerry 2008-12-22
  • 打赏
  • 举报
回复
MsPaint 不会直接打开jpg文件...可以放到mspaint.exe的命令行参数中

[QUOTE=引用David Lowndes <DavidL@xxxxxxxxxxxxxxx> wrote:]

I have problem with ShellExecute() for open image with Ms Paint :
I tried :
ShellExecute(NULL,"Open","mspaint.exe",szFileName,NULL,SW_SHOWNORMAL);

If szFileName with space ("C:\\Documents and Settings\\pic.jpg"
etc...) -> MS Paint cannot open this file !


Is there some error message from Paint?

I'd guess there's quotes missing from the %1 parameter in the file
type association in the registry settings.


The OP isn't using file type associations. He or she is invoking
mspaint.exe explicitly, passing the file name as command line parameter.

[/QUOTE]
cnzdgs 2008-12-22
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 caiyan807 的回复:]
谢谢楼上,不过就差一点,我要打开的是jpg,但是它提示说找不到bmp,不知道是那个参数不对啊?
[/Quote]
你是不是把文件名写错了?ShellExecute的第4参数。
wap21 2008-12-22
  • 打赏
  • 举报
回复
mark
caiyan807 2008-12-22
  • 打赏
  • 举报
回复
谢谢楼上,不过就差一点,我要打开的是jpg,但是它提示说找不到bmp,不知道是那个参数不对啊?
ivan_08 2008-12-22
  • 打赏
  • 举报
回复
汗,我看错了,正好学习下二楼的
cnzdgs 2008-12-22
  • 打赏
  • 举报
回复
ShellExecute(NULL, _T("open"), _T("mspaint.exe"), _T("c:\\1.bmp"), NULL, SW_SHOWNORMAL);
ivan_08 2008-12-22
  • 打赏
  • 举报
回复
定义一个按钮,关联一个函数,如OnColor()
{
CColorDialog dlg; //定义颜色对话框类的对象
if(dlg.DoModal == IDOK) //调用颜色对话框
m_color = dlg.GetColor(); //返回选中的颜色
}

19,464

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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