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

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

?? unitpaintpanel.pas

?? 通過使用PaintBox控件進行矢量圖繪圖
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
unit UnitPaintPanel;
{
  Create Date :2003.09.21;
  Create Authoer :WXZH
  E_Mail :lanya99@hotmail.com

  本源代碼代開,希望哪位同仁加以改進后能給本人發一份源代碼,謝謝
  功能介紹:
    本組件繼承于TCustomControl,功能包括:
    1、圖形的繪制,包括線條,多邊型,多點曲線,圓形,橢圓形
    2、注釋的繪制,包括帶指向點的繪制和不帶指向點的繪制
    3、圖形的存取:從自已定義的文件格式中讀入文件,
      寫入的文件格式有自己定義的文件格式或位圖格式。也可以從流數據中
      進行存取。
      4、F5可以進行刷新圖面,DELETE鍵可以刪除當前選擇的圖形,F6可以刪除填充的地方。
      5、在進行編譯時要進行堆棧的改動,這是由于查找多邊形的算法不好,希望哪位能改進
}
interface
uses
   Classes,Windows,Messages,ExtCtrls,Graphics,SysUtils,
   Controls,Dialogs,Menus,StdCtrls,Math,UnitGlobal,ZLib;
type
   TGraphClass =(gcLine,gcCurve,gcArc,gcRect,gcNotice);


   TGraphObject = class(TObject)
   private
     FSelected: Boolean;
     FGraphClass: TGraphClass;
     FPointList: TPointList;
     FColor: TColor;
     FFill: Boolean;
     procedure SetPointList(const Value: TPointList);
     procedure SetGraphClass(const Value: TGraphClass);
     procedure SetSelected(const Value: Boolean);
     procedure SetColor(const Value: TColor);
     procedure SetFill(const Value: Boolean);
   public
     property  Fill :Boolean read FFill write SetFill;
     property  PointList :TPointList read FPointList write SetPointList;
     property  Color :TColor read FColor write SetColor;
     property  Selected :Boolean read FSelected write SetSelected;
     property  GraphClass :TGraphClass read FGraphClass write SetGraphClass;
   end;

   TPositionDirection = (pdLeft,pdRight,pdTop,pdBottom);  //點位于矩形框的方位,左邊,右邊,上邊,下邊
   TNoticeClass   =(ncRect,ncNotice);

   TNoticeObject     = class(TObject)
   private
     FFillColor: TColor;
     FClientRect: TRect;
     FLines: TStringList;
     FPoint: TPoint;
     FSelected: Boolean;
     FNoticeClass: TNoticeClass;

     procedure SetClientRect(const Value: TRect);
     procedure SetFillColor(const Value: TColor);
     procedure SetLines(const Value: TStringList);
     function  GetPointList :TPointList;
     procedure SetPoint(const Value: TPoint);
     function PoInRectPosition(Po: TPoint;
          ARect: TRect): TPositionDirection;
     procedure SetSelected(const Value: Boolean);
     procedure SetNoticeClass(const Value: TNoticeClass);
   public
     constructor Create;
     destructor  Destroy;override;

     property NoticeClass :TNoticeClass read FNoticeClass write SetNoticeClass;
     property ClientRect :TRect read FClientRect write SetClientRect;
     property Lines :TStringList read FLines write SetLines;
     property PointList :TPointList read GetPointList;
     property FillColor :TColor read FFillColor write SetFillColor;
     property ToPoint :TPoint read FPoint write SetPoint;
     property Selected :Boolean read FSelected write SetSelected;
   end;

   TDrawClass  =(dcGraph,dcNotice) ;//所畫的類別,圖形,注釋.....
   TPaintMouseDragEvent = procedure(Sender :TObject;var ARect :TRect;
                 var Po :TPoint;Lines :TStringList) of Object;
   TNoticeDragPoint =(npBorder,npHeader);

   TFillObject = class
     Rgn :HRgn;
     FillColor :TColor;
   end;

   TCustomPaintPanel = class(TCustomControl)
   private
     FGraphList :TList;
     FNoticeList :TList;
     FFillList :TList;
     FGraphClass: TGraphClass;
     FPointList :TPointList;
     FAbsPointList :TPointList;
     FPointCount :integer;
     FAction :TOperateAction;
     FColor: TColor;
     FSelObject: TObject;
     FMouseDownSPo :TPoint;
     FDrawClass: TDrawClass;
     FOnMouseDrag: TPaintMouseDragEvent;
     FIsFill: Boolean;
     FFillColor: TColor;
     FNoticeDragPoint: TNoticeDragPoint;
     FNoticeClass: TNoticeClass;

     procedure WMLButtonDown(var Msg :TWMLButtonDown);message WM_LButtonDown;
     procedure WMLButtonUp(var Msg :TWMLButtonUp);message WM_LButtonUp;
     procedure WMMouseMove(var Msg :TWMMouseMove);message WM_MouseMove;
     procedure WMKeyDown(var Msg :TWMKeyDown);message WM_KEYDOWN;
     procedure SetGraphClass(const Value: TGraphClass);

     procedure PaintSelected(AObject: TObject);
     procedure SetColor(const Value: TColor);
     procedure RunTimeDraw(AGraphClass :TGraphClass;APointList :TPointList);
     procedure ClearObjectSelected;
     function  PTInObject(Po: TPoint; AGraphObject: TGraphObject): Boolean;overload;
     function  PTInObject(Po :TPoint; ANoticeObject: TNoticeObject): Boolean;overload;
     procedure SetSelObject(const Value: TObject);
     procedure MoveObject(AObject: TObject; DeltaX,DeltaY: integer);
     procedure ShowMoveObject(AObject: TObject; DeltaX,DeltaY: integer);
     procedure ClearNoticeObject;
     procedure PaintGraph;
     procedure PaintNotice;
     procedure DrawNoticeText(ANoticeObject: TNoticeObject);
     procedure AddGraphObject;
     procedure SetDrawClass(const Value: TDrawClass);
     procedure SetOnMouseDrag(const Value: TPaintMouseDragEvent);
     procedure SetFillColor(const Value: TColor);
     procedure SetIsFill(const Value: Boolean);
     procedure PaintFill;
     procedure SetNoticeDragPoint(const Value: TNoticeDragPoint);
     function  PointInEdge(Po: TPoint; AGraphObject: TGraphObject): Boolean;
     procedure PointListChangToScreen(ClientPointList,
                ScreenPointList: TPointList);
     procedure ClearGraphObject;
     procedure DeleteGraph(AGraphObject: TGraphObject);
     procedure DeleteNotice(ANoticeObject: TNoticeObject);
     procedure ClearFillObject;
     procedure SetNoticeClass(const Value: TNoticeClass);
   protected
     procedure Paint;override;

     procedure DeleteObject(AObject :TObject);
     property  OnMouseDrag :TPaintMouseDragEvent read FOnMouseDrag write SetOnMouseDrag;
     property  NoticeDragPoint :TNoticeDragPoint read FNoticeDragPoint write SetNoticeDragPoint;
   public
     constructor Create(AOwner :TComponent);override;
     destructor  Destroy;override;

     procedure Delete;
     procedure Clear;

     procedure AddNotice(ARect :TRect;Po :TPoint;Lines :TStringList);
     procedure SaveToFile(const FileName :string);    //保存當前數據到文件
     procedure SaveToStream(Stream :TStream);         //保存當前數據到流數據
     procedure SaveToBitmap(const FileName :string);  //保存當前數據為位圖文件
     procedure LoadFromStream(Stream :TStream);       //從流數據中載入數據
     procedure LoadFromFile(const FileName :string);  //從文件中載入數據

     property DrawClass :TDrawClass read FDrawClass write SetDrawClass;
     property NoticeClass :TNoticeClass read FNoticeClass write SetNoticeClass;
     property SelObject :TObject read FSelObject write SetSelObject;
     property Color :TColor read FColor write SetColor;
     property FillColor :TColor read FFillColor write SetFillColor;
     property IsFill :Boolean read FIsFill write SetIsFill;
     property GraphClass :TGraphClass read FGraphClass write SetGraphClass;
   end;

   TPaintPanel = class(TCustomPaintPanel)
   published
     property Align;
     property FillColor;
     property DrawClass;
     property Color;
     property GraphClass;
     property Visible;
     property OnMouseDrag;
   end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Lanya Soft',[TPaintPanel]);
end;

const
  FileIdentify = 'WXZHP1.1';    //保存文件時采用的字符串標志名稱

{ TGrapthObject }

procedure TGraphObject.SetPointList(const Value: TPointList);
begin
  FPointList := Value;
end;

procedure TGraphObject.SetGraphClass(const Value: TGraphClass);
begin
  FGraphClass := Value;
end;

procedure TGraphObject.SetSelected(const Value: Boolean);
begin
  FSelected := Value;
end;

procedure TGraphObject.SetColor(const Value: TColor);
begin
  FColor := Value;
end;

procedure TGraphObject.SetFill(const Value: Boolean);
begin
  FFill := Value;
end;


{ TPaintPanel }

constructor TCustomPaintPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FGraphList := TList.Create;
  FNoticeList := TList.Create;
  FFillList := TList.Create;
  GraphClass := gcLine;
  DrawClass := dcGraph;
  SetLength(FPointList,0);
end;

destructor TCustomPaintPanel.Destroy;
begin
  ClearGraphObject;
  ClearNoticeObject;
  FGraphList.Free;
  FNoticeList.Free;
  FFillList.Free;
  inherited;
end;

procedure TCustomPaintPanel.ClearNoticeObject;
var
  i :integer;
  NoticeObject :TNoticeObject;
begin
  for i := 0 to FNoticeList.Count - 1 do
  begin
    NoticeObject := FNoticeList[i];
    NoticeObject.Free;
  end;
  FNoticeList.Clear;
  Invalidate;
end;

procedure TCustomPaintPanel.ClearGraphObject;
var
  i :integer;
  GraphObject :TGraphObject;
begin
  for i := 0 to FGraphList.Count - 1 do
  begin
    GraphObject := FGraphList[i];
    GraphObject.Free;
  end;
  FGraphList.Clear;
  Invalidate;
end;


procedure TCustomPaintPanel.AddNotice(ARect: TRect; Po: TPoint;
  Lines: TStringList);
var
  NoticeObject : TNoticeObject;
begin
  NoticeObject := TNoticeObject.Create;
  NoticeObject.ClientRect := ARect;
  NoticeObject.ToPoint := Po;
  NoticeObject.Lines := Lines;
  NoticeObject.Selected := True;
  SelObject := NoticeObject;
  FNoticeList.Add(NoticeObject);
end;


procedure TCustomPaintPanel.LoadFromFile(const FileName: string);
var
  Stream :TMemoryStream;
  DestStream :TMemoryStream;
  DeCompressionStream :TDeCompressionStream;
  Count :Int64;
  Buff :Pchar;
  Identify :array of Char;
begin
  Stream := TMemoryStream.Create;
  try
    Stream.LoadFromFile(FileName);

    //辨別文件的格式,是否為能識別的格式
    Stream.Position := 0;
    SetLength(Identify,Length(FileIdentify));
    Stream.ReadBuffer(Identify[0],Sizeof(Char) * Length(FileIdentify));
    if Identify[0] = FileIdentify then              //辨別文件數據格式
       raise Exception.Create('無法識別的文件格式');

    Stream.ReadBuffer(Count,Sizeof(Int64));

    //解壓縮數據
    DestStream := TMemoryStream.Create;
    try
      DeCompressionStream := TDeCompressionStream.Create(Stream);
      GetMem(Buff,Count + 1);
      try
        DeCompressionStream.ReadBuffer(Buff^,Count);
        DestStream.WriteBuffer(Buff^,Count);
      finally
        FreeMem(Buff);
      end;
      LoadFromStream(DestStream); //根據數據流繪制圖形
    finally
      DestStream.Free;
    end;
  finally
    Stream.Free;
  end;
end;

procedure TCustomPaintPanel.LoadFromStream(Stream: TStream);
var
  Count :integer;
  AColor :TColor;
  APointList :TPointList;
  AGraphObject :TGraphObject;
  AGraphClass :TGraphClass;
  Identify :array of Char;
begin
  Stream.Position := 0;
  while Stream.Position < Stream.Size do
  begin
    Stream.ReadBuffer(Count,Sizeof(Count));
    Stream.ReadBuffer(AColor,Sizeof(TColor));
    Stream.ReadBuffer(AGraphClass,Sizeof(TGraphClass));
    SetLength(APointList,Count);
    Stream.ReadBuffer(APointList[0],Sizeof(TPoint) * Count);
    AGraphObject := TGraphObject.Create;
    AGraphObject.PointList := Copy(APointList,0,High(APointList) + 1);
    AGraphObject.Color := AColor;
    AGraphObject.GraphClass := AGraphClass;
    FGraphList.Add(AGraphObject);
  end;
  Invalidate;
end;

procedure TCustomPaintPanel.SaveToFile(const FileName: string);
var
  AStream :TMemoryStream;
  CompressionStream :TCompressionStream;
  DestStream :TMemoryStream;
  AIdentify :PChar;
  Count :Int64;
begin
  AStream := TMemoryStream.Create;
  try
    SaveToStream(AStream);
    Count := AStream.Size;
    DestStream := TMemoryStream.Create;
    try     //Start DestStream
      CompressionStream := TCompressionStream.Create(clMax,DestStream);
      try
        AStream.SaveToStream(CompressionStream);       //壓縮數據
      finally
        CompressionStream.Free;
      end;
      AStream.Clear;

      //寫入標志字符串
      AStream.WriteBuffer(FileIdentify,Sizeof(Char) * Length(FileIdentify));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日精品一区视频| 成人免费在线播放视频| 日本一区二区三区dvd视频在线| 国产精品夫妻自拍| 国产一区二区影院| 欧美三级日韩三级| 亚洲色欲色欲www在线观看| 狠狠网亚洲精品| 制服丝袜成人动漫| 伊人色综合久久天天| 国产成人小视频| 欧美揉bbbbb揉bbbbb| 亚洲欧美在线aaa| 国产成人99久久亚洲综合精品| 91精品国产色综合久久不卡蜜臀 | 国产精品亚洲一区二区三区在线 | 日本系列欧美系列| 在线观看日韩国产| 国产精品福利一区二区三区| 国产成人免费xxxxxxxx| 久久夜色精品国产噜噜av| 青青草国产成人av片免费| 欧美日免费三级在线| 亚洲男人的天堂av| 91久久人澡人人添人人爽欧美| 亚洲国产成人私人影院tom| 久久9热精品视频| 3d动漫精品啪啪一区二区竹菊| 亚洲一区二区三区三| 在线精品亚洲一区二区不卡| 亚洲视频精选在线| 在线观看一区不卡| 亚洲成人在线观看视频| 在线日韩av片| 水蜜桃久久夜色精品一区的特点| 91福利资源站| 爽爽淫人综合网网站| 欧美一区二区在线视频| 免费在线观看一区二区三区| 日韩亚洲欧美中文三级| 蜜臀av一区二区| 国产日韩欧美精品一区| 成人精品在线视频观看| 亚洲人成网站精品片在线观看 | 国产大陆精品国产| 国产精品狼人久久影院观看方式| 99精品视频中文字幕| 樱桃视频在线观看一区| 欧美日韩国产高清一区二区三区| 丝袜美腿亚洲色图| 久久午夜色播影院免费高清| av激情亚洲男人天堂| 亚洲一区二区三区四区在线免费观看| 欧美日韩视频不卡| 国产自产2019最新不卡| 日本一区二区三区在线观看| 色综合色狠狠天天综合色| 一区二区久久久久久| 91麻豆精品国产91久久久更新时间| 麻豆精品视频在线观看免费| 久久久午夜精品理论片中文字幕| 成人午夜私人影院| 日韩专区一卡二卡| 欧美激情中文不卡| 91精品国产高清一区二区三区| 国产一区不卡视频| 一卡二卡三卡日韩欧美| 久久久综合九色合综国产精品| 一本一道久久a久久精品综合蜜臀| 亚洲.国产.中文慕字在线| 久久久www成人免费无遮挡大片 | 成人中文字幕在线| 午夜精品一区二区三区电影天堂| 国产亚洲一区字幕| 欧美一区二区三区系列电影| 成人自拍视频在线观看| 另类调教123区| 亚洲网友自拍偷拍| 中文成人综合网| 日韩欧美国产一区在线观看| 91看片淫黄大片一级| 国产伦精品一区二区三区免费| 一区二区三区中文字幕| 久久午夜羞羞影院免费观看| 欧美剧在线免费观看网站| 成人福利视频在线| 精品亚洲免费视频| 视频一区二区中文字幕| 国产精品久久久久婷婷| 欧美一级理论片| 欧美日韩成人综合在线一区二区| 成人aa视频在线观看| 国产自产v一区二区三区c| 日本va欧美va欧美va精品| 一区二区欧美在线观看| 亚洲视频小说图片| 国产精品久久久久久久午夜片 | 日韩一区二区三区精品视频 | 日韩色视频在线观看| 欧美性大战久久| 91久久国产最好的精华液| 成人黄页毛片网站| 国产成人在线视频免费播放| 国模娜娜一区二区三区| 麻豆精品一区二区三区| 狂野欧美性猛交blacked| 亚洲6080在线| 亚洲第一二三四区| 亚洲国产精品一区二区www在线| 国产精品天干天干在观线| 26uuu国产电影一区二区| 精品少妇一区二区三区在线视频| 91麻豆精品国产无毒不卡在线观看| 欧美色成人综合| 欧美女孩性生活视频| 7777精品伊人久久久大香线蕉的| 欧美日韩国产小视频| 欧美人xxxx| 欧美电视剧在线观看完整版| 日韩一区二区三| 久久久亚洲精品一区二区三区| 久久婷婷国产综合精品青草| 国产日韩精品视频一区| 成人免费在线观看入口| 一区二区三区四区乱视频| 亚洲综合一区在线| 日韩电影在线一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅| 美女www一区二区| 国产一区二区在线观看免费| 国产成人自拍高清视频在线免费播放| 成人精品一区二区三区四区| 色哟哟亚洲精品| 欧美乱妇23p| 国产日韩欧美在线一区| 亚洲人成网站色在线观看| 亚洲福利视频一区| 精品一区二区在线免费观看| 国产成人综合在线观看| 色狠狠综合天天综合综合| 欧美老肥妇做.爰bbww| 久久综合999| 一区二区三区资源| 九九久久精品视频| 99re热这里只有精品视频| 欧美三级韩国三级日本一级| 精品国产乱码久久久久久1区2区| 中文字幕欧美三区| 天天操天天干天天综合网| 国产精品自拍三区| 欧美三区在线观看| 国产精品无码永久免费888| 亚洲福利一区二区三区| 国产精品一级片| 欧美精品v国产精品v日韩精品| 精品国产百合女同互慰| 亚洲影院理伦片| 国产99久久精品| 91精品国产aⅴ一区二区| 亚洲欧洲国产日韩| 麻豆精品在线观看| 欧美性大战久久久| 亚洲欧洲精品天堂一级| 久久99这里只有精品| 91传媒视频在线播放| 国产日本一区二区| 无码av免费一区二区三区试看| 成人高清免费观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 91麻豆精品视频| 久久蜜桃av一区二区天堂| 午夜婷婷国产麻豆精品| 成人av资源在线观看| 欧美变态口味重另类| 亚洲国产成人av好男人在线观看| 国产精品888| xf在线a精品一区二区视频网站| 亚洲国产精品久久艾草纯爱| 大桥未久av一区二区三区中文| 欧美成人vps| 日本亚洲电影天堂| 欧美男人的天堂一二区| 亚洲永久免费视频| 91免费国产在线观看| 国产精品久久久久久久久图文区 | 国产精品自拍一区| 欧美大度的电影原声| 日韩福利电影在线观看| 欧美日韩国产在线观看| 亚洲午夜久久久久久久久电影院 | 成人深夜视频在线观看| 久久五月婷婷丁香社区| 国产一区二区三区观看| 精品国内片67194| 国产麻豆一精品一av一免费| 精品久久久久久综合日本欧美| 日本免费在线视频不卡一不卡二| 精品视频1区2区3区| 亚洲一区二区欧美| 欧美日韩激情一区二区|