IArrow.c
资源名称:brewmine3.rar [点击查看]
上传用户:yulinhuamu
上传日期:2009-12-26
资源大小:7287k
文件大小:1k
源码类别:
BREW编程
开发平台:
Visual C++
- #include "IArrow.h"
- #include "AEEAppGen.h"
- IMineArrow* IARROW_CreateInstance(AEEApplet* pApp)
- {
- AEEImageInfo pi;
- IMineArrow* pVal;;
- IBitmap* pDeviceBitmap=NULL;
- if(NULL==pApp) return NULL;
- pVal=MALLOCREC(IMineArrow);
- if(NULL==pVal) return NULL;
- MEMSET(pVal,0,sizeof(IMineArrow));
- pVal->m_pDisplay=pApp->m_pIDisplay;
- pVal->m_pIShell=pApp->m_pIShell;
- pVal->m_Arrow=ISHELL_LoadImage(pApp->m_pIShell,"Arrow.bmp");
- if(NULL==pVal->m_Arrow)
- {
- FREEIF(pVal);
- return NULL;
- }
- IIMAGE_SetParm(pVal->m_Arrow,IPARM_ROP,AEE_RO_TRANSPARENT,0);
- IIMAGE_GetInfo(pVal->m_Arrow,&pi);
- pVal->m_dx=pi.cx;
- pVal->m_dy=pi.cy;
- pVal->m_OldScreen=NULL;
- return pVal;
- }
- boolean IARROW_Release(IMineArrow* pArrow)
- {
- if(pArrow)
- {
- if(pArrow->m_Arrow)
- IIMAGE_Release(pArrow->m_Arrow);
- if(pArrow->m_OldScreen)
- IBITMAP_Release(pArrow->m_OldScreen);
- FREEIF(pArrow);
- }
- return TRUE;
- }
- boolean IARROW_Draws(IMineArrow* pArrow,int x,int y)
- {
- if(NULL==pArrow) return FALSE;
- /* if(pArrow->m_OldScreen)
- {
- IDISPLAY_BitBlt(pArrow->m_pDisplay,
- pArrow->m_rt.x,pArrow->m_rt.y,
- pArrow->m_rt.dx,pArrow->m_rt.dy,
- pArrow->m_OldScreen,0,0,
- AEE_RO_COPY);
- IBITMAP_Release(pArrow->m_OldScreen);
- pArrow->m_OldScreen=NULL;
- }
- if(SUCCESS!=IDISPLAY_GetDeviceBitmap(pArrow->m_pDisplay, &pArrow->m_OldScreen))
- return FALSE;
- */ IIMAGE_Draw(pArrow->m_Arrow,x,y);
- // IDISPLAY_Update(pArrow->m_pDisplay);
- return TRUE;
- }