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

📄 unit5.cpp

📁 本书《C++Builder与WindowsAPI经典范例》附含配套光盘包括132个WindowsAPI函数及206个完整、可执行的实例
💻 CPP
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
//用Bitmap代理Image1,
//程序撰写时,较易阅读连贯
Bitmap = Image1->Picture->Bitmap;
//隐藏Image1
Image1->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
//将Form1长宽范围列为失效范围,
//即引发WM_ERASEBKGND信息,而进行重绘
::InvalidateRect(Handle, NULL, true);
}
//---------------------------------------------------------------------------
//WM_ERASEBKGND信息
void __fastcall TForm1::WMEraseBkgnd(TMessage &Msg)
{
//将其它信息分流出去
TForm::Dispatch(&Msg);
//取得系统中标题高度
int CaptionHeight = ::GetSystemMetrics(SM_CYCAPTION);
//取得Form1的DC handle
HDC HWindowDC = ::GetWindowDC(Handle);
//将图像依照Form1标题长宽,变形+变色绘制至Form1标题上

⌨️ 快捷键说明

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