Ver Mensaje Individual
  #9  
Antiguo 02-11-2016
compuin compuin is offline
Miembro
 
Registrado: oct 2010
Posts: 230
Reputación: 16
compuin Va por buen camino
Asi lo hice

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    Image1: TImage;
    BitBtn1: TBitBtn;

    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

procedure MakeSquares(Image1: TCanvas; const pInit: TPoint;
  const ncuad, size: Integer);
var
  x, y: Integer;
  p   : TPoint;
begin
  p.Y := pInit.Y;
  for y := 1 to ncuad do
  begin
    p.X := pInit.X;
    for x := 1 to y do
    begin
      Image1.Rectangle( p.X - 1, p.Y - 1, p.X + size, p.Y + size);
      Inc( p.X, size );
    end;
    Inc( p.Y, size);
  end;
end;


{$R *.dfm}


procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  MakeSquares(Canvas, Point( 70, 30 ), 7, 20);  // <== AQUI LA ESTAS LLAMANDO
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  MakeSquares(Canvas, Point( 70, 30 ), 7, 20);  // <== AQUI LA ESTAS LLAMANDO
end;

end.

Y asi me aparece
Responder Con Cita