Ios get width and height bitmap kbitmap char
462 | 13. |
|
---|
Developing Mirus 463
101: /* Allocate memory for image buffer */
102: if (NULL != m_piImageBuffer)
103: {
104: delete [] m_piImageBuffer;
105: }
106: m_piImageBuffer = new mrUInt32 [m_iWidth * m_iHeight];
107:
108: /* Get each pixel color components and fill image buffer */ 109:
mrUInt32 iX, iY;
110:
111: for (iY = 0; iY < m_iHeight; iY++)
112: {
113: for (iX = 0; iX < m_iWidth; iX++)
114: {
115: /* Needs to be flipped */
116: if (m_iHeight > 0)
117: {
118: m_piImageBuffer [iX + (m_iHeight - 1 - iY) * (m_iWidth)] = 255 |
119: (piBuffer [(iX + iY * (m_iWidth)) * 3 + 0] << 8) | 120:
(piBuffer [(iX + iY * (m_iWidth)) * 3 + 1] << 16) | 121: (piBuffer
[(iX + iY * (m_iWidth)) * 3 + 2] << 24); 122: }
123: /* Doesn’t need to be flipped */