#include<windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
PSTR szCmdLine,int iCmdShow)
{
static TCHAR szAppName[]=TEXT("AltWind");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=;
wndclass.cbWndExtra=;
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=szAppName; if(!RegisterClass(&wndclass))
{
MessageBox(NULL,TEXT("Program requires Windows NT!"),
szAppName,MB_ICONERROR);
return ;
}
hwnd=CreateWindow(szAppName,TEXT("Altermate and winding FillModes"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,,))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
static POINT aptFigure[]={,,,,,,,,,,
,,,,,,,,,};
static int cxClient,cyClient; HDC hdc;
int i;
PAINTSTRUCT ps;
POINT apt[]; switch(message)
{
case WM_SIZE:
cxClient=LOWORD(lParam);
cyClient=HIWORD(lParam);
return ;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
SelectObject(hdc,GetStockObject(GRAY_BRUSH)); for(i=;i<;i++)
{
apt[i].x=cxClient*aptFigure[i].x/;
apt[i].y=cyClient*aptFigure[i].y/;
}
SetPolyFillMode(hdc,ALTERNATE);
Polygon(hdc,apt,);
for(i=;i<;i++)
{
apt[i].x+=cxClient/;
}
SetPolyFillMode(hdc,WINDING);
Polygon(hdc,apt,); EndPaint(hwnd,&ps);
return ;
case WM_DESTROY:
PostQuitMessage();
return ;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}

API练习_图形的更多相关文章

  1. FastStone Capture(FSCapture) 注册码 _图形图像_软件教程_脚本之家

    FastStone Capture(FSCapture) 注册码 _图形图像_软件教程_脚本之家 FastStone Capture 注册码 序列号: name/用户名:TEAM JiOO key/注 ...

  2. ArcGIS api for javascript——图形-使用多个图形图层

    描述 本例展示了如何增加多个图形图层到地图.一个图形图层显示国家,另一个显示城市.在一个地图中有多个图形图层的能力是在ArcGIS JavaScript API v1.4增加的. 从蓝色的城市点分隔灰 ...

  3. 3D数学基础_图形与游戏开发

    https://blog.csdn.net/popy007/article/list/2?t=1&  //向量计算相关文章 https://www.baidu.com/link?url=48C ...

  4. 测试服务API的_苏飞开发助手_使用说明

    1 工具说明_json对象字符串拼接 2 工具说明_纯字符串拼接

  5. Android 百度地图API(01)_开发环境 HelloBaiduMap

    转载于:http://blog.csdn.net/lmj623565791/article/details/37729091 转载于:http://blog.csdn.net/crazy1235/ar ...

  6. 04747_Java语言程序设计(一)_第7章_图形、图像与多媒体

    例7.1小应用程序用6种字型显示字符串,显示内容说明本身的字型. import java.applet.*; import java.awt.*; public class Example7_1 ex ...

  7. 04747_Java语言程序设计(一)_第6章_图形界面设计(二)

    例6.1声明一个面板子类,面板子类对象有3个选择框. class Panel1 extends JPanel { JCheckBox box1, box2, box3; Panel1() { box1 ...

  8. 淘宝api 开发_获取用户信息

    string url = "http://gw.api.taobao.com/router/rest"; "; string appsecret = "fdf7 ...

  9. 使用异步任务降低API延迟_实践总结

    之前在想如何降低API的延迟,这些API里有几个比较耗时的操作且是串行执行,那通过异步执行的方式理论上可以降低运行的时间,如下图所示: 具体的实现比较简单,例如这样: public class Par ...

随机推荐

  1. ios 闪屏页的设置

    ref:http://blog.csdn.net/bianruifeng/article/details/8746549

  2. iOS开源库--最全的整理 分类: ios相关 2015-04-08 09:20 486人阅读 评论(0) 收藏

    youtube下载神器:https://github.com/rg3/youtube-dl 我擦咧 vim插件:https://github.com/Valloric/YouCompleteMe vi ...

  3. java实现gbdt

    DATA类 import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import ...

  4. ios 自定义NSError

    from:[object-c错误处理]http://www.androiddev.net/objective-c%E5%AD%A6%E4%B9%A0%E4%B9%8B%E9%94%99%E8%AF%A ...

  5. DataTable distinct 去重复

    有时我们需要从DataTable中抽取Distinct数据,以前总是以对DataTable进行foreach之类纯手工方式获取. 近来发现DataView可以帮我们直接获取Distinct数据,汗一个 ...

  6. selenium Chromediver

    Here we use wget to fetch the version number of the latest release, then plug the version into anoth ...

  7. Leetcode 181. Employees Earning More Than Their Managers

    The Employee table holds all employees including their managers. Every employee has an Id, and there ...

  8. Python - Headless Selenium WebDriver Tests using PyVirtualDisplay

    Here is some Python code showing WebDriver with a virtual display provided by Xvfb: #!/usr/bin/env p ...

  9. Angular - - $interpolate 和 $parse

    $interpolate 将一个字符串编译成一个插值函数.HTML编译服务使用这个服务完成数据绑定. 使用:$interpolate(text,[mustHaveExpression],[truste ...

  10. SQLite存储区的日志模式

    目录内包含了三个文件xxx.sqlite.xxx.sqlite-shm.xxx.sqlite-wal 默认的日志模式为Write-Ahead Logging(WAL): 支持多个并发读取和一个并发写入 ...