Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- HPEN pen;
- TPoint po;
- HDC ddc;
- ddc=GetDC(GroupBox1->Handle);
- BitBlt(ddc,0,0,GroupBox1->Width,GroupBox1->Height,Image1->Picture->Bitmap->Canvas->Handle,0,0,SRCCOPY);
- MoveToEx(ddc,5,5,&po);
- LineTo(ddc,GroupBox1->Width-5,5);
- LineTo(ddc,GroupBox1->Width-5,GroupBox1->Height-5);
- LineTo(ddc,5,GroupBox1->Height-5);
- LineTo(ddc,5,5);
- pen=CreatePen(0,1,0x00ffffff);
- SelectObject(ddc,pen);
- MoveToEx(ddc,6,6,&po);
- LineTo(ddc,GroupBox1->Width-4,6);
- LineTo(ddc,GroupBox1->Width-4,GroupBox1->Height-4);
- LineTo(ddc,6,GroupBox1->Height-4);
- LineTo(ddc,6,6);
- TextOut(ddc,10,0,GroupBox1->Caption.c_str(),GroupBox1->Caption.Length());
- }
- //---------------------------------------------------------------------------