首页 分享 C语言花朵代码.docx

C语言花朵代码.docx

来源:花匠小妙招 时间:2025-12-11 11:45

. C 语言——绘画花朵 代码部分 #include windows.h #include math.h #define PI3LRESULT 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 ); DrawLine ( hdc, 310, 160, 325,68 ); DrawLine ( hdc, 310, 160, 187, 374 ); DrawLine ( hdc, 150, 140, 189, 374 ); DrawLine ( hdc, 430, 176, 190, 374 ); DrawLine ( hdc, 370, 110, 187, 374 ); DrawLine ( hdc, 250,72, 189, 372 ); DrawLine ( hdc, 253, 192, 190, 374 ); Dra

相关知识

c语言编程花朵,C语言花朵代码.doc
写一个C语言代码测量土壤湿度
C语言情人节玫瑰花代码
C语言烟花代码,C语言实现烟花表白代码
c语言粉红色的电脑字母代码,玫瑰花c语言代码
c语言爱心代码简单教程(玫瑰花代码编程python)
vs水仙花数c语言代码,求水仙花数c语言代码怎么写
c 语言表白代码玫瑰怎么写 – PingCode
用c语言画一朵玫瑰花代码
C语言植物大战僵尸源码分享。#c语言 #代码 #程序代码 #

网址: C语言花朵代码.docx https://www.huajiangbk.com/newsview2499797.html

所属分类:花卉
上一篇: 【scratch3.0教程】2.
下一篇: 火花编程app最新版下载

推荐分享