Hi
I have made two memory devices in WM_PAINT event of the window and when I write first memdev to second one with GUI_Memdev_writeExAt function, the transparent back ground color changes to black. GUI_Memdev_writeAt works correctly but GUI_Memdev_writeExAt does not. Both Memdevs use guicc_8888 color conversion format and my lcd color conversion format is guicc_M565. Do I need to change the back color data manually by use of GUI_memdev_getDataPtr function?
Display All
Thanks.
I have made two memory devices in WM_PAINT event of the window and when I write first memdev to second one with GUI_Memdev_writeExAt function, the transparent back ground color changes to black. GUI_Memdev_writeAt works correctly but GUI_Memdev_writeExAt does not. Both Memdevs use guicc_8888 color conversion format and my lcd color conversion format is guicc_M565. Do I need to change the back color data manually by use of GUI_memdev_getDataPtr function?
Source Code
- static void _cbParameterWindowBase(WM_MESSAGE * pMsg) {
- int NCode;
- int Id;
- WM_HWIN hItem;
- WM_HWIN hWin;
- GUI_MEMDEV_Handle prevHmem;
- GUI_MEMDEV_Handle hMemSource;
- GUI_MEMDEV_Handle hMemDest,hMemDest2;
- U32 * p1,*p2,*p3;
- unsigned long * pix,*pData;
- char testString1[100];
- /*int xWidget;
- int yWidget;
- int xSizeWidget;
- int ySizeWidget;
- int xSizeWindow;
- int ySizeWindow;*/
- hWin=pMsg->hWin;
- switch (pMsg->MsgId) {
- case WM_PRE_PAINT:
- break;
- case WM_PAINT:
- //WINDOW_SetBkColor(hWin,GUI_WHITE);
- GUI_SetBkColor(GUI_YELLOW);
- GUI_Clear();
- hMemSource = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
- hMemDest = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
- hMemDest2 = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
- prevHmem=GUI_MEMDEV_Select(hMemSource);
- GUI_SetBkColor(GUI_TRANSPARENT);
- GUI_Clear();
- // if(selectedImage>0)
- // {
- // GUI_CreateBitmapFromStreamRLE4(&Bitmap[selectedImage-1], &Palette[selectedImage-1], icon6464_rel4[selectedImage-1].data);
- // if(Bitmap[selectedImage-1].pPal->NumEntries==4)
- // {
- // Bitmap[selectedImage-1].pPal->pPalEntries[3]=GUI_BLUE;
- // GUI_DrawBitmap(&Bitmap[selectedImage-1], 0, 0);//,0,0,1000,1000);
- // //GUI_DrawBitmapMag(&Bitmap[selectedImage-1],0,0,xSize*1000/64,ySize*1000/64);
- // }
- // }
- GUI_SetColor(GUI_WHITE);
- GUI_FillEllipse(20,20,10,20);
- //
- GUI_MEMDEV_Select(hMemDest);
- GUI_SetBkColor(GUI_TRANSPARENT);
- GUI_Clear();
- GUI_MEMDEV_RotateHQ(hMemSource, hMemDest, 0, 0, 30 * 1000, 1000);
- GUI_MEMDEV_Select(hMemDest2);
- //GUI_EnableAlpha(1);
- GUI_SetBkColor(GUI_TRANSPARENT);
- GUI_Clear();
- GUI_PreserveTrans(1);
- GUI_SetDrawMode(GUI_DM_NORMAL);
- GUI_MEMDEV_WriteEx(hMemDest, 64*1000/64,80*1000/64,0);
- GUI_SetDrawMode(GUI_DM_NORMAL);
- // pData = GUI_MEMDEV_GetDataPtr(hMemDest2);
- // // clear it with transparency
- // for (pix = (unsigned long *) pData; pix < (unsigned long *) pData + (GUI_MEMDEV_GetXSize(hMemDest2)*GUI_MEMDEV_GetYSize(hMemDest2)); pix++)
- // { if(*pix==0)
- // {
- // *pix = GUI_TRANSPARENT;
- // }
- // }
- GUI_MEMDEV_Select(prevHmem);
- GUI_MEMDEV_WriteAt(hMemDest, 0 +500, 0 +00);//,1000,1000,255);
- GUI_MEMDEV_WriteAt(hMemSource, 0 +600, 0 +00);//,64*1000/64,80*1000/64,255);
- GUI_MEMDEV_WriteAt(hMemDest2, 0 +700, 0 +00);//,1000,1000,255);
- GUI_SetDrawMode(GUI_DM_TRANS);
- GUI_MEMDEV_WriteExAt(hMemSource, 0 +400, 0 +00,64*1000/64,80*1000/64,255);
- GUI_SetDrawMode(GUI_DM_NORMAL);
- GUI_PreserveTrans(0);
- GUI_EnableAlpha(0);
- //GUI_MEMDEV_WriteAt(hMemDest, xOff +600, yOff +20);
- GUI_MEMDEV_Delete(hMemSource);
- GUI_MEMDEV_Delete(hMemDest);
- GUI_MEMDEV_Delete(hMemDest2);
- //GUI_DrawBitmap(&Bitmap[0], 400, 100);
- break;
- case WM_NOTIFY_PARENT:
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
Thanks.
The post was edited 1 time, last by mtajian ().