📄 splash.c
字号:
/* ** $Id: splash.c,v 1.11 2005/02/18 08:31:12 lihong Exp $**** The splash window of minigui presentation**** Copyright (C) 2004 Feynman Software.**** Create date: 2004/07/20*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <locale.h>#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>#include <minigui/control.h>#include "global.h"//static BITMAP bmp_minigui2;static DLGTEMPLATE DlgSplash ={ WS_VISIBLE, WS_EX_NONE, 0, 0, 320, 240, "", 0, 0, 0, NULL, 0};/*static CTRLDATA SplashCtrls [] ={ {},};*/#define ID_TIMERUPDATE 111static gal_pixel pixel;static Uint8 r1, g1, b1;static Uint8 r2, g2, b2;//static double dr, dg, db;static int flag = 0;static int flag1 = 0;static int step;static int curstep = 0;static void getNextRGB (Uint8 *r, Uint8 *g, Uint8 *b){ switch (flag1) { case 0: *g = g1; *b = b1; *r = curstep; break; case 1: *r = r1; *b = b1; *g = curstep; break; case 2: *r = r1; *g = g1; *b = curstep; break; } if (flag == 0) { curstep ++; if (curstep == 255) flag =1; } else { curstep --; if (curstep == step) flag =0; }}static intSplashDialogBoxProc (HWND hDlg, int message, WPARAM wParam, LPARAM lParam){ RECT rc1 = {200, 8, 320, 30}; switch (message) { case MSG_INITDIALOG: SetTimer (hDlg, ID_TIMERUPDATE, 1); pixel = GetPixelInBitmap (bmp_minigui2, 180, 5); Pixel2RGB(HDC_SCREEN, pixel, &r1, &g1, &b1); if (r1 <= g1 && r1 <= b1) { flag1 = 0; step = r1; } if (g1 <= r1 && g1 <= b1) { flag1 = 1; step = g1; } if (b1 <= g1 && b1 <= r1) { flag1 = 2; step = b1; } curstep = step; break; case MSG_TIMER: InvalidateRect (hDlg, &rc1, TRUE); break; case MSG_LBUTTONDOWN: KillTimer (hDlg, ID_TIMERUPDATE); EndDialog (hDlg, wParam); return 0; case MSG_PAINT: { HDC hdc = BeginPaint (hDlg); FillBoxWithBitmap (hdc, 0, 0, 0, 0, bmp_minigui2); SetBkMode (hdc, BM_TRANSPARENT); getNextRGB (&r2, &g2, &b2); SetTextColor (hdc, RGB2Pixel (HDC_SCREEN, r2, g2, b2));#ifdef MGDEMO_ENGLISH
TextOut (hdc, 200, 8, "Click to enter...");
#else
TextOut (hdc, 220, 8, "点击进入...");
#endif
EndPaint (hDlg, hdc); return 0; } } return DefaultDialogProc (hDlg, message, wParam, lParam);}void create_splash_window (void){ //LoadBitmapFromFile (HDC_SCREEN, &bmp_minigui2, "res/minigui2.gif"); DlgSplash.controls = NULL;//SplashCtrls; DialogBoxIndirectParam (&DlgSplash, HWND_DESKTOP, SplashDialogBoxProc, 0L);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -