⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitblt.c

📁 miniGUI最新版本增加了许多功能
💻 C
字号:
/*** $Id: bitblt.c,v 1.10 2007-08-30 01:20:10 xwyan Exp $**** Listing 15.1**** bitblt.c: Sample program for MiniGUI Programming Manual**     demonstration of BitBlt operation**** Copyright (C) 2004 ~ 2007 Feynman Software.**** License: GPL*/#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>static int BitbltWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam){    HDC hdc;    int x, y;    switch (message) {    case MSG_PAINT:        hdc = BeginPaint (hWnd);        SetBrushColor (hdc, PIXEL_blue);#ifdef _USE_NEWGAL        FillCircle (hdc, 10, 10, 8);#else        FillBox (hdc, 2, 2, 16, 16);#endif        for (y = 0; y < 240; y += 20) {            for (x = 0; x < 320; x += 20) {                BitBlt (hdc, 0, 0, 20, 20, hdc, x, y, 0);            }        }        EndPaint (hWnd, hdc);        return 0;    case MSG_CLOSE:        DestroyAllControls (hWnd);        DestroyMainWindow (hWnd);        PostQuitMessage (hWnd);        return 0;    }    return DefaultMainWinProc (hWnd, message, wParam, lParam);}int MiniGUIMain (int args, const char* arg[]){    MSG Msg;    HWND hMainWnd;    MAINWINCREATE CreateInfo;#ifdef _MGRM_PROCESSES    JoinLayer(NAME_DEF_LAYER , "bitblt" , 0 , 0);#endif        CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;    CreateInfo.dwExStyle = WS_EX_NONE;    CreateInfo.spCaption = "BitBlt demo";    CreateInfo.hMenu = 0;    CreateInfo.hCursor = GetSystemCursor(0);    CreateInfo.hIcon = 0;    CreateInfo.MainWindowProc = BitbltWinProc;    CreateInfo.lx = 0;    CreateInfo.ty = 0;    CreateInfo.rx = 320;    CreateInfo.by = 240;    CreateInfo.iBkColor = COLOR_lightwhite;    CreateInfo.dwAddData = 0;    CreateInfo.hHosting = HWND_DESKTOP;        hMainWnd = CreateMainWindow (&CreateInfo);        if (hMainWnd == HWND_INVALID)        return -1;    ShowWindow(hMainWnd, SW_SHOWNORMAL);    while (GetMessage(&Msg, hMainWnd)) {        TranslateMessage(&Msg);        DispatchMessage(&Msg);    }    MainWindowThreadCleanup (hMainWnd);    return 0;}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -