社区
图形处理/算法
帖子详情
问一个很简单的图像读取显示的问题
chriswwl
2006-03-20 05:22:29
帮忙举一个实际点的例子
比如读取和显示e:\1.jpg的图像
程序怎么写?
...全文
100
1
打赏
收藏
问一个很简单的图像读取显示的问题
帮忙举一个实际点的例子 比如读取和显示e:\1.jpg的图像 程序怎么写?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
FengYuanMSFT
2006-03-21
打赏
举报
回复
IPicture * LoadPicture(LPCTSTR szFile)
{
// open file
HANDLE hFile = CreateFile(szFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (INVALID_HANDLE_VALUE == hFile)
{
return NULL;
}
else
{
// get file size
int nFileSize = GetFileSize(hFile, NULL);
IPicture * pPicture = NULL;
if (nFileSize > 0)
{
// alloc memory based on file size
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, nFileSize);
LPVOID pvData = GlobalLock(hGlobal);
DWORD dwBytesRead = 0;
// read file and store in global memory
BOOL bRead = ReadFile(hFile, pvData, nFileSize, &dwBytesRead, NULL);
GlobalUnlock(hGlobal);
LPSTREAM pstm = NULL;
HRESULT hr = CreateStreamOnHGlobal(hGlobal, TRUE, &pstm);
assert(SUCCEEDED(hr) && pstm);
hr = ::OleLoadPicture(pstm, nFileSize, FALSE, IID_IPicture, (LPVOID *)&pPicture);
assert(SUCCEEDED(hr) && pPicture);
pstm->Release();
}
CloseHandle(hFile);
return pPicture;
}
}
pPicture->Render(hdc, dx, dy, w, h, 0, bmHeight, bmWidth, -bmHeight, NULL);
华为荣耀recovery1.0
源码链接: https://pan.quark.cn/s/a4b39357ea24 This directory contains a script ('makefsdata') to create C code suitable for httpd for given html pages (or other files) in a directory. There is also a plain C console application doing the same and extended a bit. Usage: htmlgen [targetdir] [-s] [-i]s targetdir: relative or absolute path to files to convert switch -s: toggle processing of subdirectories (default is on) switch -e: exclude HTTP header from file (header is created at runtime, default is on) switch -11: include HTTP 1.1 header (1.0 is default) if targetdir not specified, makefsdata will attempt to process files in subdirectory 'fs'.
光纤耦合器Matlab模拟.rar
光纤耦合器Matlab模拟.rar
ModbusDoctor软件
官网下载地址:需墙:https://www.kscada.com/modbusdoctor.html 使用非常
简单
,并且免费、免安装 Modbus Doctor(强烈推荐) 下载地址:搜索 “Modbus Doctor” 官网或 GitHub 界面现代化,支持中文,操作和 Modbus Poll 很像
图形处理/算法
19,464
社区成员
50,678
社区内容
发帖
与我相关
我的任务
图形处理/算法
VC/MFC 图形处理/算法
复制链接
扫一扫
分享
社区描述
VC/MFC 图形处理/算法
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章