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

📄 stepmain.~pas

📁 Delphi图像盖章程序源码,供大家参考。
💻 ~PAS
📖 第 1 页 / 共 4 页
字号:
GProOption.FileName:=ShellTreeView1.Path+'\'+CheckListBox1.Items[CheckListBox1.ItemIndex];
label11.Caption:=GProOption.FileName;

tmp:=GShow_title(GProOption.FileName,'.',3);
if uppercase(GShow_title(GProOption.FileName,'.',4)) = uppercase('bmp')
   then begin
          GProOption.IBmp.LoadFromFile(GProOption.FileName);
          GProOption.IJPeg:=G_BMPToJPeg(GProOption.IBmp);
        end
   else if uppercase(GShow_title(GProOption.FileName,'.',4)) = uppercase('jpg')
           then begin
                 GProOption.IJPeg.LoadFromFile(GProOption.FileName);
                 GProOption.IBmp:=G_JPegToBMP(GProOption.IJPeg);
                end;
image2.Picture.Bitmap:=GProOption.IBmp;
         end;

end;

procedure TmainF.Button5Click(Sender: TObject);
var i:integer;
begin
for i:=0 to CheckListBox1.Items.Count-1 do
    CheckListBox1.Checked[i]:=true;

end;

procedure TmainF.RadioGroup2Click(Sender: TObject);
  Procedure closeSelete;
  begin
    panel5_1.Visible:=false;
    panel5_1.Align:=alNone;
    panel5_2.Visible:=false;
    panel5_2.Align:=alNone;
  end;
begin
  closeSelete;
  case RadioGroup2.ItemIndex of
    0:begin
    panel5_1.Visible:=true;
    panel5_1.Align:=alClient;
      end;
    2:begin
    panel5_2.Visible:=true;
    panel5_2.Align:=alClient;
      end;
  end;//case
end;

procedure TmainF.SpeedButton1Click(Sender: TObject);
begin
OpenDialog1.Filter:='标记文件(*.pho)|*.pho';
if OpenDialog1.Execute
   then if Gfileclass(OpenDialog1.FileName) = 90
           then edit1.Text:= OpenDialog1.FileName
           else edit1.Text:= '';
end;

procedure TmainF.SpeedButton2Click(Sender: TObject);
begin
     if sender = SpeedButton2
        then begin label11.Caption:='左上角';
             end
else if sender = SpeedButton3
        then begin label11.Caption:='右上角';
             end
else if sender = SpeedButton4
        then begin label11.Caption:='左下角';
             end
else if sender = SpeedButton5
        then begin label11.Caption:='右下角';
             end
else if sender = SpeedButton6
        then begin label11.Caption:='图形中点';
             end
else if sender = SpeedButton7
        then begin label11.Caption:='随机';
             end;
end;

Procedure CreateType(li:integer);
var i:integer;
    tmp:string;
begin
with mainF do
  case li of
  0:begin//位图
MReadPoint('0');
      panel6_1.Visible:=true;
      panel6_1.Align:=alClient;
      GCreatbmp(image1,4,0,image1.Width,image1.Height);
      M_Pho.Ifilename:='';
       M_address[ListBox4.ItemIndex].Ifilename:='';
       label11.Caption:='渗入位图';
    for i:=0 to high(M_address) do
      M_address[i].IAddpoint_Top:=GProOption.Point_top;
      M_address[i].IAddpoint_bott:=GProOption.Point_bott;
    end;
  1:begin//VDF
MReadPoint('1');
      panel6_2.Visible:=true;
      panel6_2.Align:=alClient;
      M_Pho.Ifilename:='';
      M_Pho.IvfdID:=-1;
      M_address[ListBox4.ItemIndex].Ifilename:='';
      M_address[ListBox4.ItemIndex].IvfdID:=-1;
      GCreatbmp(image3,4,0,image3.Width,image3.Height);
      label11.Caption:='渗入SPR矢量标准文件';
    for i:=0 to high(M_address) do
      M_address[i].IAddpoint_Top:=GProOption.Point_top;
      M_address[i].IAddpoint_bott:=GProOption.Point_bott;
    end;
  2:begin//string
      panel6_3.Visible:=true;
      panel6_3.Align:=alClient;
      edit4.Text:='';
      combobox2.Items.Clear;
      combobox2.Items.AddStrings(Screen.Fonts);
      combobox2.Text:=edit4.Font.Name;
      edit5.Text:=inttostr(edit4.Font.Size);
      combobox3.Text:=combobox3.Items[0];
      image4.Canvas.Brush.Color:=edit4.Font.Color;
      image4.Canvas.Rectangle(0,0,image4.Width,image4.Height);
for i:=0 to ListBox4.Items.Count-1 do begin
  M_address[i].mIstrBrushColor:=clred;
         M_PHO.mIstrBrushColor:=clred;
  M_address[i].mIstrBrushStyle:=bsClear;
         M_PHO.mIstrBrushStyle:=bsClear;
  M_address[i].mIstrFontName:=edit7.Font.Name;
         M_PHO.mIstrFontName:=edit7.Font.Name;
  M_address[i].mIstrFontSize:=edit7.Font.Size;
         M_PHO.mIstrFontSize:=edit7.Font.Size;
  M_address[i].mIstrFontColor:=edit7.Font.Color;
         M_PHO.mIstrFontColor:=edit7.Font.Color;
  M_address[i].Istr:='SPR army of china';
         M_PHO.Istr:='SPR army of china';
//  M_address[i].mIstrFontStyle:=
  M_address[i].IAddpoint_top:=point(20,20);
         M_PHO.IAddpoint_top:=point(20,20);
  M_address[i].IAddpoint_bott:=point(length(M_address[i].Istr),edit7.Font.Size+23);
         M_PHO.IAddpoint_bott:=point(length(M_address[i].Istr),edit7.Font.Size+23);
                                      end;

       label11.Caption:='渗入字符串';
    end;
  3:begin//date
      panel6_4.Visible:=true;
      panel6_4.Align:=alClient;
      edit7.Text:='y##m##d';
      combobox4.Items.Clear;
      combobox4.Items.AddStrings(Screen.Fonts);
      combobox4.Text:=edit7.Font.Name;
      edit5.Text:=inttostr(edit7.Font.Size);
      combobox5.Text:=combobox5.Items[0];
      image5.Canvas.Brush.Color:=edit7.Font.Color;
      image5.Canvas.Rectangle(0,0,image5.Width,image5.Height);
      DateTimePicker1.DateTime:=now;
       label11.Caption:='渗入日期';
      

tmp:=DateformatToStr(edit7.Text+'\1',datetostr(DateTimePicker1.Date));
for i:=0 to ListBox4.Items.Count-1 do begin
  M_address[i].mIstrBrushColor:=clred;
         M_PHO.mIstrBrushColor:=clred;
  M_address[i].mIstrBrushStyle:=bsClear;
         M_PHO.mIstrBrushStyle:=bsClear;
  M_address[i].mIstrFontName:=edit7.Font.Name;
         M_PHO.mIstrFontName:=edit7.Font.Name;
  M_address[i].mIstrFontSize:=edit7.Font.Size;
         M_PHO.mIstrFontSize:=edit7.Font.Size;
  M_address[i].mIstrFontColor:=edit7.Font.Color;
         M_PHO.mIstrFontColor:=edit7.Font.Color;
//  M_address[i].mIstrFontStyle:=
  M_address[i].mIdateType:=1;
         M_PHO.mIdateType:=1;
  M_address[i].mIdateformat:=edit7.Text;
         M_PHO.mIdateformat:=edit7.Text;
  M_address[i].mIdatestr:=DateTimePicker1.Date;
         M_PHO.mIdatestr:=DateTimePicker1.Date;
  M_address[i].IAddpoint_top:=point(20,20);
         M_PHO.IAddpoint_top:=point(20,20);
  M_address[i].IAddpoint_bott:=point(length(tmp)*M_address[i].mIstrFontSize+20,edit7.Font.Size+23);
         M_PHO.IAddpoint_bott:=point(length(tmp)*M_address[i].mIstrFontSize+20,edit7.Font.Size+23);
                                      end;
    end;
  end;
end;

procedure TmainF.RadioGroup3Click(Sender: TObject);
  Procedure closeSelete;
  begin
    panel6_1.Visible:=false;
    panel6_1.Align:=alNone;
    panel6_2.Visible:=false;
    panel6_2.Align:=alNone;
    panel6_3.Visible:=false;
    panel6_3.Align:=alNone;
    panel6_4.Visible:=false;
    panel6_4.Align:=alNone;
  end;
begin
closeSelete;
M_address[ListBox4.Itemindex].Itype:=RadioGroup3.ItemIndex;
M_PHO.Itype:=RadioGroup3.ItemIndex;
CreateType(RadioGroup3.ItemIndex)
end;

procedure TmainF.SpeedButton8Click(Sender: TObject);
begin
OpenPictureDialog1.Filter:='图像文件(*.bmp;*.jpg)|*.bmp;*.jpg';
if OpenPictureDialog1.Execute
   then begin
         image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
         edit2.text:=OpenPictureDialog1.FileName;
         M_PHO.Ifilename:=OpenPictureDialog1.FileName;
          M_address[ListBox4.ItemIndex].Ifilename:=OpenPictureDialog1.FileName;
        end;
end;

procedure TmainF.SpeedButton9Click(Sender: TObject);
var i:integer;
begin
OpenDialog1.Filter:='SPR矢量交换文件(*.VFD)|*.vfd';
if OpenDialog1.Execute
   then begin
  ListBox1.Items.clear;
  image3.Canvas.Brush.Color:=clWindow;
  GCreatbmp(image3,4,0,image3.Width,image3.Height);
  GProOption.DDrawFile:=OpenDialog1.FileName;
  GProOption.DDrawId:=0;

  M_PHO.Itype:=1;
    M_address[ListBox4.ItemIndex].Itype:=1;
  M_PHO.Ifilename:=GProOption.DDrawFile;
    M_address[ListBox4.ItemIndex].Ifilename:=GProOption.DDrawFile;
  edit3.Text:=M_PHO.Ifilename;
  M_PHO.IvfdID:=-1;
    M_address[ListBox4.ItemIndex].IvfdID:=-1;
  combobox1.Items.Clear;
  if GListStrings(GProOption.DDrawFile,combobox1.Items) = false
     then begin
           GProOption.DDrawFile:='';
           label11.Caption:='您选择了程序不支持的格式文件';
          end
     else combobox1.Enabled:=true;
        end;
end;

procedure TmainF.ComboBox1Change(Sender: TObject);
begin
GCreatbmp(image3,4,0,image3.Width,image3.Height);
M_PHO.IvfdID:=combobox1.ItemIndex+1;
 M_address[ListBox4.ItemIndex].IvfdID:=M_PHO.IvfdID;
GProOption.DDrawId:=M_PHO.IvfdID;
GDraw_spis(image3,GProOption.DDrawFile,GProOption.DDrawId,GFileClass(GProOption.DDrawFile),nil,nil,3,image3.Width,image3.Height);
end;

procedure TmainF.ComboBox2Change(Sender: TObject);
begin
M_PHO.mIstrFontName:=combobox2.Items[combobox2.Itemindex];
 M_address[ListBox4.ItemIndex].mIstrFontName:=combobox2.Items[combobox2.Itemindex];
edit4.Font.Name:=M_PHO.mIstrFontName;
end;

procedure TmainF.Edit5Change(Sender: TObject);
begin
M_PHO.mIstrFontSize:=strtoint(edit5.text);
 M_address[ListBox4.ItemIndex].mIstrFontSize:=strtoint(edit5.text);
edit4.Font.Size:=M_PHO.mIstrFontSize;
end;

procedure TmainF.ComboBox3Change(Sender: TObject);
begin
M_PHO.mIstrFontStyle:=strtoFontStyle(combobox3.Items[combobox3.Itemindex]);
 M_address[ListBox4.ItemIndex].mIstrFontStyle:=strtoFontStyle(combobox3.Items[combobox3.Itemindex]);
case combobox3.Itemindex of
0:edit4.Font.Style:=[fsBold];
1:edit4.Font.Style:=[fsitalic];
2:edit4.Font.Style:=[fsunderline];
3:edit4.Font.Style:=[fsstrikeout];
end;
end;

procedure TmainF.Image4MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if ColorDialog1.Execute
   then begin
          M_Pho.mIstrFontColor:=ColorDialog1.Color;
           M_address[ListBox4.ItemIndex].mIstrFontColor:=ColorDialog1.Color;
          image4.Canvas.Brush.Color:=M_Pho.mIstrFontColor;
          image4.Canvas.Rectangle(0,0,image4.Width,image4.Height);
          edit4.Font.Color:=M_Pho.mIstrFontColor;
        end;
end;

procedure TmainF.ColorGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
M_Pho.mIstrFontColor:=ColorGrid1.ForegroundColor;
  M_address[ListBox4.ItemIndex].mIstrFontColor:=ColorGrid1.ForegroundColor;
M_Pho.mIstrBrushColor:=ColorGrid1.BackgroundColor;
  M_address[ListBox4.ItemIndex].mIstrBrushColor:=ColorGrid1.BackgroundColor;

edit4.Color:=M_Pho.mIstrBrushColor;
      image4.Canvas.Brush.Color:=M_address[ListBox4.ItemIndex].mIstrFontColor;
      image4.Canvas.Rectangle(0,0,image4.Width,image4.Height);
      edit4.Font.Color:=M_address[ListBox4.ItemIndex].mIstrFontColor;
end;

procedure TmainF.Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
label11.Caption:='点击选取其它颜色';
end;

procedure TmainF.CheckBox2Click(Sender: TObject);
begin
if CheckBox2.Checked = true
   then ComboBox6.Enabled:=true
   else ComboBox6.Enabled:=false;
end;

procedure TmainF.Edit4Change(Sender: TObject);
begin
M_PHO.Istr:=edit4.Text;
 M_address[ListBox4.ItemIndex].Istr:=edit4.Text;
end;

procedure TmainF.CheckBox3Click(Sender: TObject);
begin
if CheckBox3.Checked
   then begin
         M_PHO.mIstrBrushStyle:=bsSolid;
          M_address[ListBox4.ItemIndex].mIstrBrushStyle:=bsSolid;
         edit4.Color:=M_address[ListBox4.ItemIndex].mIstrBrushColor;
        end
   else begin
         M_PHO.mIstrBrushStyle:=bsClear;
           M_address[ListBox4.ItemIndex].mIstrBrushStyle:=bsClear;
         edit4.Color:=clwindow;
        end;
end;

procedure TmainF.CheckBox4Click(Sender: TObject);
begin
if CheckBox4.Checked
   then begin
          M_PHO.mIstrBrushStyle:=bsSolid;
           M_address[ListBox4.ItemIndex].mIstrBrushStyle:=bsSolid;
          edit7.Color:=M_address[ListBox4.ItemIndex].mIstrBrushColor;
        end
   else begin
          M_PHO.mIstrBrushStyle:=bsClear;
            M_address[ListBox4.ItemIndex].mIstrBrushStyle:=bsClear;
          edit7.Color:=clwindow;
        end;
end;

procedure TmainF.Edit7Change(Sender: TObject);
begin
M_PHO.mIdateformat:=edit7.Text;
  M_address[ListBox4.ItemIndex].mIdateformat:=edit7.Text;
M_address[ListBox4.ItemIndex].IAddpoint_bott.x:=edit7.Font.Size*length(edit7.Text);
M_address[ListBox4.ItemIndex].IAddpoint_bott.y:=edit7.Font.Height;
end;

procedure TmainF.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked
   then M_PHO.mIdateType:=1
   else M_PHO.mIdateType:=0;
M_address[ListBox4.ItemIndex].mIdateType:=M_PHO.mIdateType
end;

procedure TmainF.ListBox2MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var tmp:string;
begin
if ListBox2.ItemIndex >-1
  then begin
GProOption.IJPeg.Free;
GProOption.IBmp.Free;
GProOption.IJPeg := TJPegImage.Create;
GProOption.IBmp := TBitmap.Create;

GProOption.FileName:=ShellTreeView1.Path+'\'+ListBox2.Items[ListBox2.ItemIndex];
label11.Caption:=GProOption.FileName;

⌨️ 快捷键说明

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