|
函数原型是如下这个样子的:
- /*********************************************************************
- *
- * _DrawBitmap
- */
- static void _DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0,
- int xSize, int ySize,
- int BitsPerPixel,
- int BytesPerLine,
- const U8 * pData, int Diff,
- const LCD_PIXELINDEX * pTrans) {
- int i;
- switch (BitsPerPixel) {
- case 1:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
- pData += BytesPerLine;
- }
- break;
- case 2:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
- pData += BytesPerLine;
- }
- break;
- case 4:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
- pData += BytesPerLine;
- }
- break;
- case 8:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans);
- pData += BytesPerLine;
- }
- break;
- //
- // Only required for 16bpp color depth of target. Should be removed otherwise.
- //
- case 16:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine16BPP(pDevice, x0, i + y0, (const U16 *)pData, xSize);
- pData += BytesPerLine;
- }
- break;
- //
- // Only required for 32bpp color depth of target. Should be removed otherwise.
- //
- case 32:
- for (i = 0; i < ySize; i++) {
- _DrawBitLine32BPP(pDevice, x0, i + y0, (const U32 *)pData, xSize);
- pData += BytesPerLine;
- }
- break;
- }
- }
复制代码 |
|