Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-11-2014
Arnol125 Arnol125 is offline
Registrado
NULL
 
Registrado: nov 2014
Posts: 7
Poder: 0
Arnol125 Va por buen camino
Visor de Imágenes Delphi 7

Buenos dias,

tengo este código para visualizar imágenes JPG, pero tiene un problema que no muestra la imagen el en componente Image1

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FileCtrl, ExtCtrls, Buttons;

type
  TImageForm = class(TForm)
    DirectoryListBox1: TDirectoryListBox;
    FileListBox1: TFileListBox;
    DriveComboBox1: TDriveComboBox;
    Panel1: TPanel;
    Image1: TImage;
    Bevel1: TBevel;
    stretchcheck: TCheckBox;
    BitBtn1: TBitBtn;
    FileEdit: TEdit;
    ViewBtn: TButton;
    Label1: TLabel;
    procedure FileListBox1Click(Sender: TObject);
    procedure stretchcheckClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure ViewBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ImageForm: TImageForm;

implementation

uses Unit2;

{$R *.dfm}


procedure TImageForm.FileListBox1Click(Sender: TObject); //creo que aqui esta el error
var
  FileExt: string[4];
begin
  FileExt := UpperCase(ExtractFileExt(FileListBox1.Filename));
  if (fileExt='.jpg') then
  begin
  Image1.Picture.LoadFromFile(FileListBox1.Filename); // cargar imagen en el image1
  Label1.Caption:=extractfilename(filelistbox1.FileName); // cargar nombre del archivo en el label

  end;
end;

procedure TImageForm.stretchcheckClick(Sender: TObject);
begin
image1.stretch:=stretchcheck.checked; // ajustar tamaño de imagen al tamaño del image1
end;

procedure TImageForm.BitBtn1Click(Sender: TObject);
begin
close;
end;

procedure TImageForm.ViewBtnClick(Sender: TObject);
begin
 ViewForm.HorzScrollBar.Range := Image1.Picture.Width; // ampliar la imagen en una nueva mas grande
  ViewForm.VertScrollBar.Range := Image1.Picture.Height;
  ViewForm.Caption := Caption;
  ViewForm.Show;
  ViewForm.WindowState := wsNormal;
end;

end.

Última edición por roman fecha: 26-11-2014 a las 18:06:24. Razón: Agregar etiqueta [delphi]
Responder Con Cita
 



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
Como ver un PDF en un Visor de Imagenes shoulder Varios 3 20-01-2014 04:14:14
¿como hacer con javascript visor de imagenes? JXJ HTML, Javascript y otros 3 20-08-2011 17:38:49
visor de imagenes MOCOSO07 Conexión con bases de datos 3 02-12-2009 17:04:44
Visor de imágenes jpg yekkita Gráficos 2 17-10-2006 06:45:52
Visor de imagenes .PGM emeceuy Gráficos 1 04-11-2004 23:41:07


La franja horaria es GMT +2. Ahora son las 06:57:14.


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