Ver Mensaje Individual
  #2  
Antiguo 24-11-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
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 BioStudio.

Probé el código que pusiste y quitando la sentencia: bmp.Free donde liberabas una instancia no creada funciona bién.

Lo único que omití en la prueba fue: umain.Form1, ya que la hice sobre el propio Form1.
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  bmp: TBitmap;
  i : Integer;
begin
  with TSaveDialog.Create(self) do
  try
    Title := 'Respaldo de Archivo en Formato BMP';
    InitialDir := GetCurrentDir;
    Filter := 'Texto (delimitado por tabulaciones) (*.bmp)|*.bmp';
    DefaultExt := 'bmp';
    FilterIndex := 1;
    if Execute then
    begin
      with TBitmap.Create do
      try
        Width := ListView1.Width;
        Height := ListView1.Height;
        Canvas.Lock;
        try
          ListView1.Perform(WM_PRINT, Canvas.Handle,
            PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT);
        finally
          Canvas.UnLock;
          SaveToFile(FileName)
        end
      finally
        Free
      end
    end
  finally
    Free
  end
end;

Archivo resultante:


Saludos.
__________________
Daniel Didriksen

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