1 / 8

9. IShell API (3)

9. IShell API (3). 9.1 IShell API 서비스 – 리소스 파일 및 파일 처리 ISHELL_LoadResData 함수 : 문자열과 비트맵 이미지 등과 같은 소스를 읽어들일 때 사용. 9. IShell API (3). nType 의 값 [RESTYPE_STRING | RESTYPE_IMAGE | RESTYPE_DISLOG | RESTYPE_CONTROL | RESTYPE_LISTITEM | RESTYPE_BINARY]

seth
Download Presentation

9. IShell API (3)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 9. IShell API (3) • 9.1 IShell API 서비스 – 리소스 파일 및 파일 처리 • ISHELL_LoadResData 함수: 문자열과 비트맵 이미지 등과 같은 소스를 읽어들일 • 때 사용 임베디드 모바일 프로그래밍

  2. 9. IShell API (3) • nType의 값 • [RESTYPE_STRING | RESTYPE_IMAGE | RESTYPE_DISLOG | RESTYPE_CONTROL | • RESTYPE_LISTITEM | RESTYPE_BINARY] • ISHELL_FreeResData(): ISHELL_LoadResData()를 사용하여 리소스를 로드하는데 • 사용된 메모리 해제하는 함수 • CONVERTBMP(): 실제 이미지 데이터를 폰의 색상 테이블에 맞는 raw 포맷으로 • 변환하는 함수 - pSrcBuffer, 비트맵을 포함하고 있는 버퍼의 포인터 - pii, AEEImageInfo 구조체에 너비 , 높이 , 색상 수 등과 정보 저장 - pbRealloc, 메모리 할당 여부 표시, TRUE 로 설정되면 버퍼를 사용한 다음 호출자가 SYSFREE() 를 사용하여 이 함수로부터 반환된 버퍼를 해제해야 함 임베디드 모바일 프로그래밍

  3. 9. IShell API (3) • IDISPLAY_BitBlt(): 지정한 원본 비트맵에서 주어진 표시 영역으로 직사각형에 • 해당하는 픽셀 데이터의 비트 블록 전송을 수행. • ISPLAY_Update()를 호출하여 화면을 업데이트해야 디스플레이 됨 - pIDisplay, IDisplay 인터페이스 개체 포인터 - xDest, 대상 직사각형 영역의 왼쪽 위 모서리 기준의 x 좌표 - yDest, 대상 직사각형 영역의 왼쪽 위 모서리 기준의 y 좌표 - cxDest, 대상 직사각형의 너비를 지정 - cyDest, 대상 직사각형의 높이 - pBmp, 원본 비트맵의 구조에 대한 포인터 - xSrc, 원본 비트맵의 왼쪽 위 모서리 기준 x 좌표 - ySrc, 원본 비트맵의 왼쪽 위 모서리 기준 y 좌표 - dwRopCode, 비트 블록을 전송하는 동안 사용해야 하는 래스터 동작을 지정 임베디드 모바일 프로그래밍

  4. 9. IShell API (3) • 9.2 리소스 파일 처리 예 • 이미지 리소스 추가 임베디드 모바일 프로그래밍

  5. 9. IShell API (3) • 소스프로그램 • /*=============================================================================== • INCLUDES AND VARIABLE DEFINITIONS • =============================================================================== */ • #include "AEEModGen.h" // Module interface definitions • #include "AEEAppGen.h" // Applet interface definitions • #include "AEEShell.h" // Shell interface definitions • #include "AEEMenu.h" • #include "AEEStdLib.h" • #include "IShellEx_res.h" • // 알림 정보 서비스 모듈의 클래스 아이디 파일(IShell 예제 프로그램) • #include "IShellEx.bid" • #define APP_RES_FILE "IShellEx.bar" • #define MENU_EVENT_ALARM 401 • #define ALARM_ID 402 • #define MENU_EVENT_DIALOG 403 • #define MENU_EVT_LOADRESDATA 411 • . . . 임베디드 모바일 프로그래밍

  6. 9. IShell API (3) case EVT_COMMAND: switch(wParam) { . . . case MENU_EVT_LOADRESDATA: { char szResFile[] = APP_RES_FILE; // Resource File used by this applet char pszStr [50] = {0}; AEEBmp pbmSource; int xDest = 0; int yDest = 0; int cxDest = pMe->m_dInfo.cxScreen; int cyDest = pMe->m_dInfo.cyScreen; int xSrc = 0; int ySrc = 0; AEERasterOp dwRopCode = AEE_RO_MASK; AEEImageInfo imageInfo; void *pBmp = NULL, *pDataBytes = NULL; boolean bVal = TRUE; AEEBmo는 IDisplay.h에서 정의된 포인트 변수. 읽어들일 비트맵 파일을 지정할 변수 임베디드 모바일 프로그래밍

  7. 9. IShell API (3) 리소스(bar) 파일에서 비트맵 파일 정보를 읽는다 IDISPLAY_ClearScreen (pMe->a.m_pIDisplay); IMENUCTL_SetProperties(pMe->m_pIMenu, MP_NO_REDRAW); IMENUCTL_SetActive(pMe->m_pIMenu, FALSE); pbmSource = ISHELL_LoadResData (pMe->a.m_pIShell, APP_RES_FILE, IDB_BITMAP_FALL, RESTYPE_IMAGE); pDataBytes = (byte *)pbmSource + *((byte *)pbmSource); pBmp = CONVERTBMP (pDataBytes, &imageInfo, &bVal); IDISPLAY_BitBlt (pMe->a.m_pIDisplay, xDest, yDest, cxDest, cyDest, pBmp, xSrc, ySrc, dwRopCode); IDISPLAY_Update (pMe->a.m_pIDisplay); ISHELL_FreeResData (pMe->a.m_pIShell, pbmSource); if(bVal)//free only if realloc was done SYSFREE ( pBmp); return TRUE; } . . . 임베디드 모바일 프로그래밍

  8. 9. IShell API (3) • 실행 결과 임베디드 모바일 프로그래밍

More Related