亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? untshape.pas

?? 這是個可以劃出不同幾何圖形的程序
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{***************************************************************}
{		 UntShape					}
{              }
{                  }
{                                                               }
{            }
{								}
{  E-Mail: SydWaters@hotmail.com				}
{                          04-2004	 by	Hu Qing Jiang		}
{								}
{***************************************************************}unit UntShape;

interface

uses
 windows,SysUtils, Classes, Controls,Graphics;
const
  SizerWidth=6;
type
    TShapeElement=(seNone,seSLine,seMLine,seCylinder,seArrow,seRectangle,seDiamond,
                   seEchelon,seEllipse,seTriangle);   //圖形類別
    TShapeDir=(sdLeft,sdRight,sdDown,sdUp);
    TSizerType=(sTypeNone,sTypeDrag,sTypeFree,sType0,sType1,sType2,sType3,sType4,sType5,sType6,sType7);
    TPenWidth=1..4;


    TShapeProperty=record       // shape property record
       FHeadPnt:TPoint;         //圖形初始位置
       FEndPnt:TPoint;          //圖形終點位置
       FWidth:integer;          //圖形寬度
       FHeight:integer;         //圖形高度
       FLineWidth:TPenWidth;    //線的寬度
       FLineColor:TColor;       //線的顏色
       FColor:TColor;           //填充顏色類別
       FDir:TShapeDir;          //
       FTransparent:Boolean;    //圖像是否透明
       FText:String;            //文本顯示
       FFontName:string;        //字體名稱
       FFontSize:integer;       //字體尺寸
       FFontColor:TColor;       //字體顏色
    end;

    TBaseShape=class             //定義基類
      private
       FHeadPnt:TPoint;         //開始位置
       FEndPnt:TPoint;          //終止位置
       FSelected:Boolean;       //是否選中
       FBoundRect:TRect;        //區域
       FDir:TShapeDir;

      protected
         procedure SetBoundRect;virtual;    //畫圖形區域
         procedure DrawSizer(kind:TShapeElement;dc:HDC);virtual;  //畫圖形邊界紅色標識
         procedure DrawCaption(DC:HDC);virtual;
      public
       LineWidth:TPenWidth;
       LineColor:TColor;
       Color:TColor;
       Caption:string;
       Transparent:Boolean;
       FontSize:integer;
       FontName:string;
       FontColor:TColor;
       property Selected:Boolean read FSelected write FSelected;
       property BoundRect:TRect read FBoundRect;
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);virtual;
         function HitTest(Pnt:TPoint):Boolean;virtual;  //點擊圖像發生該事件
         function Move(const Xoffset,YOffset:integer):Boolean;virtual;//參數為偏移量 移動圖形并重畫
         function ReSizeTest(const Pnt:TPoint):TSizerType; virtual;
         procedure SetRect(LTPnt,RBPnt:TPoint);virtual;
     end;
//....................................................................
     TBaseLine=class(TBaseShape)
       Private
        Pntarr:Array of TPoint;
        CurrentIndex:integer;

       protected
         procedure DrawSizer(kind:TShapeElement;dc:HDC);override;
         procedure DrawArrow(dc:HDC);virtual;
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
         function HitTest(Pnt:TPoint):Boolean;override;
         function Move(const Xoffset,YOffset:integer):Boolean;override;
         function ReSizeTest(const Pnt:TPoint):TSizerType;override;
         procedure MoveCurrentPnt(const X,Y:integer);
       public
         Arrow:Boolean;
       public
         property Selected;

     end;
//....................................................................
     TRectangle=class(TBaseShape)
      private

      protected
        procedure SetBoundRect;override;
        procedure DrawSizer(kind:TShapeElement;dc:HDC);override;
     //   procedure DrawCaption(DC:HDC);override;
      public
         RoundVal:integer;
         property Selected;
         property BoundRect;

      public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
         function HitTest(Pnt:TPoint):Boolean;override;
         function Move(const Xoffset,YOffset:integer):Boolean;override;
         function ReSizeTest(const Pnt:TPoint):TSizerType;override;
         procedure SetRect(LTPnt,RBPnt:TPoint);override;
     end;
//.........................................
     TDiamond=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
       end;
//.......................................................
     TCylinder=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
       end;
//.......................................................
  TEllipse=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
       end;
//.......................................................
     TEchelon=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
       end;
//..........................
     TTriangle=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
     end;
//................................................................
TArrow=class(TRectangle)
       public
         constructor Create(ShpStrt:TShapeProperty);
         procedure Paint(ACanvas:HDC);override;
       public
       property Selected;
       property BoundRect;
     end;
implementation

  function MaxAB(const a,b:integer):integer;
  begin
     if a>=b then result:=a
     else result:=b;
  end;
   function MinAB(const a,b:integer):integer;
  begin
     if a<=b then result:=a
     else result:=b;
  end;
{ TBaseShape }

constructor TBaseShape.Create(ShpStrt:TShapeProperty);
begin
   inherited Create;
   //初始化圖像的屬性
       FHeadPnt:=ShpStrt.FHeadPnt;     //起始位置
       FEndPnt:=ShpStrt.FEndPnt;       //終止位置
       LineWidth:=ShpStrt.FLineWidth;    //邊界線的寬度
       if LineWidth<1 then LineWidth:=1;
       if LineWidth>4 then LineWidth:=4;
       LineColor:=ShpStrt.FLineColor;     //邊界線的顏色
       Color:=ShpStrt.FColor;             //圖形填充顏色
       Caption:=ShpStrt.FText;            //文字標識
       Transparent:=ShpStrt.FTransparent;
       FDir:=ShpStrt.FDir;
       SetBoundRect;                      //畫圖形
       FSelected:=true;                   //對是否選中屬性賦值
   FontName:=ShpStrt.FFontName;           //字體名稱
   FontSize:=ShpStrt.FFOntSize;           //字體尺寸
   FontColor:=ShpStrt.FFontColor;         //字體顏色

end;

procedure TBaseShape.DrawCaption(DC:HDC);
begin
  // nothing;
end;

procedure TBaseShape.DrawSizer(kind: TShapeElement; dc: HDC);
begin
// do nothing;;;;;;;;
end;

function TBaseShape.HitTest(Pnt: TPoint): Boolean;
begin
 result:=false;
end;



function TBaseShape.Move(const Xoffset,YOffset:integer):Boolean;  //基類中的移動重畫事件
begin
 result:=false;
 if (Xoffset=0)and(Yoffset=0)then exit;
 FHeadPnt.x:=FHeadPnt.x+xoffset;
 FHeadPnt.y:=FHeadPnt.y+yoffset;
 FEndPnt.x:=FEndPnt.x+xoffset;
 FEndPnt.y:=FEndPnt.y+yoffset;
  SetBoundRect;
 result:=true;

end;

procedure TBaseShape.Paint(ACanvas:HDC);
begin
    // in this class ,it do nothing.........
end;

function TBaseShape.ReSizeTest(const Pnt: TPoint): TSizerType;
begin
  result:=sTypeNone;
end;

procedure TBaseShape.SetBoundRect;
var
lt,br:TPoint;
begin

 br.x:=MaxAB(FHeadPnt.X,FEndPnt.X);
 br.y:=MaxAB(FHeadPnt.y,FEndPnt.y);
 lt.x:=MinAB(FHeadPnt.x,FEndPnt.x);
 lt.y:=MinAB(FHeadPnt.y,FEndPnt.y);

FBoundRect:=Rect(lt,br);
end;
procedure TBaseShape.SetRect(LTPnt, RBPnt: TPoint);
begin
  if (LTPnt.x=RBPnt.x)and(LTPnt.y=RBPnt.y) then exit;
  FHeadPnt:=LTPnt;
  FEndPnt:=RBPnt;
  SetBoundRect;
end;

{ TRectangle }

constructor TRectangle.Create(ShpStrt:TShapeProperty);
begin
  inherited Create(ShpStrt);
  RoundVal:=0;
end;



procedure TRectangle.DrawSizer(kind: TShapeElement; dc: HDC);
var
brush:HBRUSH;
i:integer;
sizer:array[0..7] of TPoint;
rc:TRect;
begin
 if not Selected then exit;
 sizer[0]:=Point(FBoundRect.left,FBoundRect.Top);   //圖形的左上坐標
 sizer[1]:=Point(FBoundRect.left+(FBoundRect.Right-FBoundRect.left)div 2-SizerWidth div 2,
                  FBoundRect.Top);    // 圖形的上中間坐標
 sizer[2]:=Point(FBoundRect.right-SizerWidth,FBoundRect.Top);   //圖形的右上坐標
 sizer[3]:=Point(FBoundRect.right-SizerWidth,FBoundRect.top+(FBoundRect.Bottom-FBoundRect.Top)div 2
                       -SizerWidth div 2);     //圖形的右中坐標
 sizer[4]:=Point(FBoundRect.Right-SizerWidth,FBoundRect.Bottom-SizerWidth);//圖形的右下坐標
 sizer[5]:=Point(FBoundRect.left+(FBoundRect.Right-BoundRect.left)div 2-SizerWidth div 2,
                  FBoundRect.Bottom-SizerWidth);  //圖形的下中坐標
 sizer[6]:=Point(FBoundRect.left,FBoundRect.Bottom-SizerWidth);   //圖形的左下坐標
 sizer[7]:=Point(FBoundRect.left,FBoundRect.Top+(FBoundRect.Bottom-FBoundRect.Top)div 2
                       -SizerWidth div 2);   //圖形的左中坐標

   Brush:=CreateSolidBrush(clRed);    // 取得純色畫筆
   SelectObject(dc,Brush);      //選中對象作為特殊的設備上下文
 for i:=0 to 7 do
 begin
   rc:=Rect(Sizer[i].X ,Sizer[i].Y,Sizer[i].X+SizerWidth,Sizer[i].Y+SizerWidth);
   //FillRect(dc,rc,BRUSH);
   FillRect(dc,rc,Brush);
 end;
   deleteObject(Brush);          //刪除
end;

function TRectangle.HitTest(Pnt: TPoint): Boolean;
begin
  inherited HitTest(Pnt);
  //;
  if PtInRect(FBoundRect,Pnt) then   //判斷某一坐標是否在某一特殊區域
  begin
    FSelected:=true;
  end
  else
  begin
    FSelected:=false;
  end;
  result:=FSelected;
end;

function TRectangle.Move(const Xoffset, YOffset: integer): Boolean;
begin
   inherited Move(Xoffset, YOffset);
   result:=true;
end;

procedure TRectangle.Paint(ACanvas:HDC);
var
  pen:HPEN;
  SolidBrush:HBRUSH;
  rgn:HRGN;  //區域句柄
begin
     rgn:=0;
    pen:=CreatePen(0,LineWidth,LineColor);   //創建畫筆
    SolidBrush:=CreateSolidBrush(Color);     //創建刷子
    SelectObject(aCanvas,SolidBrush);
    SelectObject(aCanvas,pen);
    if RoundVal<=0then RoundVal:=0;
    RoundRect(aCanvas,FHeadPnt.x,FHeadPnt.y,FEndPnt.X,FEndPnt.y,RoundVal,RoundVal);

    deleteObject(pen);
    deleteObject(SolidBrush);
    DeleteObject(rgn);
     DrawCaption(aCanvas);
    DrawSizer(seSLine,aCanvas);   //畫圖形邊界的紅色標識

end;

function TRectangle.ReSizeTest(const Pnt: TPoint): TSizerType;
var
  left,top,halfw,halfh,right,bottom:integer;
  rc:TRect;
begin
 inherited ResizeTest(pnt);
    // none outside shape;
    if not PtInRect(FBoundRect,pnt) then     //判坐標是否在某一區域
    begin
     Result:=sTypeNone;
     exit;
    end else
  Result:=sTypeDrag;

   left:=FBoundRect.left;
   top:=FBoundRect.top;
   halfw:=FBoundRect.left+(FBoundRect.Right-FBoundRect.Left)div 2-SizerWidth div 2;  //上中坐標
   halfh:=FBoundRect.top+(FBoundRect.Bottom-FBoundRect.Top)div 2-SizerWidth div 2;   //左中坐標
   right:=FBoundRect.right-SizerWidth;
   bottom:=FBoundRect.bottom-SizerWidth;
   //0
   rc:=Rect(left,top,left+SizerWidth,top+SizerWidth);  //取得區域
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType0;
     exit;
   end;
   //1
   rc:=Rect(halfw,top,halfw+SizerWidth,top+SizerWidth);
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType1;
     exit;
   end;
   //2
    rc:=Rect(right,top,right+SizerWidth,top+SizerWidth);
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType2;
     exit;
   end;
   //3
    rc:=Rect(right,halfh,right+SizerWidth,halfh+SizerWidth);
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType3;
     exit;
   end;
  //4
    rc:=Rect(right,bottom,right+SizerWidth,bottom+SizerWidth);
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType4;
     exit;
   end;
   //5
    rc:=Rect(halfw,bottom,halfw+SizerWidth,bottom+SizerWidth);
   if PtInRect(rc,Pnt) then
   begin
     Result:=sType5;
     exit;
   end;
  //6

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区国产| 国产不卡视频一区| 色噜噜狠狠色综合欧洲selulu| 久久免费美女视频| 粉嫩绯色av一区二区在线观看| 中文字幕不卡在线| 99久久精品99国产精品| 亚洲精品免费在线播放| 在线观看91视频| 日韩高清在线电影| 欧美不卡一区二区| 国产ts人妖一区二区| 国产精品乱人伦一区二区| 91麻豆免费看片| 亚洲成人午夜影院| 欧美成人在线直播| 国产大片一区二区| 亚洲黄色小视频| 欧美一级黄色片| 国产凹凸在线观看一区二区| 亚洲天堂成人在线观看| 欧美日韩黄色一区二区| 久久99日本精品| 中文字幕免费一区| 欧美日韩一本到| 国产一区二区三区不卡在线观看 | 99国产精品视频免费观看| 亚洲欧洲国产日韩| 欧美久久久久中文字幕| 国产麻豆精品theporn| 亚洲欧美激情小说另类| 欧美一区二区三区视频免费| 成人午夜激情影院| 天天影视色香欲综合网老头| 久久久亚洲高清| 色婷婷亚洲综合| 久久99精品国产麻豆婷婷| 国产精品久久久久久亚洲伦| 欧美高清视频在线高清观看mv色露露十八 | 成人国产精品免费观看动漫| 亚洲一区二区三区在线看| 精品国产亚洲在线| 欧美三级一区二区| 成人性视频免费网站| 日精品一区二区三区| 国产精品伦理在线| 精品国内片67194| 91福利社在线观看| 国产91精品免费| 蜜臀av性久久久久蜜臀aⅴ流畅 | 不卡视频一二三| 蜜桃视频在线观看一区二区| 亚洲欧美日韩国产成人精品影院| 日韩欧美高清在线| 欧美视频一区二区在线观看| 成人综合婷婷国产精品久久| 美女mm1313爽爽久久久蜜臀| 亚洲精品欧美综合四区| 国产日产欧美精品一区二区三区| 91精品国产综合久久精品性色| 91在线一区二区三区| 国产69精品久久777的优势| 青青草国产成人av片免费| 亚洲影院免费观看| 中文字幕亚洲视频| 日本一区二区免费在线观看视频 | 99久久精品国产精品久久| 国产精品一区二区果冻传媒| 男女男精品视频网| 日韩不卡一二三区| 午夜精品成人在线视频| 亚洲一区二区三区免费视频| 国产精品卡一卡二| 国产精品视频一二| 久久男人中文字幕资源站| 日韩视频一区在线观看| 欧美一级欧美一级在线播放| 欧美精品色综合| 在线成人高清不卡| 日韩欧美激情一区| 日韩欧美一区电影| 精品三级在线观看| 精品三级av在线| 亚洲精品一区二区三区99| 精品国产精品网麻豆系列| 精品国产成人系列| 久久精品夜色噜噜亚洲aⅴ| 精品动漫一区二区三区在线观看| 精品国产亚洲一区二区三区在线观看 | 三级久久三级久久久| 亚洲国产一区在线观看| 午夜精品免费在线观看| 日韩电影在线看| 狠狠色2019综合网| 国产成人啪免费观看软件| 成人国产免费视频| 色综合色综合色综合| 欧美性色黄大片| 在线91免费看| 精品欧美一区二区在线观看| 久久精品视频在线看| 国产精品国产三级国产普通话蜜臀| 国产精品久久久久四虎| 亚洲一卡二卡三卡四卡五卡| 免费人成精品欧美精品| 国产精品一区二区不卡| 91麻豆.com| 欧美精品精品一区| 久久蜜桃av一区二区天堂| 中文字幕第一区综合| 亚洲综合丁香婷婷六月香| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产在线播放一区| 一本色道亚洲精品aⅴ| 91精品福利在线一区二区三区 | 久久综合久久久久88| 久久久www成人免费毛片麻豆| 国产精品国产三级国产专播品爱网| 亚洲一区二区三区在线看| 国内精品不卡在线| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美日韩中字一区| 精品免费日韩av| 亚洲欧美日韩一区二区三区在线观看| 亚洲一区二区综合| 国产一区高清在线| 欧美三级电影网| 国产拍揄自揄精品视频麻豆| 亚洲国产精品尤物yw在线观看| 久久 天天综合| 在线观看一区二区精品视频| 欧美成人性福生活免费看| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲第一激情av| 懂色av中文字幕一区二区三区 | 国产高清一区日本| 欧美人牲a欧美精品| 国产精品视频第一区| 麻豆极品一区二区三区| 在线免费观看日本欧美| 国产日韩精品一区| 日韩精品1区2区3区| 91国模大尺度私拍在线视频| 久久蜜桃av一区二区天堂| 日韩福利电影在线观看| 色综合天天做天天爱| 国产丝袜在线精品| 精品一区二区三区欧美| 欧美日高清视频| 亚洲免费看黄网站| 成人性色生活片免费看爆迷你毛片| 欧美电影一区二区| 亚洲成人免费影院| 91亚洲精华国产精华精华液| 久久精品一区二区三区不卡| 奇米亚洲午夜久久精品| 欧美性受xxxx黑人xyx| 亚洲精品国产精华液| 成人国产精品免费观看动漫| 久久精品一区蜜桃臀影院| 麻豆91免费观看| 欧美一级二级在线观看| 三级欧美韩日大片在线看| 精品视频1区2区3区| 亚洲精品菠萝久久久久久久| 99re亚洲国产精品| 国产精品久久久久影院老司| 成人午夜看片网址| 国产精品毛片无遮挡高清| 国产99精品在线观看| 国产欧美中文在线| 国产精品综合网| 国产色91在线| 丁香亚洲综合激情啪啪综合| 久久久精品2019中文字幕之3| 精品午夜一区二区三区在线观看| 91精品国产欧美一区二区18| 日本不卡一区二区三区| 欧美男人的天堂一二区| 爽好多水快深点欧美视频| 91麻豆精品国产91久久久| 琪琪一区二区三区| 精品乱人伦小说| 国产精品一区二区在线观看网站 | 国产视频911| 成人精品一区二区三区四区| 国产精品盗摄一区二区三区| 99久久精品久久久久久清纯| 一区二区三区在线观看动漫| 欧美性一级生活| 秋霞成人午夜伦在线观看| 26uuu国产一区二区三区| 国产福利一区在线观看| 国产精品久久久久久久岛一牛影视| 9l国产精品久久久久麻豆| 一区二区不卡在线播放| 91精品久久久久久蜜臀| 国产美女精品一区二区三区| 国产精品毛片大码女人| 欧美视频中文一区二区三区在线观看|