From: Tony on
Hi,

I'm having a problem when printing out a bitmap, having wrestled with
getting it to print where I want it to, the bitmap gets drawn upside down!!!
The same code prints an icon in the correct orientation on the opposite side
of the page.

My code is relatively simple, but I cannot see what will cause the bitmap to
invert itself - any ideas?

// Draw the second bitmap
m_bMyBitmap.LoadBitmap(IDB_MY_BITMAP) ;
m_pdcMemory->SelectObject(&m_bMyBitmap);
m_bMyBitmap.GetBitmap(&bmpInfo);
nX = rBorder.left + (rBorder.Width() / 2) - (bmpInfo.bmWidth / 2);
nY = rBorder.top + (rBorder.Height() / 2) - (bmpInfo.bmHeight / 2);
pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, m_pdcMemory, 0, 0,
SRCCOPY);


TIA

Tony



From: Mikel on
On 4 nov, 12:28, "Tony" <t...(a)home.com> wrote:
> Hi,
>
> I'm having a problem when printing out a bitmap, having wrestled with
> getting it to print where I want it to, the bitmap gets drawn upside down!!!
> The same code prints an icon in the correct orientation on the opposite side
> of the page.
>
> My code is relatively simple, but I cannot see what will cause the bitmap to
> invert itself - any ideas?
>
> // Draw the second bitmap
> m_bMyBitmap.LoadBitmap(IDB_MY_BITMAP) ;
> m_pdcMemory->SelectObject(&m_bMyBitmap);
> m_bMyBitmap.GetBitmap(&bmpInfo);
> nX = rBorder.left + (rBorder.Width() / 2) - (bmpInfo.bmWidth / 2);
> nY = rBorder.top + (rBorder.Height() / 2) - (bmpInfo.bmHeight / 2);
> pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, m_pdcMemory, 0, 0,
> SRCCOPY);
>
> TIA
>
> Tony

I think I read somewhere that bitmaps are stored upside-down.
From: Mikel on
On 4 nov, 12:42, Mikel <mikel.l...(a)gmail.com> wrote:
> On 4 nov, 12:28, "Tony" <t...(a)home.com> wrote:
>
>
>
>
>
> > Hi,
>
> > I'm having a problem when printing out a bitmap, having wrestled with
> > getting it to print where I want it to, the bitmap gets drawn upside down!!!
> > The same code prints an icon in the correct orientation on the opposite side
> > of the page.
>
> > My code is relatively simple, but I cannot see what will cause the bitmap to
> > invert itself - any ideas?
>
> > // Draw the second bitmap
> > m_bMyBitmap.LoadBitmap(IDB_MY_BITMAP) ;
> > m_pdcMemory->SelectObject(&m_bMyBitmap);
> > m_bMyBitmap.GetBitmap(&bmpInfo);
> > nX = rBorder.left + (rBorder.Width() / 2) - (bmpInfo.bmWidth / 2);
> > nY = rBorder.top + (rBorder.Height() / 2) - (bmpInfo.bmHeight / 2);
> > pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, m_pdcMemory, 0, 0,
> > SRCCOPY);
>
> > TIA
>
> > Tony
>
> I think I read somewhere that bitmaps are stored upside-down.- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Take a look at http://msdn.microsoft.com/en-us/library/dd183562(VS.85).aspx

"There are two varieties of DIBs:
A bottom-up DIB, in which the origin lies at the lower-left corner.
A top-down DIB, in which the origin lies at the upper-left corner.
If the height of a DIB, as indicated by the Height member of the
bitmap information header structure, is a positive value, it is a
bottom-up DIB; if the height is a negative value, it is a top-down
DIB. Top-down DIBs cannot be compressed."
 | 
Pages: 1
Prev: send message to winApp ?
Next: FreeImage help