Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Gráficos
Register FAQ Members List Calendar Guía de estilo Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26/10/2010
hgiacobone's Avatar
hgiacobone hgiacobone is offline
Miembro
 
Join Date: May 2003
Location: La Plata, Bs. As., Argentina
Posts: 165
Poder: 24
hgiacobone Va por buen camino
Question Screenshot de un TPanel

Hola amigos,
He visto muchos ejemplos de cómo hacer una captura del Desktop, de la Ventana actual e incluso del Form actual y almacenarlo luego en un archivo BMP tal cual un screenshot ordinario, pero la cosa es que yo necesito capturar solamente lo que se encuentra contenido en un TPanel especifico dentro de mi Form activo, que de por sí, tienen varios TPanel.
¿Es posible capturar solamente el contenido de un TPanel determinado?

Saludos,
__________________
Gracias de antemano por vuestra ayuda.
·.:*:.·Yako·.:*:.·
Reply With Quote
  #2  
Old 26/10/2010
delphi.com.ar's Avatar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Join Date: May 2003
Location: Buenos Aires, Argentina *
Posts: 5,964
Poder: 29
delphi.com.ar Va camino a la fama
Código Delphi [-]
var
  DC : HDC;
  bmp: TBitmap;
begin
  dc := GetWindowDC(Panel1.Handle);
  bmp := TBitmap.Create;
  try
    bmp.Width := Panel1.Width;
    bmp.Height := Panel1.Height;
    BitBlt(bmp.Canvas.Handle, 0, 0, bmp.Width, bmp.Height, DC, 0, 0, SRCCOPY);
    bmp.SaveToFile('c:\temp.bmp');
  finally
    bmp.Free;
    ReleaseDC(Panel1.Handle, DC);
  end;
end;

Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Reply With Quote
  #3  
Old 26/10/2010
javier7ar's Avatar
javier7ar javier7ar is offline
Miembro
 
Join Date: Apr 2006
Location: Argentina
Posts: 124
Poder: 21
javier7ar Va por buen camino
Tambien podes usar la funcion PaintTo que tienen todos los TWinControl. Si te fijas en la ayuda de PaintTo explica incluso como pintar el control directamente sobre la impresora para imprimirlo.

Código Delphi [-]
var
  bmp: TBitmap;
begin
  bmp := TBitmap.Create;
  try
    bmp.Width := Panel1.Width;
    bmp.Height := Panel1.Height;
    Panel1.PaintTo(bmp.Canvas.Handle,0,0);
    bmp.SaveToFile('c:\temp.bmp');
  finally
    bmp.Free;
  end;
end;

Saludos
Reply With Quote
  #4  
Old 28/10/2010
hgiacobone's Avatar
hgiacobone hgiacobone is offline
Miembro
 
Join Date: May 2003
Location: La Plata, Bs. As., Argentina
Posts: 165
Poder: 24
hgiacobone Va por buen camino
Thumbs up Gracias

Gracias muchachos por sus amables respuestas.
__________________
Gracias de antemano por vuestra ayuda.
·.:*:.·Yako·.:*:.·
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbars en un TPanel acertij022 Varios 2 19/02/2009 14:35
Tpanel oab_boa C++ Builder 2 27/12/2008 04:20
TPanel sin transaparencia Khronos Varios 1 02/06/2008 03:19
ControlCount de un TPanel salvica OOP 3 05/09/2007 18:53
OnMouseWheel en TPanel metalfox6383 Varios 3 03/07/2006 20:15


All times are GMT +2. The time now is 02:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi