社区
界面
帖子详情
关于picture control控件
lhskw1
2018-11-09 05:23:20
你好 之前使用WIN32通过调用fstream
fstream binary_file("d:\\1.png", ios::binary | ios::in);
再调用网上找的base64_encode函数实现了外部图片文件编码成Base64
现在想通过MFC来实现 把picture control控件上面的图片编码成Base64
但是请问要用哪个函数才能把picture control控件上面的图片转成二进制呢?
...全文
33
3
打赏
收藏
关于picture control控件
你好 之前使用WIN32通过调用fstream fstream binary_file("d:\\1.png", ios::binary | ios::in); 再调用网上找的base64_encode函数实现了外部图片文件编码成Base64 现在想通过MFC来实现 把picture control控件上面的图片编码成Base64 但是请问要用哪个函数才能把picture control控件上面的图片转成二进制呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
smwhotjay
2018-11-09
打赏
举报
回复
可以对控件图像截屏成hbitmap 然后save 图像
zgl7903
2018-11-09
打赏
举报
回复
拷贝pWnd指向窗口的lpRect部分 写成BMP文件
先转换成图片文件, 然后再编码
schlafenhamster
2018-11-09
打赏
举报
回复
HBITMAP CopyScreenToBitmap(CRect &Rect,HWND hwnd)
{
HDC hScrDC, hMemDC;
HBITMAP hOldBitmap,hBitmap;
int xScrn, yScrn;
// to screen coordinates.
MapWindowPoints(hwnd,NULL,(POINT *)&Rect,2);
hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL);
hMemDC = CreateCompatibleDC(hScrDC);
//
xScrn = GetDeviceCaps(hScrDC, HORZRES);
yScrn = GetDeviceCaps(hScrDC, VERTRES);
//
if (Rect.left < 0) Rect.left = 0;
if (Rect.top < 0) Rect.top = 0;
if (Rect.right > xScrn) Rect.right = xScrn;
if (Rect.bottom > yScrn) Rect.bottom = yScrn;
//
hBitmap = CreateCompatibleBitmap(hScrDC, Rect.Width(),Rect.Height());
hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
BitBlt(hMemDC,0,0,Rect.Width(),Rect.Height(),hScrDC,Rect.left,Rect.top,SRCCOPY);
hBitmap =(HBITMAP)SelectObject(hMemDC,hOldBitmap);
//
DeleteDC(hScrDC);
DeleteDC(hMemDC);
//
return hBitmap;
}
在
Pic
tu
re
Control
控件
上绘图并保存
在MFC对话框上的
pic
tu
re
control
控件
上,用鼠标绘图,按输入键开始绘图,按保存键,将
pic
tu
re
控件
所画图片保存为位图或jpg等格式
动态向
Pic
tu
re
Control
控件
中添加图片
动态向
Pic
tu
re
Control
控件
中添加 .bmp .jpg .gif三种格式的图片
利用MFC鼠标消息响应事件实现在
pic
tu
re
control
控件
上图像ROI区域选定与裁剪
利用vs2010MFC对话框的鼠标消息函数RBBUTTONDOWN,ONMOUSEMOVE,RBBUTONUP实现在
pic
tu
re
control
控件
上选定图像的矩形ROI感兴趣区域,并裁剪显示出所选定的ROI区域。按住鼠标右键,拖动光标划定矩形区域,再弹起鼠标...
VS2019
Pic
tu
re
Control
控件
例程MFCApplication
Pic
tu
re
Control
.rar
VS2019
Pic
tu
re
Control
控件
例程
ffmpeg解码视频后使用SDL在MFC的
pic
tu
re
control
控件
上显示
ffmpeg解码视频后使用SDL在MFC的
pic
tu
re
control
控件
上显示
界面
15,979
社区成员
115,897
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章