zoukankan      html  css  js  c++  java
  • Image1.Canvas画图笔刷

     
    如何背景透明
     
     
     
    unit Unit1;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;

    type
      TForm1 = class(TForm)
        Image1: TImage;
        procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
          Y: Integer);
        procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

      pt:tpoint;
      Move:integer ;
    implementation

    {$R *.dfm}

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      with Image1.Canvas do
      begin
         Pen.Width:=10;
         Pen.Color:=clRed;
         brush.Style:=bsCross;


         //透明
      end;
    end;

    procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      move:=1;
      pt.x:=x;
      pt.Y:=y;
    end;

    procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      if move<>0 then
      begin
        Image1.Canvas.MoveTo(pt.X,pt.Y);
        Image1.Canvas.LineTo(x,y);
        pt.X:=x;
        pt.Y:=y;
      end;
    end;

    procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
        Move:=0;
    end;

    end.




  • 相关阅读:
    Html5结构相关元素
    html5文本元素
    html5全局属性
    元数据元素总结
    千里之行,始于足下
    换个角度思考
    java的权限修饰符
    四则运算
    测量软件使用感受
    JQuery高级
  • 原文地址:https://www.cnblogs.com/xe2011/p/3876047.html
Copyright © 2011-2022 走看看