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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 29-01-2009
Avatar de thelibmx
thelibmx thelibmx is offline
Miembro
 
Registrado: mar 2007
Posts: 515
Poder: 18
thelibmx Va por buen camino
Lightbulb imagenes tif

Hola compañeros, he estado buscando en el club sobre como mostrar imagenes tif y no encontre nada, tal ves no hize la busqueda bien, en fin, ocupe otro codigo y una funcion que encontre para poder vizualizar las imagenes tif, pero tengo un problema, adapte la funcion como venia y me deja ver las imagenes tif en el timage, pero manejo mas de 1000 imagenes, entonces llega un punto en el que me sale el siguiente mensaje

Código Delphi [-]
raise Exception.Create('Unable to create TBitmap buffer');

esto tiene su origen en esta parte de codigo

Código Delphi [-]

function ReadTiffIntoBitmap(Filename: String): TBitmap;
var
  OpenTiff: PTIFF;
  FirstPageWidth,FirstPageHeight: Cardinal;
  FirstPageBitmap: TBitmap;
begin
  OpenTiff:=TIFFOpen(Filename,'r');
  if OpenTiff=nil then raise Exception.Create(
           'No se puede abrir el archivo '''+Filename+'''');
  TIFFGetField(OpenTiff,TIFFTAG_IMAGEWIDTH,@FirstPageWidth);
  TIFFGetField(OpenTiff,TIFFTAG_IMAGELENGTH,@FirstPageHeight);
  FirstPageBitmap:=nil;
  try
    FirstPageBitmap:=TBitmap.Create;
    FirstPageBitmap.PixelFormat:=pf32bit;
    FirstPageBitmap.Width:=FirstPageWidth;
    FirstPageBitmap.Height:=FirstPageHeight;
  except
    if FirstPageBitmap<>nil then FirstPageBitmap.Destroy;
    TIFFClose(OpenTiff);
    raise Exception.Create('Unable to create TBitmap buffer');
  end;
  TIFFReadRGBAImage(OpenTiff,FirstPageWidth,FirstPageHeight,
               FirstPageBitmap.Scanline[FirstPageHeight-1],0);
  TIFFClose(OpenTiff);
  TIFFReadRGBAImageSwapRB(FirstPageWidth,FirstPageheight,
               FirstPageBitmap.Scanline[FirstPageHeight-1]);
  Result:=FirstPageBitmap;
end;
y la imagen la mando llamar con esto
Código Delphi [-]
Image1.Picture.Bitmap.Assign(ReadTiffIntoBitmap(ubicacion));


no entiendo que es lo que hace que salga ese mensaje, podrian darme una pista de que podria ser y como podria solucionarse,se que es tal ves algo con la memoria pero todavia no ubico bien, o si conocen alguna manera de ver las imagenes tif con componentes que tenga delphi les estare agradecido.

uso delphi2006

Les agradezco su atencion y todos los tips que me puedan dar
__________________
En movimiento...
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Imágenes en FF Io HTML, Javascript y otros 2 17-02-2007 01:07:30
Imagenes mahlon Varios 8 26-08-2006 14:58:53
Imagenes JPG PTW Gráficos 1 08-04-2004 21:18:20
Uso de imagenes deimonio Varios 1 13-10-2003 08:15:05
Imagenes *.sid Gabriel Gráficos 0 09-09-2003 11:25:49


La franja horaria es GMT +2. Ahora son las 02:00:29.


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