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

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

?? mainfrm.pas

?? 簡單的DELPHI的繪圖程序,可以畫出不同的各種已知圖形,書上看的.與大家分享
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
   on the pnlFillStyle TPanel for Fill and Border styles }
begin
  with imgDrawingPad do
  begin
    if DrawType = dtClipRect then
    begin
      Canvas.Pen.Style := psDot;
      Canvas.Brush.Style := bsClear;
      Canvas.Pen.Color := clBlack;
    end

    else if FillSelected then
      Canvas.Brush.Style := bsSolid
    else
      Canvas.Brush.Style := bsClear;

    if BorderSelected then
      Canvas.Pen.Style := psSolid
    else
      Canvas.Pen.Style := psClear;


    if FillSelected and (DrawType <> dtClipRect) then
     Canvas.Brush.Color := pnlFgBgInner.Color;

    if DrawType <> dtClipRect then
      Canvas.Pen.Color := pnlFgBgBorder.Color;
  end;
end;

procedure TMainForm.mmiExitClick(Sender: TObject);
begin
  Close; // Terminate application
end;

procedure TMainForm.mmiSaveFileClick(Sender: TObject);
{ This method saves the image to the file specified by FileName. If
  FileName is blank, however, SaveAs1Click is called to get a filename.}
begin
  if FileName = '' then
    mmiSaveAsClick(nil)
  else begin
    imgDrawingPad.Picture.SaveToFile(FileName);
    stbMain.Panels[0].Text := FileName;
    Modified := False;
  end;
end;

procedure TMainForm.mmiSaveAsClick(Sender: TObject);
{ This method launches SaveDialog to get a file name to which
  the image's contents will be saved. }
begin
  if SaveDialog.Execute then
  begin
    FileName := SaveDialog.FileName;  // Store the filename
    mmiSaveFileClick(nil)
  end;
end;

procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
{ If the user attempts to close the form before saving the image, they
  are prompted to do so in this method. }
var
  Rslt: Word;
begin
  CanClose := False; // Assume fail.
  if Modified then begin
    Rslt := MessageDlg('File has changed, save?', mtConfirmation, mbYesNOCancel, 0);
    case Rslt of
      mrYes: mmiSaveFileClick(nil);
      mrNo: ;  // no need to do anything.
      mrCancel: Exit;
    end
  end;
  CanClose := True;    // Allow use to close application
end;

procedure TMainForm.mmiNewFileClick(Sender: TObject);
{ This method erases any drawing on the main image after prompting the
  user to save it to a file in which case the mmiSaveFileClick event handler
  is called. }
var
  Rslt: Word;
begin
  if Modified then begin
    Rslt := MessageDlg('文件已經改變,是否保存?', mtConfirmation, mbYesNOCancel, 0);
    case Rslt of
      mrYes: mmiSaveFileClick(nil);
      mrNo: ;  // no need to do anything.
      mrCancel: Exit;
    end
  end;

   with imgDrawingPad.Canvas do begin
     Brush.Style := bsSolid;
     Brush.Color := clWhite;  // clWhite erases the image
     FillRect(ClipRect);      // Erase the image
     FileName := '';
     stbMain.Panels[0].Text := FileName;
   end;
   SetDrawingStyle;   // Restore the previous drawing style
   Modified := False;
end;

procedure TMainForm.mmiOpenFileClick(Sender: TObject);
{ This method opens a bitmap file specified by OpenDialog.FileName. If
  a file was already created, the user is prompted to save
  the file in which case the mmiSaveFileClick event is called. }
var
  Rslt: Word;
begin

  if OpenDialog.Execute then
  begin

    if Modified then begin
      Rslt := MessageDlg('File has changed, save?', mtConfirmation, mbYesNOCancel, 0);
      case Rslt of
        mrYes: mmiSaveFileClick(nil);
        mrNo: ;  // no need to do anything.
        mrCancel: Exit;
      end
    end;

    imgDrawingPad.Picture.LoadFromFile(OpenDialog.FileName);
    FileName := OpenDialog.FileName;
    stbMain.Panels[0].Text := FileName;
    Modified := false; 
  end;

end;

procedure TMainForm.mmiEditClick(Sender: TObject);
{ The timer is used to determine if an area on the main image is
  surrounded by a bounding rectangle. If so, then the Copy and Cut
  menu items are enabled. Otherwise, they are disabled. }
var
  IsRect: Boolean;
begin
  IsRect := (MouseOrg.X <> NextPoint.X) and (MouseOrg.Y <> NextPoint.Y);
  if (DrawType = dtClipRect) and IsRect then
  begin
    mmiCut.Enabled := True;
    mmiCopy.Enabled := True;
  end
  else begin
    mmiCut.Enabled := False;
    mmiCopy.Enabled := False;
  end;
end;

procedure TMainForm.CopyCut(Cut: Boolean);
{ This method copies a portion of the main image to the clipboard.
  The portion copied is specified by a bounding rectangle
  on the main image. If Cut is true, the area in the bounding rectandle
  is erased. }
var
   CopyBitMap: TBitmap;
   DestRect, SrcRect: TRect;
   OldBrushColor: TColor;
begin
  CopyBitMap := TBitMap.Create;
  try
    { Set CopyBitmap's size based on the coordinates of the
      bounding rectangle }
    CopyBitMap.Width := Abs(NextPoint.X - MouseOrg.X);
    CopyBitMap.Height := Abs(NextPoint.Y - MouseOrg.Y);
    DestRect := Rect(0, 0, CopyBitMap.Width, CopyBitmap.Height);
    SrcRect := Rect(Min(MouseOrg.X, NextPoint.X)+1,
                    Min(MouseOrg.Y, NextPoint.Y)+1,
                    Max(MouseOrg.X, NextPoint.X)-1,
                    Max(MouseOrg.Y, NextPoint.Y)-1);
    { Copy the portion of the main image surrounded by the bounding
      rectangle to the Windows clipboard }
    CopyBitMap.Canvas.CopyRect(DestRect, imgDrawingPad.Canvas, SrcRect);
    { Previous versions of Delphi required the bitmap's Handle property
      to be touched for the bitmap to be made available. This was due to
      Delphi's caching of bitmapped images. The step below may not be
      required. }
    CopyBitMap.Handle;
    // Assign the image to the clipboard.
    ClipBoard.Assign(CopyBitMap);
    { If cut was specified the erase the portion of the main image
      surrounded by the bounding Rectangle }
    if Cut then
      with imgDrawingPad.Canvas do
      begin
        OldBrushColor := Brush.Color;
        Brush.Color := clWhite;
        try
          FillRect(SrcRect);
        finally
          Brush.Color := OldBrushColor;
        end;
      end;
  finally
    CopyBitMap.Free; 
  end;
end;

procedure TMainForm.mmiCutClick(Sender: TObject);
begin
  CopyCut(True);
end;

procedure TMainForm.mmiCopyClick(Sender: TObject);
begin
  CopyCut(False); 
end;

procedure TMainForm.mmiPasteClick(Sender: TObject);
{ This method pastes the data contained in the clipboard to the
  paste bitmap. The reason it is pasted to the PasteBitmap, an off-
  screen bitmap, is so that the user can relocate the pasted image
  elsewhere on to the main image. This is done by having the pbPasteBox,
  a TPaintBox component, draw the contents of PasteImage. When the
  user if done positioning the pbPasteBox, the contents of TPasteBitmap
  is drawn to imgDrawingPad at the location specified by pbPasteBox's location.}
begin
  { Clear the bounding rectangle }

  pbPasteBox.Enabled := True;
  if DrawType = dtClipRect then
  begin
    DrawToImage(MouseOrg, NextPoint, pmNotXOR);
    EraseClipRect := False;
  end;

  PasteBitmap.Assign(ClipBoard);   // Grab the data from the clipboard
  Pasted := True;
  // Set position of pasted image to top left
  pbPasteBox.Left := 0;
  pbPasteBox.Top := 0;
  // Set the size of pbPasteBox to match the size of PasteBitmap
  pbPasteBox.Width := PasteBitmap.Width;
  pbPasteBox.Height := PasteBitmap.Height;

  pbPasteBox.Visible := True;
  pbPasteBox.Invalidate;           
end;

procedure TMainForm.pbPasteBoxMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
{ This method set's up pbPasteBox, a TPaintBox for being moved by the
  user when the left mouse button is held down }
begin
  if Button = mbLeft then
  begin
    PBoxMoving := True;
    Screen.Cursor := crMove;
    PBoxMouseOrg := Point(X, Y);
  end
  else
    PBoxMoving := False;
end;

procedure TMainForm.pbPasteBoxMouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
{ This method moves pbPasteBox if the PBoxMoving flag is true indicating
  that the user is holding down the left mouse button and is dragging
  PaintBox }
begin
  if PBoxMoving then
  begin
    pbPasteBox.Left := pbPasteBox.Left + (X - PBoxMouseOrg.X);
    pbPasteBox.Top := pbPasteBox.Top + (Y - PBoxMouseOrg.Y);
  end;
end;

procedure TMainForm.pbPasteBoxMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
{ This method disables moving of pbPasteBox when the user lifts the left
  mouse button }
  if PBoxMoving then
  begin
     PBoxMoving := False;
     Screen.Cursor := crDefault;
  end;
  pbPasteBox.Refresh; // Redraw the pbPasteBox.
end;

procedure TMainForm.pbPasteBoxPaint(Sender: TObject);
{ The paintbox is drawn whenever the user selects the Paste option
  form the menu. pbPasteBox draws the contents of PasteBitmap which
  holds the image gotten from the clipboard. The reason for drawing
  PasteBitmap's contents in pbPasteBox, a TPaintBox class, is so that
  the user can also move the object around on top of the main image.
  In other words, pbPasteBox can be moved, and hidden when necessary. }
var
  DestRect, SrcRect: TRect;
begin
  // Display the paintbox only if a pasting operation occurred.
  if Pasted then
  begin
    { First paint the contents of PasteBitmap using canvas's CopyRect
      but only if the paintbox is not being moved. This reduces
      flicker }
    if not PBoxMoving then
    begin
      DestRect := Rect(0, 0, pbPasteBox.Width, pbPasteBox.Height);
      SrcRect := Rect(0, 0, PasteBitmap.Width, PasteBitmap.Height);
      pbPasteBox.Canvas.CopyRect(DestRect, PasteBitmap.Canvas, SrcRect);
    end;
    { Now copy a bounding rectangle to indicate that pbPasteBox is
      a moveable object. We use a pen mode of pmNotXOR because we
      must erase this rectangle when the user copies PaintBox's
      contents to the main image and we must preserve the original
      contents. }
    pbPasteBox.Canvas.Pen.Mode := pmNotXOR;
    pbPasteBox.Canvas.Pen.Style := psDot;
    pbPasteBox.Canvas.Brush.Style := bsClear;
    pbPasteBox.Canvas.Rectangle(0, 0, pbPasteBox.Width, pbPasteBox.Height);
  end;
end;

procedure TMainForm.FormDestroy(Sender: TObject);
begin
  // Remove the form from the clipboard chain
  ChangeClipBoardChain(Handle, OldClipViewHwnd);
  PasteBitmap.Free; // Free the PasteBitmap instance
end;

procedure TMainForm.RgGrpFillOptionsClick(Sender: TObject);
begin
  FillSelected   := RgGrpFillOptions.ItemIndex = 0;
  BorderSelected := cbxBorder.Checked;
  SetDrawingStyle;
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产拍欧美日韩视频二区| 欧美日韩综合在线免费观看| 99精品黄色片免费大全| 久久精品视频网| 国内精品不卡在线| 久久综合九色综合97_久久久| 午夜久久福利影院| 久久一夜天堂av一区二区三区 | 日韩高清不卡在线| 欧美性高清videossexo| 青娱乐精品视频在线| 久久婷婷色综合| 97国产精品videossex| 亚洲卡通动漫在线| 精品久久一二三区| 久久精品国产亚洲a| 久久久久久免费毛片精品| 国产精品久线观看视频| 日日夜夜免费精品| 欧美v日韩v国产v| 91福利在线免费观看| 欧美大片在线观看一区| 精品欧美黑人一区二区三区| 精品国产成人系列| 免费在线看一区| 91精品国产综合久久婷婷香蕉| 亚洲一区二区成人在线观看| eeuss鲁片一区二区三区在线看| 久久日韩精品一区二区五区| 青青草91视频| 日韩手机在线导航| 色中色一区二区| 国产一区二区三区蝌蚪| 中文在线一区二区| 亚洲国产电影在线观看| 欧美一区二区视频在线观看2022| 成人深夜福利app| 亚洲欧美色一区| 亚洲精品在线三区| 日韩欧美精品在线视频| 欧美性猛交xxxx乱大交退制版 | 国产精品99久| 蜜桃视频在线观看一区| 亚洲成人av一区二区| 洋洋成人永久网站入口| 亚洲精品视频观看| 亚洲免费资源在线播放| 中文字幕一区二区三区四区不卡 | 亚洲视频在线一区| 精品国产1区二区| 国产精品国产三级国产aⅴ入口| 欧美日本国产视频| 日韩一级完整毛片| 777a∨成人精品桃花网| 国产成人亚洲综合色影视| 精品久久人人做人人爽| 国产精品99精品久久免费| 极品销魂美女一区二区三区| 国产制服丝袜一区| 欧美zozo另类异族| 91麻豆国产福利在线观看| 午夜精品123| 欧美一二三在线| 91成人免费在线视频| 亚洲国产综合在线| 精品理论电影在线观看| www.亚洲在线| 日韩和欧美一区二区三区| 久久久www成人免费毛片麻豆| 9色porny自拍视频一区二区| 午夜成人免费视频| 国产欧美日韩在线观看| 欧美亚洲图片小说| 日韩电影在线免费观看| 成人黄色在线网站| 精品国产第一区二区三区观看体验 | 在线观看视频一区| 这里只有精品视频在线观看| 一区二区三区四区不卡视频 | 欧美国产激情一区二区三区蜜月 | 不卡在线观看av| 26uuu精品一区二区在线观看| 一区二区三区免费在线观看| 国产成人综合网站| 国产欧美日韩精品a在线观看| 日韩中文欧美在线| 欧美精品自拍偷拍动漫精品| 亚洲美女视频一区| 91在线丨porny丨国产| 中文字幕乱码久久午夜不卡| 精品一区二区综合| 久久久精品影视| 首页国产欧美久久| 国产视频在线观看一区二区三区| 综合欧美亚洲日本| 欧美精品日韩综合在线| 中文字幕日韩av资源站| 粉嫩一区二区三区性色av| 日韩精品一区二区三区swag| 欧美久久一区二区| 午夜精品aaa| 久久蜜桃香蕉精品一区二区三区| 精品无码三级在线观看视频| 久久99久久精品欧美| 国产在线播放一区三区四| 日韩美女一区二区三区| 色婷婷综合五月| 3d成人h动漫网站入口| av电影一区二区| 粗大黑人巨茎大战欧美成人| 久久国产精品72免费观看| 日日摸夜夜添夜夜添国产精品| 一区二区三区成人| 亚洲免费在线视频| 亚洲精选一二三| 亚洲精品日韩一| 亚洲精品日日夜夜| 国产精品免费网站在线观看| 91成人免费在线视频| 美女网站色91| 无码av免费一区二区三区试看| 亚洲欧美另类在线| 久久精品在这里| 欧美精品日韩精品| av成人免费在线| 国产成人三级在线观看| 亚洲成人动漫av| 亚洲视频一区二区在线| 欧美α欧美αv大片| 欧美三级在线看| 欧美日韩在线播放三区| 在线精品亚洲一区二区不卡| 成人18视频在线播放| 97se亚洲国产综合自在线观| 国产精一品亚洲二区在线视频| 免费日本视频一区| 亚洲国产精品精华液网站| 亚洲综合无码一区二区| 亚洲欧美另类久久久精品 | 日本一区二区动态图| 欧美一级黄色大片| 欧美日韩精品免费观看视频| 欧美性色黄大片| 日韩午夜电影在线观看| 日本一区二区视频在线观看| 一个色综合网站| 午夜精品久久一牛影视| 久久精品一区二区三区四区| 欧美一区二区三区在线观看| 日韩亚洲电影在线| 国产日韩欧美精品综合| 高清不卡在线观看| 婷婷丁香激情综合| 欧美精品18+| 精品一区二区三区免费| 99久久精品国产毛片| 欧美人与z0zoxxxx视频| 2019国产精品| 亚洲影视资源网| 国产毛片精品国产一区二区三区| 色婷婷综合在线| 久久免费的精品国产v∧| 亚洲嫩草精品久久| 久久99精品久久久久久国产越南| 成人av小说网| 久久99在线观看| 95精品视频在线| 久久久www成人免费毛片麻豆 | 欧美视频一二三区| 亚洲国产高清在线| 激情亚洲综合在线| 色婷婷av一区二区三区之一色屋| 精品国产一区二区三区四区四| 亚洲综合小说图片| 不卡av在线免费观看| 日韩三级.com| 午夜久久福利影院| 91国产免费观看| 亚洲午夜一区二区三区| 色av成人天堂桃色av| 国产精品久久777777| 成人短视频下载 | 99精品国产91久久久久久| 精品国产免费一区二区三区香蕉| 亚洲丝袜制服诱惑| 欧美三级日韩三级国产三级| 最新成人av在线| 欧美色图免费看| 久久精品国产一区二区| 日韩一区二区免费在线电影| 一区二区欧美国产| 91精品婷婷国产综合久久竹菊| 韩国一区二区三区| 一级中文字幕一区二区| 亚洲国产成人私人影院tom| 欧美日韩亚洲综合| 97久久精品人人爽人人爽蜜臀| 久久av老司机精品网站导航| 欧美美女bb生活片| 亚洲国产高清不卡|