MCPcopy Create free account
hub / github.com/ImpulseAdventure/JPEGsnoop / CreateDIBFromBitmap

Method CreateDIBFromBitmap

Dib.cpp:133–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133bool 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
156bool CDIB::CopyDIB(CDC* pDestDC,int x,int y,float scale)
157{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected