![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
Imprmir TreeView
Hola amigos!!!
Necesito imprimir un TreeView. En la web encontre este codigo de dephi, pero no lo puedo traducir a Builder c++, no se que significa WM_PRINT, etc.. A ver si alguine me da una mano Saldudos Código:
var
bmp: TBitmap;
begin
bmp := TBitmap.Create;
try
bmp.Width := TreeView1.Width;
bmp.Height := TreeView1.Height;
bmp.Canvas.Lock;
try
TreeView1.Perform(WM_PRINT, bmp.Canvas.Handle, PRF_CHILDREN or
PRF_CLIENT or PRF_NONCLIENT);
finally
bmp.Canvas.UnLock;
bmp.SaveToFile('d: ree.bmp')
end;
finally
bmp.Free
end;
end;
|
|
#2
|
|||
|
|||
|
Algo resolvi pero me sigue sin andar
Código:
Graphics::TBitmap *bmp = new Graphics::TBitmap;
bmp->Width = TreeView1->Width;
bmp->Height = TreeView1->Height;
bmp->Canvas->Lock();
TreeView1->Perform(100, (int ) bmp->Canvas->Handle, 100);
bmp->Canvas->Unlock();
bmp->SaveToFile("c:\dibujo.txt");
|
|
#3
|
|||
|
|||
|
Resuelto
Hola amigos, aca les mando el codigo q me funciona, espero q les sirva...
Nicocer.....el q se auto-contesta Código:
Graphics::TBitmap *bmp = new Graphics::TBitmap;
TreeView1->Width=TreeView1->Width+500;
TreeView1->Height=TreeView1->Height+500;
bmp->Width = TreeView1->Width;
bmp->Height = TreeView1->Height;
bmp->Canvas->Lock();
TreeView1->Perform(WM_PRINT,(int)bmp->Canvas->Handle, PRF_CLIENT );
bmp->SaveToFile("c:/dibujo.bmp");
TreeView1->Width=TreeView1->Width-500;
TreeView1->Height=TreeView1->Height-500;
bmp->Free();
Última edición por nicocer fecha: 09-11-2004 a las 13:26:25. |
![]() |
|
|
|