{ return (GetBitmapData() ? GetBitmapData()->m_pSelectedInto : (wxDC*) NULL); }
inline bool IsMono(void) const { return m_bIsMono; }
- inline bool Flip(void) const { return m_bFlip; }
// An OS/2 version that probably doesn't do anything like the msw version
bool CopyFromIconOrCursor(const wxGDIImage& rIcon);
bool m_bIsMono;
- bool m_bFlip;
DECLARE_DYNAMIC_CLASS(wxBitmap)
}; // end of CLASS wxBitmap
//
// True for all bitmaps created from bits, wxImages, Xpms
//
- m_bFlip = TRUE;
} // end of wxBitmap::Init
bool wxBitmap::CopyFromIconOrCursor(
)
{
Init();
- m_bFlip = FALSE;
(void)Create( nW
,nH
,nD
)
{
Init();
- m_bFlip = FALSE;
LoadFile( rFilename
,(int)lType
);
// Xpms and bitmaps from other images can also be mono's, but only
// mono's need help changing their colors with MemDC changes
//
- if (nD == 1)
- m_bIsMono = TRUE;
if (nD > 0)
{
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
HDC hDC = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE);
HPS hPS = ::GpiCreatePS(vHabmain, hDC, &vSize, PU_PELS | GPIA_ASSOC);
+ if (nD == 1)
+ m_bIsMono = TRUE;
memset(&vHeader, '\0', 16);
vHeader.cbFix = 16;
vHeader.cx = nW;
{
wxCHECK_MSG(rImage.Ok(), FALSE, wxT("invalid image"));
m_refData = new wxBitmapRefData();
- m_bFlip = TRUE;
int nSizeLimit = 1024 * 768 * 3;
int nWidth = rImage.GetWidth();
wxCHECK_MSG(rImage.Ok(), FALSE, wxT("invalid image"));
SetWidth(nWidth);
SetHeight(nBmpHeight);
+ if (nDepth == 1)
+ m_bIsMono = TRUE;
+ else
+ m_bIsMono = FALSE;
if (nDepth == -1)
nDepth = wxDisplayDepth();
SetDepth(nDepth);
//
nHeight = nHRemain;
vHeader.cy = (DWORD)(nHeight);
+ vHeader.cbImage = nBytePerLine * nHeight;
}
ptbits = pucBits;
for (int j = 0; j < nHeight; j++)
::GpiBox( m_hPS
,lControl
,&vPoint[1]
- ,0L
- ,0L
+ ,(LONG)dRadius
+ ,(LONG)dRadius
);
lControl = DRO_FILL;
::GpiSetColor( m_hPS
::GpiBox( m_hPS
,lControl
,&vPoint[1]
- ,0L
- ,0L
+ ,(LONG)dRadius
+ ,(LONG)dRadius
);
}
vY = OS2Y(vY,rBmp.GetHeight());
- //
- // Flip the picture as OS/2 is upside-down
- //
- if (rBmp.Flip())
- {
- vPoint[0].x = vX;
- vPoint[0].y = vY + rBmp.GetHeight();
- vPoint[1].x = vX + rBmp.GetWidth();
- vPoint[1].y = vY;
- vPoint[2].x = 0;
- vPoint[2].y = 0;
- vPoint[3].x = rBmp.GetWidth();
- vPoint[3].y = rBmp.GetHeight();
- }
- else
- {
- vPoint[0].x = vX;
- vPoint[0].y = vY;
- vPoint[1].x = vX + rBmp.GetWidth();
- vPoint[1].y = vY + rBmp.GetHeight();
- vPoint[2].x = 0;
- vPoint[2].y = 0;
- vPoint[3].x = rBmp.GetWidth();
- vPoint[3].y = rBmp.GetHeight();
- }
+ vPoint[0].x = vX;
+ vPoint[0].y = vY + rBmp.GetHeight();
+ vPoint[1].x = vX + rBmp.GetWidth();
+ vPoint[1].y = vY;
+ vPoint[2].x = 0;
+ vPoint[2].y = 0;
+ vPoint[3].x = rBmp.GetWidth();
+ vPoint[3].y = rBmp.GetHeight();
if (bUseMask)
{
wxMask* pMask = rBmp.GetMask();
m_vRclPaint.yBottom == 0 &&
m_vRclPaint.xRight == 0 &&
m_vRclPaint.xLeft == 0))
- vPtlStart.y = OS2Y(vY,vTextY);
+ vPtlStart.y = OS2Y(vY,vTextY/1.5); // Full extent is a bit much
else
{
if (m_vSelectedBitmap != wxNullBitmap)
{
m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
- vPtlStart.y = OS2Y(vY,vTextY);
+ vPtlStart.y = OS2Y(vY,vTextY/1.5);
}
else
vPtlStart.y = vY;
if (!hBmp)
{
+ //
+ // Bmps drawn to are upside down, so flip it before committing
+ //
+ POINTL vPoint[4] = { 0, m_vSelectedBitmap.GetHeight(),
+ m_vSelectedBitmap.GetWidth(), 0,
+ 0, 0, m_vSelectedBitmap.GetWidth(), m_vSelectedBitmap.GetHeight()
+ };
+
+
+ ::GpiBitBlt( m_hPS
+ ,m_hPS
+ ,4
+ ,vPoint
+ ,ROP_SRCCOPY
+ ,BBO_IGNORE
+ );
m_vSelectedBitmap.SetSelectedInto(NULL);
}
m_vSelectedBitmap = rBitmap;
if (!hBmp)
{
+
m_hOldBitmap = (WXHBITMAP)::GpiSetBitmap(m_hPS, NULLHANDLE);
return;
}