首页 > 分享 > c语言编程花朵,C语言花朵代码.doc

c语言编程花朵,C语言花朵代码.doc

C语言花朵代码

. C语言——绘画花朵

代码部分#include #include #define PI 3 LRESULT CALLBACK WindowProcedure ( HWND, UINT, WPARAM, LPARAM );void OnPaint ( HDC ); void DrawLine ( HDC, int, int, int, int );void DrawFlower ( HDC, int, int, COLORREF );void DrawTie ( HDC, int, int, COLORREF ); int WINAPI WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil ){ char szClassName[] = TEXT ( "DrawFlower" ); HWND hwnd; MSG msg; WNDCLASSEX wc = { 0 }; wc.hInstance = hThisInstance; wc.lpszClassName = szClassName; wc.lpfnWndProc = WindowProcedure; wc.style = CS_DBLCLKS; wc.cbSize = sizeof ( WNDCLASSEX ); wc.hIcon = LoadIcon ( NULL, IDI_APPLICATION ); wc.hIconSm = LoadIcon ( NULL, IDI_APPLICATION ); wc.hCursor = LoadCursor ( NULL, IDC_ARROW ); wc.hbrBackground = ( HBRUSH ) ( COLOR_WINDOW+1 ); if ( !RegisterClassEx ( &wc ) ) return 0; hwnd = CreateWindowEx ( 0, szClassName, szClassName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_DESKTOP, NULL, hThisInstance, NULL ); ShowWindow ( hwnd, nFunsterStil ); while ( GetMessage ( &msg, NULL, 0, 0 ) ) { TranslateMessage ( &msg ); DispatchMessage ( &msg ); } return msg.wParam;} LRESULT CALLBACK WindowProcedure ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ){ PAINTSTRUCT ps; HDC hdc; switch ( msg ) { case WM_PAINT: hdc = BeginPaint ( hwnd, &ps ); OnPaint ( hdc ); EndPaint ( hwnd, &ps ); break; case WM_DESTROY: PostQuitMessage ( 0 ); break; default: return DefWindowProc ( hwnd, msg, wParam, lParam ); } return 0;} void OnPaint ( HDC hdc ){ HPEN h; // 画蝴蝶结 DrawTie ( hdc, 195, 354, RGB ( 255,0,255 ) ); // 画枝干 h = CreatePen ( PS_SOLID, 1, RGB ( 0,255,0 ) ); SelectObject ( hdc, h ); DrawLine ( hdc, 189, 372, 180, 400 )

相关知识

传教士问题c语言
C语言植物大战僵尸源码分享。#c语言 #代码 #程序代码 #
vs水仙花数c语言代码,求水仙花数c语言代码怎么写
C语言:输出所有的水仙花数
水仙花数C语言代码优化
【未来虫教育】C语言编程时90%的小伙伴常犯的17种错误!
2023年汉江师范学院普通专升本《C语言程序设计》考试大纲
元编程艺术,第 1 部分: 元编程简介
python玫瑰花代码简单
这道题是给使用C/C++语言的同学准备的。使用其他语言的同学,可能需要花点功夫思

网址: c语言编程花朵,C语言花朵代码.doc https://m.huajiangbk.com/newsview302094.html

所属分类:花卉
上一篇: 杜鹃花不是落叶植物(揭开杜鹃花的
下一篇: CC++之水仙花数