FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#2
|
|||
|
|||
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! |
|
|
|