登录 用户中心() [退出] 后台管理 注册
   
您的位置: 首页 >> 程序员学前班[不再更新,只读] >> 主题: [ppc] ppc 装载 jpg 程序     [回主站]     [分站链接]
标题
[ppc] ppc 装载 jpg 程序
clq
浏览(0) + 2009-03-15 15:34:32 发表 编辑

关键字:

//clq add
CVOImage image;

HDC picDC = ::GetDC(hWnd);
//std::string path_fname = "";
//TCHAR * path_fname = L"c:\\1.jpg";
TCHAR * path_fname = L"\\1.jpg";


//image.Load (picDC , (const char *)path_fname.c_str());
//image.Load (picDC , path_fname);
//image.Draw (picDC ,10,10 );

HBITMAP hbitmap = 0;
hbitmap = SHLoadImageFile(path_fname);
//hbitmap = SHLoadImageResource(g_hInst, IDR_T31);


HDC hdcMem = CreateCompatibleDC (picDC);
HGDIOBJ hOldSel = SelectObject (hdcMem, hbitmap);
BITMAP bmp;//add test
GetObject (hbitmap, sizeof (BITMAP), &bmp);
RECT rect;
::GetClientRect(hWnd, &rect);
BitBlt (picDC, rect.left, rect.top, bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY);
SelectObject (hdcMem, hOldSel);
DeleteDC (hdcMem);


//clq add _end;

clq
2009-3-15 15:36:46 发表 编辑

其中
SHLoadImageResource
装载图片时,必须新建立一个 “GIF” 的资源类型。它最后在 .rc 文件中应该生成这样的一行

IDR_T31 GIF DISCARDABLE "C:\\Documents and Settings\\Administrator\\桌面\\1.gif"

msdn 的描述如下:
Windows Mobile Version 5.0 SDK

SHLoadImageResource
Send Feedback on this topic to the authors
Requirements
Pocket PC: Windows Mobile 2003 and later.
OS Versions: Windows CE .NET 4.0 and later.
Header: Declared in Aygshell.h.
Library: Use Aygshell.lib.

Converts an image file in the resource file to a bitmap file. A resource image file should be coded in the resource file as follows (using GIF as an example): IDG_MYIMAGE_GIF GIF DISCARDABLE "MyImage.gif".

Syntax
HBITMAP SHLoadImageResource (
HINSTANCE hinst,
UINT uIdImageFile
);
Parameters
hinst
[in] Handle to the module whose executable file contains the image file.
uIdImageFile
[in] UINT identifying the image file.
Return Values
A handle to a bitmap if successful, NULL otherwise.

Remarks
This function converts files of several types, including GIF (Graphics Interchange Format), PNG (Portable Network Graphics), JPG (Joint Photographic Experts Group), ICO (icon), and BMP (bitmap) file formats.

Requirements
Pocket PC: Windows Mobile 2003 and later.
OS Versions: Windows CE .NET 4.0 and later.
Header: Declared in Aygshell.h.
Library: Use Aygshell.lib.




--------------------------------------------------------------------------------

Last updated on Wednesday, September 14, 2005

Send Feedback on this topic to the authors

© 2005 Microsoft Corporation. All rights reserved.



总数:1 页次:1/1 首页 尾页  
总数:1 页次:1/1 首页 尾页  


所在合集/目录



发表评论:
文本/html模式切换 插入图片 文本/html模式切换


附件:



NEWBT官方QQ群1: 276678893
可求档连环画,漫画;询问文本处理大师等软件使用技巧;求档softhub软件下载及使用技巧.
但不可"开车",严禁国家敏感话题,不可求档涉及版权的文档软件.
验证问题说明申请入群原因即可.

Copyright © 2005-2020 clq, All Rights Reserved
版权所有
桂ICP备15002303号-1