首页 > 代码库 > Delphi 全局画点TCanvas.Pixels[X,Y]

Delphi 全局画点TCanvas.Pixels[X,Y]

procedure TForm1.btnChangePixelClick(Sender: TObject);var    baseX : integer ;    baseY : integer ;    i,j : integer;    c : TCanvas;begin    baseX :=100;    baseY := 100;    c := TCanvas.create;    try        c.Handle := GetDC(0);        for i := baseX - 1 to baseX + 1 do        begin            for j := baseY - 1 to baseY + 1 do            begin                c.Pixels[i,j] := RGB($FF,0,0);                //self.Canvas.Pixels[i,j] := RGB($FF,0,0);            end;        end;    finally      c.Free;    end;end;end.

  

 

Delphi 全局画点TCanvas.Pixels[X,Y]