?? unit1.cpp
字號:
{
if(bForm2Null[iActForm2])
return;
Form11=new TForm11(this);
Form11->ShowModal();
if(iReturnValue)
fForm2Array[iActForm2]->f_imageEmbossProcess();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N40Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
Form12=new TForm12(this);
Form12->ShowModal();
if(iReturnValue)
fForm2Array[iActForm2]->f_imageSpreadProcess();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N43Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageBinaryProcess();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
if((Panel2->Width>=Panel1->Width-110)&&Panel3->Visible==false&&Panel4->Visible==false )
Panel2->Left=120;
else if((Panel2->Width>=Panel1->Width-110)&&Panel3->Visible==true)
Panel2->Left=124+Panel3->Width;
else if((Panel2->Width>=Panel1->Width-110)&&Panel4->Visible==true)
Panel2->Left=124+Panel4->Width;
else
Panel2->Left=Panel1->Width - 334;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Shape1MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if (ColorDialog1->Execute())
{
tGraphColor=ColorDialog1->Color;
Shape1->Brush->Color=tGraphColor;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Shape2MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if (ColorDialog1->Execute())
{
tBrushColor=ColorDialog1->Color;
Shape2->Brush->Color=tBrushColor;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox1Click(TObject *Sender)
{
if(CheckBox1->Checked)
{
bIsTransparence=true;
Form3->SpeedButton5->Glyph->LoadFromResourceName((int)HInstance,"AB_RNULL");
Form3->SpeedButton3->Glyph->LoadFromResourceName((int)HInstance,"AB_ENULL");
}
else
{
Form3->SpeedButton5->Glyph->LoadFromResourceName((int)HInstance,"AB_RBRUSH");
Form3->SpeedButton3->Glyph->LoadFromResourceName((int)HInstance,"AB_EBRUSH");
bIsTransparence=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit1Change(TObject *Sender)
{
iGraphThick=StrToInt(Edit1->Text);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::About1Click(TObject *Sender)
{
Form14=new TForm14(this);
Form14->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N1801Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageRotateProcess(1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N56Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageRotateProcess(2);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N57Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageRotateProcess(3);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Shape3MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if (ColorDialog1->Execute())
{
tGroundColor=ColorDialog1->Color;
Shape3->Brush->Color=tGroundColor;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N52Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageClear(1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N50Click(TObject *Sender)
{
if(bForm2Null[iActForm2]||iGraphStyle!=1)
return;
fForm2Array[iActForm2]->f_imageClear(0);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N2Click(TObject *Sender)
{
int i;
Form15=new TForm15(this);
Form15->ShowModal();
if(!iReturnValue)
return;
rnew.Left=0;
rnew.Top=0;
rnew.Right=iNewWidth;
rnew.Bottom=iNewHeight;
Shape3->Brush->Color=tGroundColor;
sFileName="新建";
bImagetemp->Width=iNewWidth;
bImagetemp->Height=iNewHeight;
bImagetemp->Canvas->Brush->Color=tGroundColor;
bImagetemp->Canvas->FillRect(rnew);
f_CreatePalette();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N63Click(TObject *Sender)
{
bFullCopy=false;
Form16 = new TForm16(this);
Form16->ShowModal();
if(!iReturnValue)
return;
f_CopyScreen();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N62Click(TObject *Sender)
{
bFullCopy=true;
Form16 = new TForm16(this);
Form16->ShowModal();
if(!iReturnValue)
return;
f_CopyScreen();
}
//---------------------------------------------------------------------------
void TForm1::f_CopyScreen()
{
int i;
if(iCopyDestop<10)
{
this->WindowState=wsMaximized;
this->WindowState=wsMinimized;
Sleep(100);
}
if(iCopyDestop==2||iCopyDestop==12)
{
Screen->Cursor=crCross;
Form17->ShowModal();
Sleep(200);
}
else
{
pProcessBegin.x=pProcessBegin.y=0;
pProcessEnd.x=Screen->Width;
pProcessEnd.y=Screen->Height;
}
if(iCopyDestop<10)
this->WindowState=wsMinimized;
iNewWidth=pProcessEnd.x-pProcessBegin.x;
iNewHeight=pProcessEnd.y-pProcessBegin.y;
HDC hdc =::GetDC(0);
delete bImagetemp;
bImagetemp = new Graphics::TBitmap();
bImagetemp->Handle = ::CreateCompatibleBitmap( hdc, iNewWidth, iNewHeight);
::BitBlt(bImagetemp->Canvas->Handle, 0, 0,
iNewWidth, iNewHeight,hdc, pProcessBegin.x, pProcessBegin.y, SRCCOPY);
sFileName="截屏";
f_CreatePalette();
if(iCopyDestop<10)
this->WindowState=wsNormal;
if(iCopyDestop==2||iCopyDestop==12)
Screen->Cursor = crDefault;
}
void __fastcall TForm1::N48Click(TObject *Sender)
{
if(bForm2Null[iActForm2]||iGraphStyle!=1)
return;
fForm2Array[iActForm2]->f_imageCopy(pProcessBegin.x,pProcessBegin.y,pProcessEnd.x-pProcessBegin.x,pProcessEnd.y-pProcessBegin.y);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton1Click(TObject *Sender)
{
if(iGraphStyle==100)
return;
if(RadioButton1->Checked)
iGraphStyle=100;
setcur(12);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton2Click(TObject *Sender)
{
if(iGraphStyle==101)
return;
if(RadioButton2->Checked)
iGraphStyle=101;
setcur(13);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
N17Click(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
{
N2Click(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton3Click(TObject *Sender)
{
N3Click(Sender);
}
//---------------------------------------------------------------------------
void TForm1::f_SetForm2ChooseFalse()
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->Shape1->Visible=false;
pProcessBegin.x=0;
pProcessBegin.y=0;
pProcessEnd.x=fForm2Array[iActForm2]->lPicWidth;
pProcessEnd.y=fForm2Array[iActForm2]->lPicHeight;
}
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
if(ComboBox1->ItemIndex==0)
iPointRange=0;
else if(ComboBox1->ItemIndex==1)
iPointRange=1;
else if(ComboBox1->ItemIndex==2)
iPointRange=2;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N49Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->Image2->Picture->Bitmap->Assign(Form1->Image1->Picture->Bitmap);
fForm2Array[iActForm2]->Image2->Left=0;
fForm2Array[iActForm2]->Image2->Top=0;
fForm2Array[iActForm2]->Image2->Visible=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N59Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_iamgePaste();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N65Click(TObject *Sender)
{
lCopyStyle=SRCCOPY;
N65->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N66Click(TObject *Sender)
{
lCopyStyle=NOTSRCCOPY;
N66->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OR1Click(TObject *Sender)
{
lCopyStyle=MERGEPAINT;
OR1->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OR3Click(TObject *Sender)
{
lCopyStyle=SRCPAINT;
OR3->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OR2Click(TObject *Sender)
{
lCopyStyle=NOTSRCERASE;
OR2->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::AND1Click(TObject *Sender)
{
lCopyStyle=SRCERASE;
AND1->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::XOR1Click(TObject *Sender)
{
lCopyStyle=SRCINVERT;
XOR1->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N42Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
int i,j;
iTNum=4;
for(i=0;i<4;i++)
for(j=0;j<4;j++)
iTemplate[i][j]=1;
fForm2Array[iActForm2]->f_imageSmoothProcess(5);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N38Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
int i,j;
iTNum=4;
for(i=0;i<4;i++)
for(j=0;j<4;j++)
iTemplate[i][j]=1;
fForm2Array[iActForm2]->f_imageSmoothProcess(6);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N68Click(TObject *Sender)
{
iMASAIKE=3;
N68->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N69Click(TObject *Sender)
{
iMASAIKE=4;
N69->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N70Click(TObject *Sender)
{
iMASAIKE=5;
N70->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N39Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
Form19=new TForm19(this);
Form19->ShowModal();
if(iReturnValue)
fForm2Array[iActForm2]->f_imageExposureProcess(iExposureColor);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N45Click(TObject *Sender)
{
if(FileExists(helpadd))
ShellExecute (0, "open",helpadd.c_str(), "", "", SW_SHOWNORMAL);
else
MessageBox(NULL,"錯誤:幫助文件找不到","打開幫助失敗",MB_OK);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N55Click(TObject *Sender)
{
if(bForm2Null[iActForm2])
return;
fForm2Array[iActForm2]->f_imageAllChoose(true);
}
//---------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -