![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#4
|
|||
|
|||
|
segun claude prueba esto:
Código:
#include <jpeg.hpp>
void __fastcall TForm1::DetailBand1BeforePrint(TQRCustomBand *Sender, bool &PrintBand)
{
ImgInf->Picture->Assign(NULL); // evita que se arrastre la imagen del registro anterior
TBlobField *campo = dynamic_cast<TBlobField*>(Query->FieldByName("Caratula"));
if (campo == NULL || campo->IsNull)
return;
TMemoryStream *ms = new TMemoryStream;
try
{
campo->SaveToStream(ms);
if (ms->Size < 4)
return;
unsigned char cab[4];
ms->Position = 0;
ms->ReadBuffer(cab, 4);
ms->Position = 0;
if (cab[0] == 0xFF && cab[1] == 0xD8) // JPEG
{
TJPEGImage *jpg = new TJPEGImage;
try
{
jpg->LoadFromStream(ms);
Graphics::TBitmap *bmp = new Graphics::TBitmap;
try
{
bmp->Assign(jpg); // convertimos a BMP: QR lo imprime sin problemas
ImgInf->Picture->Assign(bmp);
}
__finally { delete bmp; }
}
__finally { delete jpg; }
}
else if (cab[0] == 'B' && cab[1] == 'M') // BMP
{
ImgInf->Picture->Bitmap->LoadFromStream(ms);
}
// Otros formatos (PNG, GIF...) no los soporta BCB6 de serie: se deja la imagen vacía
}
__finally
{
delete ms; // en tu código original el stream no se liberaba nunca
}
}
|
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Ocultar TQRimage al imprimir reporte (QuickReport) | Theluar | Impresión | 6 | 09-05-2013 00:32:32 |
| Mostrar imagen en el TQRImage de un Qreport | ingabraham | Varios | 0 | 06-11-2012 16:10:21 |
| Mantener aspecto de un TQRImage | cincosoft | Impresión | 3 | 10-09-2011 10:56:51 |
| Graficos TQRImage y final de página | Cabanyaler | Impresión | 1 | 12-02-2010 11:50:07 |
| problemas con el TQRImage? | judoboy | Impresión | 1 | 19-05-2003 14:59:11 |
|