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

📄 t_course.pas

📁 Delphi图像盖章程序源码,供大家参考。
💻 PAS
📖 第 1 页 / 共 3 页
字号:
      //Im.Align:= alClient;
      Bitmap := TBitmap.Create;
      Bitmap.Width := im.Width;
      Bitmap.Height := im.Height;
//      SaveStyles;
      Im.Picture.Graphic := Bitmap;
//      RestoreStyles;
//      CurrentFile := EmptyStr;
Bitmap.free;
  end;
3:begin
im.Align:=alNone;
im.Top:=20;
im.Width:=round(21*32);
im.Height:=round(29.7*32);
//if im.Width > Mwidth
//   then im.Left:=(Mwidth - im.Width) div 2 - 20
//   else im.Left:=(Mwidth - im.Width) div 2;

//    ActiveControl := Edit1.text;
      Bitmap := TBitmap.Create;
      Bitmap.Width := im.Width;
      Bitmap.Height := im.Height;
//      SaveStyles;
      Im.Picture.Graphic := Bitmap;
//      RestoreStyles;
//      CurrentFile := EmptyStr;
result:=inttostr(im.Width+40)+','+inttostr(im.Height+40);
Bitmap.free;
   end;//3
4:begin
//im.Align:=alNone;
//im.Left:=(Mwidth - Tmp_width) div 2;
//    ActiveControl := Edit1.text;
      Bitmap := TBitmap.Create;
      Bitmap.Width :=Tmp_width;
      im.Width:=Tmp_width;
      Bitmap.Height := Tmp_height;
      im.Height:=Tmp_height;
//      SaveStyles;
      Im.Picture.Graphic := Bitmap;
//      RestoreStyles;
//      CurrentFile := EmptyStr;
Bitmap.free;
   end;//4
5:begin
      Bitmap := TBitmap.Create;
      Bitmap.Width :=Tmp_width;
      im.Width:=Tmp_width;
im.Left:=Mwidth;
im.top:=Mwidth;
      Bitmap.Height := Tmp_height;
      im.Height:=Tmp_height;
      Im.Picture.Graphic := Bitmap;
Bitmap.free;//左上距离相同
  end;
6:begin
      Bitmap := TBitmap.Create;
      Bitmap.Width :=Tmp_width;
      im.Width:=Tmp_width;
im.Left:=Mwidth;
      Bitmap.Height := Tmp_height;
      im.Height:=Tmp_height;
      Im.Picture.Graphic := Bitmap;
Bitmap.free;
  end;//left距离
7:begin
      Bitmap := TBitmap.Create;
      Bitmap.Width :=Tmp_width;
      im.Width:=Tmp_width;
im.top:=Mwidth;
      Bitmap.Height := Tmp_height;
      im.Height:=Tmp_height;
      Im.Picture.Graphic := Bitmap;
Bitmap.free;
  end;//top距离
8:im.left:=Mwidth;
9:im.top:=Mwidth;
10:begin
    im.left:=Mwidth;
    im.top:=Mwidth;
   end;
end;//case

end;


procedure GStandard(IM:Timage;width,penwidth:integer;color:Tcolor;li:integer);
var h:integer;
    OldPen:integer;
    OldColor:TColor;
begin
OldColor:=Im.Canvas.Pen.Color;
OldPen:=Im.Canvas.Pen.Width;

Im.Canvas.Pen.Color:=color;
Im.Canvas.Pen.Width:=penwidth;
case li of
1:begin
h:=0;
while  h < Im.Height do
   begin
Im.Canvas.moveto(0,h);
Im.Canvas.lineto(Im.Width,h);
h:=h+width;
       end;
h:=0;
while h < Im.Width do
    begin
Im.Canvas.moveto(h,0);
Im.Canvas.lineto(h,Im.Height);
h:=h+Width;
    end;
  end;
2:begin
h := Im.Height div 2;
Im.Canvas.moveto(0,h);
Im.Canvas.lineto(Im.Width,h);

h := Im.Width div 2;
Im.Canvas.moveto(h,0);
Im.Canvas.lineto(h,Im.Height);
  end;
end;//case
Im.Canvas.Pen.Width:=OldPen;
Im.Canvas.Pen.Color:=OldColor;
end;

function SPIStoCourse(Arrpoint:string;im:Timage):string;
var tmp:string;
begin
//dtfillpoly2:  @clBlack<1>psSolid"clBlack%bsSolid.
tmp:='@'+T_Course.Gshow_title(Arrpoint,'@',4);
T_Course.DrawingTool:=StrtoDraw(T_Course.Gshow_title(Arrpoint,':',3));
im.Canvas.Pen.Color:=StringToColor(T_Course.Gshow_title(T_Course.Gshow_title(tmp,'@',4),'<',3));
im.Canvas.Pen.Width:=round(strtoint(T_Course.Gshow_title(T_Course.Gshow_title(tmp,'<',4),'>',3))*M_li);
im.Canvas.Pen.Style:=StrToPenStyles(T_Course.Gshow_title(T_Course.Gshow_title(tmp,'>',4),'"',3));
im.Canvas.Brush.Color:=StringToColor(T_Course.Gshow_title(T_Course.Gshow_title(tmp,'"',4),'%',3));
im.Canvas.Brush.Style:=StrtoBrushStyles(T_Course.Gshow_title(T_Course.Gshow_title(tmp,'%',4),'.',3));

result:=T_Course.Gshow_title(T_Course.Gshow_title(ArrPoint,':',4),'@',3);
end;

function GPointMoveto(str,data:string;im:Timage;li:integer):string;
var tmp,strs:string;
    i,mx,my:integer;
    tmppoint,P1,P2:Tpoint;
begin
p1.x:=strtoint(T_Course.Gshow_title(data,',',3));
  data:=T_Course.Gshow_title(data,',',4);
p1.y:=strtoint(T_Course.Gshow_title(data,';',3));
  data:=T_Course.Gshow_title(data,';',4);
p2.x:=strtoint(T_Course.Gshow_title(data,',',3));
  data:=T_Course.Gshow_title(data,',',4);
p2.y:=strtoint(T_Course.Gshow_title(data,';',3));
case li of
1:T_Course.Gcreatbmp(im,4,0,p2.x-p1.x,p2.y-p1.y);
end;

mx:=p1.X;
my:=p1.Y;

tmp:='';
strs:=str;
str:=T_Course.Gshow_title(T_Course.Gshow_title(str,':',4),'@',3);

for i:=1 to strtoint(Gshow_title(str,';',6)) do begin
  tmppoint.X:=strtoint(T_Course.Gshow_title(T_Course.Gshow_title(str,';',3),',',3));
  tmppoint.Y:=strtoint(T_Course.Gshow_title(T_Course.Gshow_title(str,';',3),',',4));
  tmp:=tmp+inttostr(round(tmppoint.X-mx))+','+inttostr(round(tmppoint.Y-my))+';';
  str:=Gshow_title(str,';',4);
                   end;
tmp:=Gshow_title(strs,':',3)+':'+tmp+'@'+T_Course.Gshow_title(strs,'@',4);
result:=tmp;
end;

function GListToStrSPIS(listbox:Tlistbox;top,butt:integer):ansistring;
var i:integer;
    tmp:string;
begin
tmp:='';
for i:=top to butt do begin
if trim(listbox.Items[i])<>''
  then
    if uppercase(GShow_title(listbox.Items[i],';',5)) = uppercase('false')
       then tmp:=tmp+GShow_title(listbox.Items[i],',',3)+','+GShow_title(listbox.Items[i],',',4)+';'
       else tmp:=tmp+GShow_title(listbox.Items[i],',',3)+','+GShow_title(GShow_title(listbox.Items[i],',',4),';',3)+';'
                                     end;
result:=tmp
end;

function GListPoint(st:Tpoint;listPoint:string;warp:integer):integer;
var add:integer;
    tmp:Tpoint;
begin
add:=0;
result:=-1;
while trim(listpoint)<>'' do begin
tmp:=point(strtoint(GShow_title(GShow_title(listpoint,';',3),',',3)),
           strtoint(GShow_title(GShow_title(listpoint,';',3),',',4)));
if sqrt((sqr(abs(tmp.x - st.x)))+ (sqr(abs(tmp.Y - st.y)))) <= warp
   then begin
         result:=add;
         break;
        end;
listpoint:=GShow_title(listpoint,';',4);
add:=add+1;
                             end;
end;

function GListPointII(st:Tpoint;listPoint:Tlistbox;warp:integer):integer;
var i:integer;
    tmp:Tpoint;
begin
result:=0;
for i:=0 to listPoint.items.count-1 do begin
if trim(listpoint.Items[i]) <> ''
  then begin
        if GShow_title(listpoint.Items[i],';',5) = 'false'
           then listpoint.Items[i]:=listpoint.Items[i]+';';
        tmp:=point(strtoint(GShow_title(GShow_title(listpoint.Items[i],';',3),',',3)),
                   strtoint(GShow_title(GShow_title(listpoint.Items[i],';',3),',',4)));
        if sqrt((sqr(abs(tmp.x - st.x)))+ (sqr(abs(tmp.Y - st.y)))) <= warp
           then begin
                 result:=i;
                 break;
                end;
       end;//if
                                       end;//for
end;


function GRectBoundPoint(Top,bottom:Tpoint;aim:TPoint):boolean;
begin
result:=false;
if (aim.X>top.X)and
   (aim.X<bottom.X)and
   (aim.Y>top.Y)and
   (aim.Y<bottom.Y)
   then result:=True;
end;

Function GPointEstimate_Str(listPoint:string):string;
var maxPoint,minPoint:Tpoint;
    str:ansistring;
    arrPoint:array of Tpoint;
    i:integer;
begin
str:=listPoint;
setlength(arrPoint,strtoint(GShow_title(str,';',6)));
for i:=0 to strtoint(GShow_title(str,';',6))-1 do begin
 arrPoint[i].x:=strtoint(GShow_title(str,',',3));
 arrPoint[i].y:=strtoint(GShow_title(GShow_title(str,';',3),',',4));
 str:=GShow_title(str,';',4);

                                                      end;
maxPoint:=arrPoint[0];
minPoint:=arrPoint[0];
for i:=1 to length(arrPoint)-1 do begin
  if arrPoint[i].x > maxPoint.X
     then maxPoint.X:=arrPoint[i].x;
  if arrPoint[i].x < minPoint.X
     then minPoint.X:=arrPoint[i].x;
  if arrPoint[i].y > maxpoint.Y
     then maxpoint.Y:=arrPoint[i].y;
  if arrPoint[i].y < minPoint.Y
     then minPoint.Y:=arrPoint[i].y;
                                end;

result:=inttostr(minPoint.X)+','+inttostr(minPoint.y)+';'+
        inttostr(maxPoint.X)+','+inttostr(maxPoint.Y)+';';
end;

Function GPointEstimate_Point(listPoint:string;li:integer):TPoint;
var maxPoint,minPoint:Tpoint;
    str:ansistring;
    arrPoint:array of Tpoint;
    i:integer;
begin
str:=listPoint;
setlength(arrPoint,strtoint(GShow_title(str,';',6)));
for i:=0 to strtoint(GShow_title(str,';',6))-1 do begin
 arrPoint[i].x:=strtoint(GShow_title(str,',',3));
 arrPoint[i].y:=strtoint(GShow_title(GShow_title(str,';',3),',',4));
 str:=GShow_title(str,';',4);

                                                      end;
maxPoint:=arrPoint[0];
minPoint:=arrPoint[0];
for i:=1 to length(arrPoint)-1 do begin
  if arrPoint[i].x > maxPoint.X
     then maxPoint.X:=arrPoint[i].x;
  if arrPoint[i].x < minPoint.X
     then minPoint.X:=arrPoint[i].x;
  if arrPoint[i].y > maxpoint.Y
     then maxpoint.Y:=arrPoint[i].y;
  if arrPoint[i].y < minPoint.Y
     then minPoint.Y:=arrPoint[i].y;
                                end;

case li of
1:result:=minPoint;
2:result:=maxPoint;
end;
end;


function GPointEstimate_1(im:Timage;list:Tlistbox;li:integer):String;
var tmp,max1,max2,max3,max4:Tpoint;
    i,j,SUM:integer;
    str:ansistring;
begin
max1:=point(im.Width,im.Height);
max2:=point(0,im.Height);
max3:=point(im.Width,0);
max4:=point(0,0);

for j:=0 to list.Items.Count-1 do begin
  str:=Gshow_title(Gshow_title(list.Items[j],':',4),'@',3);

sum:=strtoint(Gshow_title(str,';',6));

for i:=1 to sum do begin
 if trim(str) <> '' then begin
tmp.X:=strtoint(GShow_title(GShow_title(str,';',3),',',3));
tmp.Y:=strtoint(GShow_title(GShow_title(str,';',3),',',4));
                         end;
   if sqrt(sqr(tmp.X-0)+sqr(tmp.Y-0))*1000<sqrt(sqr(max1.X-0)+sqr(max1.Y-0))*1000
      then max1:=tmp;
   if sqrt(sqr(tmp.X-im.Width)+sqr(tmp.Y-0))*1000<sqrt(sqr(max2.X-im.Width)+sqr(max2.Y-0))*1000
      then max2:=tmp;
   if sqrt(sqr(tmp.X-0)+sqr(tmp.Y-im.Height))*1000<sqrt(sqr(max3.X-0)+sqr(max3.Y-im.Height))*1000
      then max3:=tmp;
   if sqrt(sqr(tmp.X-im.Width)+sqr(tmp.Y-im.Height))*1000<sqrt(sqr(max4.X-im.Width)+sqr(max4.Y-im.Height))*1000
      then max4:=tmp;

str:=GShow_title(str,';',4);
                   end;

                                         end;
case li of
1:begin
im.Canvas.Pen.Color:=clred;
GDrawShape_(im,dtLine,inttostr(max1.X)+','+inttostr(max1.Y)+';  '+
        inttostr(max2.X)+','+inttostr(max2.Y)+';'+
        inttostr(max3.X)+','+inttostr(max3.Y)+';'+
        inttostr(max4.X)+','+inttostr(max4.Y)+';'+
        inttostr(max4.X)+','+inttostr(max4.Y)+';',pmcopy);
im.Canvas.TextOut(max1.X,max1.Y,'1');
im.Canvas.TextOut(max2.X,max2.Y,'2');
im.Canvas.TextOut(max3.X,max3.Y,'3');
im.Canvas.TextOut(max4.X,max4.Y,'4');
  end;
end;//case
result:=inttostr(max1.X)+','+inttostr(max1.Y)+';  '+
        inttostr(max2.X)+','+inttostr(max2.Y)+';  '+
        inttostr(max3.X)+','+inttostr(max3.Y)+';  '+
        inttostr(max4.X)+','+inttostr(max4.Y)+';';
end;


function GPointEstimate_2(im:Timage;list:Tlistbox;li:integer):String;
var tmp,max1,max2,max3,max4:Tpoint;
    i,j:integer;
    str:ansistring;
begin
  str:=Gshow_title(Gshow_title(list.Items[0],':',4),';',3);
max1:=point(strtoint(Gshow_title(str,',',3)),strtoint(Gshow_title(str,',',4)));
max2:=max1;
max3:=max1;
max4:=max1;

for j:=0 to list.Items.Count-1 do begin
  str:=Gshow_title(Gshow_title(list.Items[j],':',4),'@',3);

for i:=1 to strtoint(Gshow_title(str,';',6)) do begin
 if trim(str) <> '' then begin
tmp.X:=strtoint(GShow_title(GShow_title(str,';',3),',',3));
tmp.Y:=strtoint(GShow_title(GShow_title(str,';',3),',',4));
                         end;
if tmp.x>max1.X
   then max1:=tmp;
if tmp.y>max2.y
   then max2:=tmp;
if tmp.x<max3.X
   then max3:=tmp;
if tmp.y<max4.y
   then max4:=tmp;

str:=GShow_title(str,';',4);
                   end;

                                         end;
case li of
1:begin
im.Canvas.Pen.Color:=clred;
im.Canvas.Pen.Width:=1;
GDrawShape_(im,dtLine,
        inttostr(max1.X)+','+inttostr(max2.Y)+';'+
        inttostr(max1.X)+','+inttostr(max4.Y)+';'+
        inttostr(max3.X)+','+inttostr(max4.Y)+';'+
        inttostr(max3.X)+','+inttostr(max2.Y)+';'+
        inttostr(max1.X)+','+inttostr(max2.Y)+';'+
        inttostr(max3.X)+','+inttostr(max2.Y)+';',pmcopy);
end;
end;//case
result:=inttostr(max1.X)+','+inttostr(max2.Y)+';  '+
        inttostr(max1.X)+','+inttostr(max4.Y)+';  '+
        inttostr(max3.X)+','+inttostr(max4.Y)+';  '+
        inttostr(max3.X)+','+inttostr(max2.Y)+';';
end;


procedure GPoint_show(ScrollBox:TScrollBox;bx,by,li:integer);
begin
with ScrollBox do begin
case li of
1:begin
    HorzScrollBar.Position:=bx-ScrollBox.width div 2;
    VertScrollBar.Position:=by-ScrollBox.height div 2;
  end;
end;//case
                  end;
end;

procedure GShow_CeaterLine(im:Timage;m1,m2,M3,M4,PenWidth,LineWidth:integer;color:Tcolor;PenMode:TPenMode;Ceater_li:integer);
begin
if G_OldCeaterLine.li <> 0
   then
GCenterLine(im,G_OldCeaterLine.Point_1.X,G_OldCeaterLine.Point_1.Y,
               G_OldCeaterLine.Point_2.X,G_OldCeaterLine.Point_2.Y,
               G_OldCeaterLine.PenWidth,
               G_OldCeaterLine.LineWidth,
               G_OldCeaterLine.Pencolor,
               G_OldCeaterLine.penmode,
               G_OldCeaterLine.li);

GCenterLine(im,m1,m2,m3,m4,
               PenWidth,
               LineWidth,
               Color,penmode,Ceater_li);

G_OldCeaterLine.Point_1:=point(m1,m2);
G_OldCeaterLine.Point_2:=point(m3,m4);
G_OldCeaterLine.li:=Ceater_li;
G_OldCeaterLine.LineWidth:=LineWidth;
G_OldCeaterLine.PenMode:=PenMode;
G_OldCeaterLine.Pencolor:=color;
G_OldCeaterLine.PenWidth:=PenWidth;
end;

end.


⌨️ 快捷键说明

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