Advertisement
Advertisement
| 06.18.2008 at 09:10AM PDT, ID: 23495805 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: |
bool CScanDialog::PDFAddPicturePage(HDIB hDIB)
{
HPDF_Page page;
HPDF_Image image;
BYTE * BGRimage;
BGRimage = (BYTE *) GlobalLock(hDIB);
/*
typedef struct tagBITMAPINFOHEADER{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
*/
long img_width = * (BGRimage + 1 * sizeof(DWORD) + 3); img_width *= 0x100;
img_width += * (BGRimage + 1 * sizeof(DWORD) + 2); img_width *= 0x100;
img_width += * (BGRimage + 1 * sizeof(DWORD) + 1); img_width *= 0x100;
img_width += * (BGRimage + 1 * sizeof(DWORD) );
long img_height = * (BGRimage + 1 * sizeof(DWORD) + 1 * sizeof(long) +3);img_height *= 0x100;
img_height += * (BGRimage + 1 * sizeof(DWORD) + 1 * sizeof(long) +2);img_height *= 0x100;
img_height += * (BGRimage + 1 * sizeof(DWORD) + 1 * sizeof(long) +1);img_height *= 0x100;
img_height += * (BGRimage + 1 * sizeof(DWORD) + 1 * sizeof(long) +0);
DWORD img_header_length = * (BGRimage +1); img_header_length *= 0x100;
img_header_length += * (BGRimage);
BGRimage += img_header_length; // Offset of the header
BGRimage += (0xFF * 4); // Offset of the color table
/*Here some code that writes the image to a pdf file*/
}
|