Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-02-2008
Avatar de Crandel
[Crandel] Crandel is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Parana, Argentina
Posts: 1.475
Poder: 25
Crandel Va por buen camino
Mira el demo que trae delphi llamado Graphex, te va a resultar de gran ayuda.

Suerte
__________________
[Crandel]
Responder Con Cita
  #2  
Antiguo 14-02-2008
Avatar de PeterPunk
PeterPunk PeterPunk is offline
Miembro
 
Registrado: ene 2008
Ubicación: Vigo
Posts: 22
Poder: 0
PeterPunk Va por buen camino
Código Delphi [-]
procedure TForm1.FormCreate(Sender: TObject);
begin
  Image1.Canvas.Brush.Color := Form1.Color;
end;
procedure TForm1.Image1MouseLeave(Sender: TObject);
begin
  Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var
  Puntos: array [0..2] of TPoint;
begin
  Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
  Puntos[0].X := 0;
  Puntos[0].Y := Y;
  Puntos[1].X := X;
  Puntos[1].Y := Y;
  Puntos[2].X := X;
  Puntos[2].Y := 0;
  image1.Canvas.Polyline(Puntos);
end;

EDITO:
Evidentemente lo que he hecho es repintar la imagen con el color del fondo del formulario. Pero si lo que quieres es dibujar sobre un gráfico (que la imagen que uses tenga algún objeto cargado en Picture) debería ser algo más parecido a esto:
Código Delphi [-]
implementation

{$R *.dfm}

var
  MiDibujo: TPicture;

procedure TForm1.FormCreate(Sender: TObject);
begin
  MiDibujo := TPicture.Create;
  MiDibujo.LoadFromFile('D:\Delphi3\MartianMouse.bmp');
  Image1.Width := MiDibujo.Width;
  Image1.Height := MiDibujo.Height;
  Image1.Canvas.Draw(0, 0, MiDibujo.Graphic);
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  With Image1.Canvas do
    begin
      Draw(0, 0, MiDibujo.Graphic);
      MoveTo(0, Y);
      LineTo(Image1.Width, Y);
      MoveTo(X, 0);
      LineTo(X, Image1.Height);
    end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  MiDibujo.Free;
end;

end.

Última edición por PeterPunk fecha: 14-02-2008 a las 14:55:16.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ejes 4, 5 y 6 del joystick paldave API de Windows 1 02-10-2007 20:17:35
Coordenadas en el PaintBox fabiof2000 Gráficos 2 27-09-2006 11:08:03
pasar coordenadas gps a coordenadas builder iaav1 C++ Builder 3 03-07-2006 20:59:02
Representar coordenadas 3D blueicaro OOP 5 20-04-2006 18:03:14
Pintar una elipte dada dos coordenadas, sin utilizar la funcion que viene en delphi Richard Gráficos 4 09-05-2004 19:35:51


La franja horaria es GMT +2. Ahora son las 10:02:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi