Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 01-05-2006
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 20
FGarcia Va por buen camino
PictureBox

Hola a todos!

una pregunta "simple" en VB existe un control llamado PictureBox (he visto que realizan graficas de tendencias (trend) con el) cual seria su equivalente en Delphi7.

Un ejemplo de codigo de uso del PictureBox

' Graph the PV, Process Variable
Picture1.Cls
pvgraph(100) = pv
For x = 0 To 99
pvgraph(x) = pvgraph(x + 1)
Picture1.PSet (x, 3000 - (pvgraph(x)))
Next x

Gracias por la ayuda!
Responder Con Cita
  #2  
Antiguo 02-05-2006
Delfino Delfino is offline
Miembro
 
Registrado: jul 2003
Ubicación: Madrid
Posts: 974
Poder: 22
Delfino Va por buen camino
Has mirado el componente PaintBox de Delphi?
__________________
¿Microsoft? No, gracias..
Responder Con Cita
  #3  
Antiguo 04-05-2006
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 20
FGarcia Va por buen camino
Hola!

No encuentro ese componente (PaintBox) en delphi 7. ¿Alguna pista?
Responder Con Cita
  #4  
Antiguo 04-05-2006
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por FGarcia
¿Alguna pista?
Pestaña System de la paleta de herramientas.

// Saludos
Responder Con Cita
  #5  
Antiguo 04-05-2006
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 20
FGarcia Va por buen camino
Gracias!

Esta tan simple el icono que lo ignoraba, solo veia el TTimer y el TmediaPlayer
Nuevamente Gracias
Responder Con Cita
  #6  
Antiguo 05-05-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Poder: 29
Lepe Va por buen camino
Yo directamente no uso la paleta... Menú de delphi View --> Component Palete --> escribir: TPaintBox. Claro que lo tengo en la barra de herramientas para no tener que acceder al menú.

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita
  #7  
Antiguo 05-05-2006
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 20
FGarcia Va por buen camino
Uff! Que sigue con PaintBox?

Saludos !
Pues siguiendo el consejo investigue un poco del PaintBox en delphi 7 y llegue a esto:


Código Delphi [-]
unit Plot;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, ComCtrls;
type
  TForm1 = class(TForm)
    Plotter: TPaintBox;
    tbSetpoint: TTrackBar;
    tbProceso: TTrackBar;
    tbSalida: TTrackBar;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Timer1: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure PlotterPaint(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
  x, y: integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
 tbsetpoint.Position := 75;
 tbProceso.Position := 50;
 tbSalida.Position := 25;
 Label1.Color := clBlack;
 Label2.Color := clBlack;
 Label3.Color := clBlack;
 Label1.Font.Color := clYellow;
 Label2.Font.Color := clLime;
 Label3.Font.Color := clRed;
 Label1.Caption := 'Setpoint:' + ' ' + IntTostr( tbSetpoint.Position );
 Label2.Caption := 'Proceso:' + ' ' + IntTostr( tbSetpoint.Position );
 Label3.Caption := 'Salida:' + ' ' + IntTostr( tbSetpoint.Position );
 with Plotter.Canvas do
  begin
    Brush.Color := clBlack;
    Pen.Width := 5;
    FillRect(Plotter.Canvas.ClipRect );
    Rectangle(48,20,Width, Height);
  end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  //incremento en 1 la posicion en el eje de las X
  x := x + 1;
  //Verificamos si los valores cambiaron y dibujamos
  Label1.Caption := 'Setpoint:' + IntTostr( tbSetpoint.Position );
  Plotter.Canvas.Pixels[x, Plotter.Height - (tbSetpoint.Position * 2)] := clYellow;
  Label2.Caption := 'Proceso:' + IntTostr( tbProceso.Position );
  Plotter.Canvas.Pixels[x, Plotter.Height - (tbProceso.Position * 2)] := clLime;
  Label3.Caption := 'Salida:' + IntTostr( tbSalida.Position );
  Plotter.Canvas.Pixels[x, Plotter.Height - (tbSalida.Position * 2)] := clRed;
end;
procedure TForm1.PlotterPaint(Sender: TObject);
begin
   Plotter.Canvas.Rectangle (0,0,Width, Height);
   Plotter.Canvas.Pixels[x, Plotter.Height - (tbSetpoint.Position * 2)] := clYellow;
   Plotter.Canvas.Pixels[x, Plotter.Height - (tbProceso.Position * 2)] := clLime;
   Plotter.Canvas.Pixels[x, Plotter.Height - (tbSalida.Position * 2)] := clRed;
end;
 
end.




El Form:


Código Delphi [-]
object Form1: TForm1
  Left = 248
  Top = 187
  Width = 400
  Height = 272
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Plotter: TPaintBox
    Left = 8
    Top = 8
    Width = 210
    Height = 200
    Color = clBlack
    ParentColor = False
    OnPaint = PlotterPaint
  end
  object Label1: TLabel
    Left = 240
    Top = 8
    Width = 39
    Height = 13
    Caption = 'Setpoint'
  end
  object Label2: TLabel
    Left = 240
    Top = 72
    Width = 39
    Height = 13
    Caption = 'Proceso'
  end
  object Label3: TLabel
    Left = 240
    Top = 136
    Width = 29
    Height = 13
    Caption = 'Salida'
  end
  object tbSetpoint: TTrackBar
    Left = 232
    Top = 24
    Width = 150
    Height = 45
    LineSize = 2
    Max = 100
    TabOrder = 0
  end
  object tbProceso: TTrackBar
    Left = 232
    Top = 88
    Width = 150
    Height = 45
    LineSize = 2
    Max = 100
    TabOrder = 1
  end
  object tbSalida: TTrackBar
    Left = 232
    Top = 152
    Width = 150
    Height = 45
    LineSize = 2
    Max = 100
    TabOrder = 2
  end
  object Timer1: TTimer
    Interval = 500
    OnTimer = Timer1Timer
    Left = 24
    Top = 16
  end
end




y Bueno ya dibuja los puntos que quiero, ahora bien cuando llega el trazo hasta el final del PaintBox ¿como hago para que lo que ya esta dibujado se desplaze hacia la izquierda y me permita seguir viendo los nuevos trazos?

Sinceramente ya no le encuentro! Gracias por la atencion y la ayuda!!

Última edición por roman fecha: 06-05-2006 a las 07:47:59.
Responder Con Cita
  #8  
Antiguo 06-05-2006
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
FGarcia, edité tu mensaje anterior para corregir las etiquetas [delphi]. No sé cómo las colocaste que se perdieron.

// Saludos
Responder Con Cita
Respuesta



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


La franja horaria es GMT +2. Ahora son las 22:55:05.


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