//
.rc
pic BITMAP " pic.bmp "
pic BITMAP " pic.bmp "
//.cpp
#include
<
windows.h
>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
HBITMAP hBm;
BITMAP bm;
int iWindowWidth;
int iWindowHeight;
HDC hDC;
HDC hdcmem;
PAINTSTRUCT ps;
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInst,
LPSTR lpszCmdLine,
int nCmdShow)
{
HWND hwnd;
MSG Msg;
// 用HBITMAP指向资源内的图片
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
HBITMAP hBm;
BITMAP bm;
int iWindowWidth;
int iWindowHeight;
HDC hDC;
HDC hdcmem;
PAINTSTRUCT ps;
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInst,
LPSTR lpszCmdLine,
int nCmdShow)
{
HWND hwnd;
MSG Msg;
// 用HBITMAP指向资源内的图片

本文介绍了如何在Win32应用程序中加载和显示图片资源,包括从资源文件读取图片、创建位图对象以及在窗口上绘制图片的步骤。
最低0.47元/天 解锁文章
1806





