Welcome![Sign In][Sign Up]
Location:
Search - gdiplusstartup

Search list

[GDI-BitmapGdiplusStartup

Description: GDIPlus学习的起步程序实例!适用于初学编程或第一次接触GDI+的程序员朋友!-GDIPlus learning process started examples! Programming applicable to beginners or first contact GDI programmer friends!
Platform: | Size: 39547 | Author: 李天顺 | Hits:

[GDI-BitmapGdiplusStartup

Description: GDIPlus学习的起步程序实例!适用于初学编程或第一次接触GDI+的程序员朋友!-GDIPlus learning process started examples! Programming applicable to beginners or first contact GDI programmer friends!
Platform: | Size: 2373632 | Author: 李天顺 | Hits:

[GDI-BitmapGDI Bitmap C++ Code

Description: #include <Windows.h> #include <gdiplus.h> using namespace Gdiplus; // Forward declarations LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // Initialize GDI+ GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); // Create the window WNDCLASSEX wcex = { 0 }; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.hInstance = hInstance; wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wcex.lpszClassName = L"MyWindowClass"; RegisterClassEx(&wcex); HWND hWnd = CreateWindow(L"MyWindowClass", L"My Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); // Run the message loop MSG msg = { 0 }; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } // Shutdown GDI+ GdiplusShutdown(gdiplusToken); return (int)msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, &ps); // Create a Bitmap object and draw a line on it Bitmap bmp(100, 100); Graphics g(&bmp); Pen pen(Color(255, 0, 0, 0)); // Red pen g.DrawLine(&pen, 0, 0, 99, 99); // Draw the bitmap on the window Graphics graphics(hdc); graphics.DrawImage(&bmp, 0, 0); EndPaint(h
Platform: | Size: 402171 | Author: khaledmagd73@gmail.com | Hits:

CodeBus www.codebus.net