| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 517 人关注过本帖
标题:这2句设置印象模式语句到底有什么用啊,
只看楼主 加入收藏
yaoguai2005
Rank: 1
等 级:新手上路
帖 子:168
专家分:0
注 册:2005-9-11
收藏
 问题点数:0 回复次数:0 
这2句设置印象模式语句到底有什么用啊,

#include <windows.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;


int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevinst,

PSTR lpszCmdLine, int nCmdShow)

{
HWND hwnd ;

MSG Msg ;
WNDCLASS wndclass ;
char lpszTitle[]="My_Map_Mode";
char lpszClassName[]="影响模式";

wndclass.style = 0 ;

wndclass.lpfnWndProc = WndProc ;

wndclass.cbClsExtra = 0 ;

wndclass.cbWndExtra = 0 ;

wndclass.hInstance = hInstance ;

wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;

wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;

wndclass.hbrBackground=(HBRUSH) GetStockObject (WHITE_BRUSH) ;

wndclass.lpszMenuName = NULL ;

wndclass.lpszClassName= lpszClassName ;


if (!RegisterClass (&wndclass))

{

MessageBeep(0);

return FALSE;

}

hwnd = CreateWindow( lpszClassName, // window class name

lpszTitle, // window caption

WS_OVERLAPPEDWINDOW, // window style

CW_USEDEFAULT,// initial x position

CW_USEDEFAULT,// initial y position

CW_USEDEFAULT,// initial x size

CW_USEDEFAULT,// initial y size

NULL, // parent window handle

NULL, // window menu handle

hInstance, // program instance handle

NULL) ; // creation parameters

ShowWindow (hwnd, nCmdShow) ;

UpdateWindow (hwnd) ;

while (GetMessage (&Msg, NULL, 0, 0))

{

TranslateMessage (&Msg) ;

DispatchMessage (&Msg) ;

}

return Msg.wParam ;

}


LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

HDC hdc ;

PAINTSTRUCT ps ;

HBRUSH hB1,hB2;
int nMode;

switch (message)

{

case WM_CREATE:

nMode=MM_TEXT;

case WM_LBUTTONDOWN:
nMode=MM_ISOTROPIC;
InvalidateRect(hwnd,NULL,1);
break;
case WM_RBUTTONDOWN:
nMode=MM_ANISOTROPIC;
InvalidateRect(hwnd,NULL,1);
break;


case WM_PAINT:

hdc = BeginPaint (hwnd, &ps) ;

SetMapMode(hdc,nMode);
SetWindowExtEx(hdc,150,150,NULL);//就是这2句,感觉和没用一样,学了几天
SetViewportExtEx(hdc,150,100,NULL);//的印象模式,还是不明白它们有什么作用
//把它们的参数全写成0,也没有什么变化,哪位好人给说几句把,
//它们有什么用啊,
SetViewportOrgEx(hdc,100,10,NULL);
hB1=(HBRUSH)GetStockObject(WHITE_BRUSH);
hB2=(HBRUSH)GetStockObject(BLACK_BRUSH);
SelectObject(hdc,hB1);
RoundRect(hdc,0,0,150,150,30,30);
SelectObject(hdc,hB2);
Ellipse(hdc,0,10,150,140);


EndPaint (hwnd, &ps) ;

break ;

case WM_DESTROY:
DeleteObject(hB1);
DeleteObject(hB2);
PostQuitMessage (0) ;
break;
default:

return DefWindowProc (hwnd, message, wParam, lParam) ;

}


return 0 ;
}

搜索更多相关主题的帖子: 印象 模式 语句 
2006-04-04 15:20
快速回复:这2句设置印象模式语句到底有什么用啊,
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039648 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved