| 131 | } |
| 132 | |
| 133 | bool CDIB::CreateDIBFromBitmap(CDC* pDC) |
| 134 | { |
| 135 | if (!pDC) return FALSE; |
| 136 | HDC hDC = pDC->GetSafeHdc(); |
| 137 | |
| 138 | BITMAP bimapInfo; |
| 139 | m_bmBitmap.GetBitmap(&bimapInfo); |
| 140 | if (!CreateDIB(bimapInfo.bmWidth,bimapInfo.bmHeight, |
| 141 | bimapInfo.bmBitsPixel)) return FALSE; |
| 142 | |
| 143 | LPRGBQUAD lpColors = m_pDIB->bmiColors; |
| 144 | |
| 145 | |
| 146 | SetDIBColorTable(hDC,0,GetDIBCols(),lpColors); |
| 147 | |
| 148 | // This implicitly assumes that the source bitmap |
| 149 | // is at the 1 pixel per mm resolution |
| 150 | bool bSuccess = (GetDIBits(hDC,(HBITMAP)m_bmBitmap, |
| 151 | 0,bimapInfo.bmHeight,GetDIBBitArray(), |
| 152 | m_pDIB,DIB_RGB_COLORS) > 0); |
| 153 | return bSuccess; |
| 154 | } |
| 155 | |
| 156 | bool CDIB::CopyDIB(CDC* pDestDC,int x,int y,float scale) |
| 157 | { |
nothing calls this directly
no outgoing calls
no test coverage detected