Ver Mensaje Individual
  #2  
Antiguo 23-02-2005
ramonibk ramonibk is offline
Miembro
 
Registrado: may 2004
Posts: 193
Reputación: 21
ramonibk Va por buen camino
Bueno igual que a mi me a echo falta supongo que alguno mas lo puede necesitar por lo cual pongo lo que he echo espero que sea util
Código:
procedure CargaBmp( Fichero: string; const QueImage: TImage);
var
 ElBmp		: TBitmap;
 Rectangulo   : TRect;
 EscalaX,
 EscalaY,
 Escala	   : Single;
begin
 ElBmp:=TBitmap.Create;
 try
  ElBmp.LoadFromFile( Fichero );
  EscalaX := 1.0;
  EscalaY := 1.0;
   if QueImage.Width < ElBmp.Width then
	EscalaX := QueImage.Width / ElBmp.Width;
   if QueImage.Height < ElBmp.Height then
		EscalaY := QueImage.Height / ElBmp.Height;
   if EscalaY < EscalaX then Escala:=EscalaY else Escala:=EscalaX;
   with Rectangulo do begin
	Right:=Trunc(ElBmp.Width * Escala);
	Bottom:=Trunc(ElBmp.Height * Escala);
	Left:=0;
	Top:=0;
	end;
 with QueImage.Picture.Bitmap do begin
  Width  := Rectangulo.Right;
  Height := Rectangulo.Bottom;
  Canvas.StretchDraw( Rectangulo,ElBmp );
 End;
finally
 ElBmp.Free;
end;
Responder Con Cita