Ver Mensaje Individual
  #1  
Antiguo 27-02-2004
dridly dridly is offline
Registrado
 
Registrado: feb 2004
Posts: 5
Reputación: 0
dridly Va por buen camino
Question PolyPolyLine

Hola! Tengo un problema. Intento hacer un programa que dibuje lineas (parece sencillo). Con el botón izquierdo va dibujando las líneas, y con el derecho deja de dibujar el trazado actual.
Lo voy almacenando todo en una array de Tpoints. Para dibujar utilizo el PolyPolyLine, pero cada vez que quiero que me dibuje no me hace nada.
El código es el siguiente:

procedure TFrmDibujo.ImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if ssLeft in Shift then//si pulsas el botón izquierdo
begin
SetLength(Element, i+1);//redimensiona la array de coordenadas
if Element[0].x=0 then
begin
Element[0].x:=X;Element[0].y:=Y;
end else
begin
Element[i].x:=X;Element[i].y:=Y;
end;
Inc(i);
end
else //SI PULSAS EL BOTÓN DERECHO
begin
SetLength(NumElements, j+1);
NumElements[j]:=i;
Inc(j);
PolyPolyline(Image.Canvas.Handle, Element, NumElements, j);
end;
end;


Cuando pulsas el botón derecho le digo que dibuje, pero no lo hace. Alguien me puede decir a que es debido???
Gracias!
Responder Con Cita