IArrow.c
上传用户:yulinhuamu
上传日期:2009-12-26
资源大小:7287k
文件大小:1k
源码类别:

BREW编程

开发平台:

Visual C++

  1. #include "IArrow.h"
  2. #include "AEEAppGen.h"
  3. IMineArrow* IARROW_CreateInstance(AEEApplet* pApp)
  4. {
  5. AEEImageInfo pi;
  6. IMineArrow* pVal;;
  7. IBitmap* pDeviceBitmap=NULL;
  8. if(NULL==pApp) return NULL;
  9. pVal=MALLOCREC(IMineArrow);
  10. if(NULL==pVal) return NULL;
  11. MEMSET(pVal,0,sizeof(IMineArrow));
  12. pVal->m_pDisplay=pApp->m_pIDisplay;
  13. pVal->m_pIShell=pApp->m_pIShell;
  14. pVal->m_Arrow=ISHELL_LoadImage(pApp->m_pIShell,"Arrow.bmp");
  15. if(NULL==pVal->m_Arrow)
  16. {
  17. FREEIF(pVal);
  18. return NULL;
  19. }
  20. IIMAGE_SetParm(pVal->m_Arrow,IPARM_ROP,AEE_RO_TRANSPARENT,0);
  21. IIMAGE_GetInfo(pVal->m_Arrow,&pi);
  22. pVal->m_dx=pi.cx;
  23. pVal->m_dy=pi.cy;
  24. pVal->m_OldScreen=NULL;
  25. return pVal;
  26. }
  27. boolean IARROW_Release(IMineArrow* pArrow)
  28. {
  29. if(pArrow)
  30. {
  31. if(pArrow->m_Arrow)
  32. IIMAGE_Release(pArrow->m_Arrow);
  33. if(pArrow->m_OldScreen)
  34. IBITMAP_Release(pArrow->m_OldScreen);
  35. FREEIF(pArrow);
  36. }
  37. return TRUE;
  38. }
  39. boolean IARROW_Draws(IMineArrow* pArrow,int x,int y)
  40. {
  41. if(NULL==pArrow) return FALSE;
  42. /* if(pArrow->m_OldScreen)
  43. {
  44. IDISPLAY_BitBlt(pArrow->m_pDisplay,
  45. pArrow->m_rt.x,pArrow->m_rt.y,
  46. pArrow->m_rt.dx,pArrow->m_rt.dy,
  47. pArrow->m_OldScreen,0,0,
  48. AEE_RO_COPY);
  49. IBITMAP_Release(pArrow->m_OldScreen);
  50. pArrow->m_OldScreen=NULL;
  51. }
  52. if(SUCCESS!=IDISPLAY_GetDeviceBitmap(pArrow->m_pDisplay, &pArrow->m_OldScreen))
  53. return FALSE;
  54. */ IIMAGE_Draw(pArrow->m_Arrow,x,y);
  55. // IDISPLAY_Update(pArrow->m_pDisplay);
  56. return TRUE;
  57. }