Ver Mensaje Individual
  #4  
Antiguo 18-02-2005
ramonibk ramonibk is offline
Miembro
 
Registrado: may 2004
Posts: 193
Reputación: 20
ramonibk Va por buen camino
aver si entiendo lo que quieres.

es que en la visualizacion de la imagen esta te salga del tamaño que tu quieres sim perder la nitidez. es eso???


Bueno te pongo el codigo que yo uso para ver imagenes aver si te sirve


Código:
procedure CargaJPGProporcionado( Fichero: string; const QueImage: TImage);
var
ElJPG		: TJpegImage;
Rectangulo : TRect;
EscalaX,
EscalaY,
Escala	 : Single;
begin
ElJPG:=TJPegImage.Create;
try
ElJPG.LoadFromFile( Fichero );
//Por defecto, escala 1:1
EscalaX := 1.0;
EscalaY := 1.0;
//Hallamos la escala de reducción Horizontal
if QueImage.Width < ElJPG.Width then
	EscalaX := QueImage.Width / ElJPG.Width;
//La escala vertical
if QueImage.Height < ElJPG.Height then
		EscalaY := QueImage.Height / ElJPG.Height;
//Escogemos la menor de las 2
if EscalaY < EscalaX then Escala:=EscalaY else Escala:=EscalaX;
//Y la usamos para reducir el rectangulo destino
with Rectangulo do begin
	Right:=Trunc(ElJPG.Width * Escala);
	Bottom:=Trunc(ElJPG.Height * Escala);
	Left:=0;
	Top:=0;
	end;
//Dibujamos el bitmap con el nuevo tamaño en el TImage destino
with QueImage.Picture.Bitmap do begin
Width := Rectangulo.Right;
Height := Rectangulo.Bottom;
Canvas.StretchDraw( Rectangulo,ElJPG );
End;
finally
ElJPG.Free;
end;
Bueno se me olvido decir que esto lo tome de Trucomania http://www.q3.nu/
a los cual les doy las gracias
Espero que te sea util

Última edición por ramonibk fecha: 23-02-2005 a las 18:41:37.
Responder Con Cita