文件名称:GDI Bitmap C++ Code

  • 所属分类:
  • GDI/图象编程
  • 资源属性:
  • [HTML]
  • 上传时间:
  • 2022-12-27
  • 文件大小:
  • 392.75kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • khaledmagd73@gmail.com
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

#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

(系统自动生成,下载前可以参看下载内容)

下载文件列表

压缩包 : GDI Bitmap C++ Code.rar 列表
GDI Bitmap C++ Code/GDI Bitmap C++ Code.html
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/088766228320cfd63d72d0a530e13e3e.png
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/221-198e8bdb69b09c62.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/2802bd5f-a31531b9d6706608.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/361-032f8620609ea5a4.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/400-ec71a8591468928c.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/424-7f7835d330adbaab.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/440-f9acf562f7bccc4f.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/606-9f400c2ac8262f3b.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/650-1b593574ccff91da.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/68a27ff6-21204d8ed6fd05d7.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/dde4e452-3591ea0c0fd388f8.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/fa06302711171599.css
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/framework-7a789ee31d2a7534.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/main-149b337e061b4d04.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/polyfills-c67a75d1b6f99dc8.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/saved_resource.html
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/webpack-3802b16f68ae4203.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/[[...chatId]]-4b9a792c76abb4ab.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/_app-3d9acfc3a5472af2.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/_buildManifest.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files/_ssgManifest.js.download
GDI Bitmap C++ Code/GDI Bitmap C++ Code_files
GDI Bitmap C++ Code

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org