숙제는 스스로... 쩝...
김준석 님이 쓰신 글 :
:
:
: //---------------------------------------------------------------------------
:
: #include
: #pragma hdrstop
:
: #include "Unit1.h"
: //---------------------------------------------------------------------------
: #pragma package(smart_init)
: #pragma link "CGRID"
: #pragma resource "*.dfm"
: TForm1 *Form1;
: //---------------------------------------------------------------------------
: __fastcall TForm1::TForm1(TComponent* Owner)
: : TForm(Owner)
: {
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::FormCreate(TObject *Sender)
: {
: Image1->Picture->Bitmap->Height = 305;
: Image1->Picture->Bitmap->Width = 320;
: ListBox1->ItemIndex = 0;
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::Image1MouseMove(TObject *Sender, TShiftState Shift,
: int X, int Y)
: {
: if(Shift.Contains(ssLeft))
: Image1->Picture->Bitmap->Canvas->LineTo(X,Y);
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::Image1MouseDown(TObject *Sender,
: TMouseButton Button, TShiftState Shift, int X, int Y)
: {
: Image1->Picture->Bitmap->Canvas->Pen->Color= CColorGrid1->ForegroundColor;
: Image1->Picture->Bitmap->Canvas->Pen->Width=ListBox1->ItemIndex+1;
: Image1->Picture->Bitmap->Canvas->MoveTo(X,Y);
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::Button1Click(TObject *Sender)
: {
: if (SaveDialog1->Execute())
: Image1->Picture->Bitmap->SaveToFile(SaveDialog1->FileName);
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::Button2Click(TObject *Sender)
: {
: if (OpenPictureDialog1->Execute()){
:
: Image1->Picture->LoadFromFile("OpenPictureDialog1->GetNamePath()");
:
: }
: }
: //---------------------------------------------------------------------------
:
:
:
: 파일 불러와서 낙서 하기 기능이랑
: 네모 그리기
: 그리고 원 그리기 하고싶습니다 .
|