GUI_Memdev_writeExAt transparent background problem

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • GUI_Memdev_writeExAt transparent background problem

      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?

      Source Code

      1. static void _cbParameterWindowBase(WM_MESSAGE * pMsg) {
      2. int NCode;
      3. int Id;
      4. WM_HWIN hItem;
      5. WM_HWIN hWin;
      6. GUI_MEMDEV_Handle prevHmem;
      7. GUI_MEMDEV_Handle hMemSource;
      8. GUI_MEMDEV_Handle hMemDest,hMemDest2;
      9. U32 * p1,*p2,*p3;
      10. unsigned long * pix,*pData;
      11. char testString1[100];
      12. /*int xWidget;
      13. int yWidget;
      14. int xSizeWidget;
      15. int ySizeWidget;
      16. int xSizeWindow;
      17. int ySizeWindow;*/
      18. hWin=pMsg->hWin;
      19. switch (pMsg->MsgId) {
      20. case WM_PRE_PAINT:
      21. break;
      22. case WM_PAINT:
      23. //WINDOW_SetBkColor(hWin,GUI_WHITE);
      24. GUI_SetBkColor(GUI_YELLOW);
      25. GUI_Clear();
      26. hMemSource = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
      27. hMemDest = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
      28. hMemDest2 = GUI_MEMDEV_CreateFixed(0, 0, 64, 64, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUICC_8888);
      29. prevHmem=GUI_MEMDEV_Select(hMemSource);
      30. GUI_SetBkColor(GUI_TRANSPARENT);
      31. GUI_Clear();
      32. // if(selectedImage>0)
      33. // {
      34. // GUI_CreateBitmapFromStreamRLE4(&Bitmap[selectedImage-1], &Palette[selectedImage-1], icon6464_rel4[selectedImage-1].data);
      35. // if(Bitmap[selectedImage-1].pPal->NumEntries==4)
      36. // {
      37. // Bitmap[selectedImage-1].pPal->pPalEntries[3]=GUI_BLUE;
      38. // GUI_DrawBitmap(&Bitmap[selectedImage-1], 0, 0);//,0,0,1000,1000);
      39. // //GUI_DrawBitmapMag(&Bitmap[selectedImage-1],0,0,xSize*1000/64,ySize*1000/64);
      40. // }
      41. // }
      42. GUI_SetColor(GUI_WHITE);
      43. GUI_FillEllipse(20,20,10,20);
      44. //
      45. GUI_MEMDEV_Select(hMemDest);
      46. GUI_SetBkColor(GUI_TRANSPARENT);
      47. GUI_Clear();
      48. GUI_MEMDEV_RotateHQ(hMemSource, hMemDest, 0, 0, 30 * 1000, 1000);
      49. GUI_MEMDEV_Select(hMemDest2);
      50. //GUI_EnableAlpha(1);
      51. GUI_SetBkColor(GUI_TRANSPARENT);
      52. GUI_Clear();
      53. GUI_PreserveTrans(1);
      54. GUI_SetDrawMode(GUI_DM_NORMAL);
      55. GUI_MEMDEV_WriteEx(hMemDest, 64*1000/64,80*1000/64,0);
      56. GUI_SetDrawMode(GUI_DM_NORMAL);
      57. // pData = GUI_MEMDEV_GetDataPtr(hMemDest2);
      58. // // clear it with transparency
      59. // for (pix = (unsigned long *) pData; pix < (unsigned long *) pData + (GUI_MEMDEV_GetXSize(hMemDest2)*GUI_MEMDEV_GetYSize(hMemDest2)); pix++)
      60. // { if(*pix==0)
      61. // {
      62. // *pix = GUI_TRANSPARENT;
      63. // }
      64. // }
      65. GUI_MEMDEV_Select(prevHmem);
      66. GUI_MEMDEV_WriteAt(hMemDest, 0 +500, 0 +00);//,1000,1000,255);
      67. GUI_MEMDEV_WriteAt(hMemSource, 0 +600, 0 +00);//,64*1000/64,80*1000/64,255);
      68. GUI_MEMDEV_WriteAt(hMemDest2, 0 +700, 0 +00);//,1000,1000,255);
      69. GUI_SetDrawMode(GUI_DM_TRANS);
      70. GUI_MEMDEV_WriteExAt(hMemSource, 0 +400, 0 +00,64*1000/64,80*1000/64,255);
      71. GUI_SetDrawMode(GUI_DM_NORMAL);
      72. GUI_PreserveTrans(0);
      73. GUI_EnableAlpha(0);
      74. //GUI_MEMDEV_WriteAt(hMemDest, xOff +600, yOff +20);
      75. GUI_MEMDEV_Delete(hMemSource);
      76. GUI_MEMDEV_Delete(hMemDest);
      77. GUI_MEMDEV_Delete(hMemDest2);
      78. //GUI_DrawBitmap(&Bitmap[0], 400, 100);
      79. break;
      80. case WM_NOTIFY_PARENT:
      81. Id = WM_GetId(pMsg->hWinSrc);
      82. NCode = pMsg->Data.v;
      83. break;
      84. default:
      85. WM_DefaultProc(pMsg);
      86. break;
      87. }
      88. }
      Display All



      Thanks.

      The post was edited 1 time, last by mtajian ().