#include <Windows.h>
#include <tchar.h>
BOOLEAN InitWindowClass(HINSTANCE hInstance, int nCmdShow);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
MSG msg;
if(!InitWindowClass(hInstance, nCmdShow)){
MessageBox(NULL, L"Failed to Create Windows", L"InFo", NULL);
return 1;
}
while(GetMessage(&msg, NULL, 0, 0)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
BOOLEAN InitWindowClass(HINSTANCE hInstance, int nCmdShow){
WNDCLASSEX wcex;
HWND hWnd;
TCHAR szWindowsClass[] = L"窗口示例";
TCHAR szTitle[] = L"映射模式及填充示例图";
wcex.cbClsExtra = 0;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.cbWndExtra = 0;
wcex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wcex.hInstance = hInstance;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hIcon &
Windows绘图—六种映射方式
最新推荐文章于 2021-08-30 22:32:59 发布
本文通过一个Windows应用程序示例,详细介绍了MM_TEXT、MM_ISOTROPIC和MM_ANISOTROPIC三种映射模式及其效果,包括不同比例的窗口到视口的映射,以及在保持纵横比条件下的映射调整。同时,文章还展示了使用基本图形函数如RoundRect、Ellipse和Pie进行绘图的操作。
摘要由CSDN通过智能技术生成