Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 18-02-2015
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola shoulder.

Te pongo una idea que tal vez te simplifique el mostrado:
Código Delphi [-]
unit Unit2;

interface

uses Classes,StdCtrls, ExtCtrls;

type
  TLabeledImage = class(TImage)
  private
    FLabel: TLabel;
  protected
    procedure Paint; override;
  public
    constructor Create(AOwner: TComponent); override;
    property aLabel: TLabel read FLabel write FLabel;
  end;

implementation

constructor TLabeledImage.Create(AOwner: TComponent);
begin
  inherited;
  FLabel:= TLabel.Create(Self);
end;

procedure TLabeledImage.Paint;
begin
  inherited;
  FLabel.Left:= Left + (Width-FLabel.Width) shr 1;
  FLabel.Top := Top + Height + 5;
  FLabel.Parent:= Parent;
end;
end.

Prueba:
Código Delphi [-]
...
uses Jpeg, Unit2;

procedure TForm1.btnShowClick(Sender: TObject);
var
  lbimg: TLabeledImage;
  i,j,x,y: Integer;
begin
  y:= 10;
  for i:= 1 to 3 do
  begin
    x:= 10;
    for j:= 1 to 4 do
    begin
      lbimg:= TLabeledImage.Create(Self);
      lbimg.Picture.LoadFromFile('delphi.jpg');
      lbimg.aLabel.Caption:= 'delphi.jpg';
      lbimg.Width := 120;
      lbimg.Height:= 120;
      lbimg.Left  := x;
      lbimg.Top   := y;
      lbimg.Stretch:= True;
      lbimg.Parent := ScrollBox1;
      Inc(x, lbimg.Width + 10);
    end;
    Inc(y, lbimg.Height + lbimg.aLabel.Height + 10);
  end;
end;

Muestra:


En las pruebas funcionó bién, pero hice el código sobre la marcha, así que seguramente podrás mejorarlo con algunos ajustes.

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 18-02-2015 a las 19:01:05.
Responder Con Cita
 


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
El objeto image sobre otra image CarlosAlberto Varios 2 26-01-2013 00:27:54
Vaciar ScrollBox MaMu Varios 2 13-05-2008 06:46:16
Ayuda con ScrollBox... BuenaOnda Varios 9 04-08-2007 04:03:02
Scrollbox Walcasar OOP 2 07-11-2006 12:37:28
ScrollBox altp Varios 0 16-09-2004 11:55:48


La franja horaria es GMT +2. Ahora son las 16:22:24.


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