IT 취미생활.  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
'Wince5.0'에 해당하는 글(5)
2009.07.17   Iimage 를 이용하여 jpeg 출력 2
2008.08.27   [Wince5.0]Platform build 에서 cmd 창으로 부분 빌드하기
2008.08.25   WinCE 5.0 커널 & 디바이스 구축
2008.08.12   [Wince5.0] Debug Mode에서만 출력하는 디버깅 메시지
2008.08.04   [Error Case - Wince5.0] C4430


Iimage 를 이용하여 jpeg 출력

참 쉽죠이잉 ~
wince5.0에서 10분이면 되는걸... !!
일 할때는 다른 사람의 경험을 존중하며 가장 손쉬운 방법을 찾는걸 우선 해야 할 것입니다.
고민 할껀 고민 해야겠죠

Windows CE 5.0이상에서 지원, Imaging관련 컴포넌트가 포함된 경우에만 동작
확인은 dll이 있는지 확인 해봐야함

기본적으로 지원하는 포맷은 jpg, png, gif, bmp 등이 있고 multiframe image(ani-gif)도 가능하며, 유저 코덱을 추가하면 다른 포맷도 사용 가능합니다.인코딩, 디코딩 가능하며, contrast, brightness, flip, clone, resize, rotate 등도 가능

일전 이미지 편집 프로그램을 windows mobile 5.0에서 간단한 이미지 편집 프로그램
작성시 해당 컴포넌트 이용, Thumnail 엔진도 이용함.

자세한 사항은 MSDN에서  http://msdn.microsoft.com/en-gb/library/ms932606.aspx 확인



1. 헤더, 라이브러리 추가

#include <initguid.h>
#include <imaging.h>
#pragma comment (lib, "Ole32.lib")


2. ImagingAPI를 사용하기 전후로 다음 함수 호출합니다.
   이유는 COM을 사용하기 때문이죠. 프로그램 시작/종료시에 한번만 호출 합니다.
  
 
    // 프로그램 시작부분에서 호출.
    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);   


    // 프로그램 종료부분에서 호출..
    CoUninitialize();   


3. 이미지파일을 읽어와서, hdc의 rcDest 영역에 display sample function


void DrawImageFile(HDC hdc, TCHAR* szFileName, RECT* prcDest)

{

    HRESULT hr;

    IImage *pImage = NULL;

    IImagingFactory *pImagingFactory = NULL;


    hr = CoCreateInstance(CLSID_ImagingFactory,
                          NULL,
                          CLSCTX_INPROC_SERVER,
                          IID_IImagingFactory,
                          (void**) &pImagingFactory);

    if( FAILED(hr) ) {
 goto finish;
    }
 

    hr = pImagingFactory->CreateImageFromFile( szFileName, &pImage );

    if (FAILED(hr) || NULL == pImage) {
 goto finish;
    }

    pImage->Draw( hdc, prcDest, NULL );

finish:
    if (pImage) {                
 pImage->Release();
 pImage = NULL;
    }

    if (pImagingFactory) {
 pImagingFactory->Release();
        pImagingFactory = NULL;
    }
}


4. draw....

win32 api를 이용시...

    HDC hdc;
    PAINTSTRUCT ps;
    hdc = BeginPaint(hWnd, &ps);

    // 이미지가 보일 좌표
    RECT rectDest= {0,0,200,200};
    DrawImageFile(hdc, L"\\test.jpg", &rectDest);

    EndPaint(hWnd, &ps);



iimage도 잘 이용하면 더블버퍼링 처리가 가능 합니다.

hdc에 바로 그리지 말고, mem dc에 그린 후 hdc로 옮겨 그리면,
깜빡임 현상들을 제거 할 수 있습니다.

일단 샘플이니 간단하게 사용 해보셔요.



[Wince5.0]Platform build 에서 cmd 창으로 부분 빌드하기
Platform build 에서 cmd 창으로 부분 빌드하기


set을 눌러서 환경 변수들이 등록이 되었는지 확인을 한다.


cmd 창에서

-------------------------------------------------------------------------------
set WINCEREL = 1   //<-- 환경변수 등록 그럼 rel 폴더로 해당 바이너리가 복사 된다.
cd ...                     // <--- 원하는 폴더로 이동
build -c
makeimg
-------------------------------------------------------------------------------


WinCE 5.0 커널 & 디바이스 구축
교육 갑니다.



Wince 5.0 Kernel and DeviceDriver

● 과 정 명 :  WinCE 5.0 커널 & 디바이스 구축

● 기    2008. 08. 26() ~ 2008. 08. 29() (4 30시간)

● 시     :  ~ 09:30 ~ 18:00

● 강 의 장 :  분당구 정자동 킨스타워 7 재단 교육장

건물위치 :  분당선 정자역 3.4번 출구 바로 앞

사용자 삽입 이미지



[Wince5.0] Debug Mode에서만 출력하는 디버깅 메시지

Wince5.0이나 WindowsMobile 같은 경우 MFC를 사용하지 않을경우
TRACE를 사용 할 수 없습니다.
따라서 아래처럼 구성해서 사용하시면 DebugMode에서만 동작하는
메시지를 만들 수 있습니다.



#ifdef _DEBUG
#define TRACE                Trace
#else
#define TRACE                ((void)0)
#endif

#ifdef _DEBUG
#define MAX_MSG_SIZE          1024        
void TRACE(const TCHAR *szString, ...)
{
 static TCHAR szBuffer[MAX_MSG_SIZE] = { 0 };
 va_list argptr = NULL;
 va_start( argptr, szString );
 vswprintf( szBuffer, szString, argptr );
 OutputDebugString( szBuffer );
 va_end( argptr );
}
#endif



ex)  TRACE( L"Service Name : %s\n", buffer);
       TRACE( L"WE_SERVICE_DISCOVERY_COMPLETE\n\r " );


고운하루 되세요.


[Error Case - Wince5.0] C4430

오늘도 Builder로 써 열심히 Build를 하고 있었다...
나 <--- 난 거의 팀내 잡부로 수 많은 Link Error를 접해보는 사람이다.

아래와 같은 C4430을 마주했다.

1>.\SubtitlePresentation.cpp(109) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Class에서 Member Function을 선언하고, 실제 구현부에서 return 값을 빼먹었을때,
C4430이 여지 없이 일어난다 한번 테스트를 해보길...





MSDN Error 페이지를 살펴 보니 아래와 같은 경우 발생하게 된다.

Error Message

missing type specifier - int assumed. Note: C++ does not support default-int

This error can be generated as a result of compiler conformance work that was done for Visual C++ 2005: all declarations must now explicitly specify the type; int is no longer assumed. See Breaking Changes in the Visual C++ 2005 Compiler for more information.

C4430 is always issued as an error. You can turn off this warning with the #pragma warning or /wd; see warning or /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Warning Level) for more information.

Example

The following sample generates C4430.

  Copy Code
// C4430.cpp
// compile with: /c
struct CMyClass {
   CUndeclared m_myClass;  // C4430
   int m_myClass;  // OK
};

typedef struct {
   POINT();   // C4430
   // try the following line instead
   // int POINT();
   unsigned x;
   unsigned y;
} POINT;



BLOG main image
취미생활
 Notice
 Category
분류 전체보기 (191)
매일매일갱생 (83)
서버개발 (1)
임베디드개발 (12)
Programming (80)
Personal Projects (6)
유용한 프로그램 (0)
 TAGS
벨소리 변경 Debug DirectShow project 출장 M480 서태지 MP3 warning 퇴사 티스토리 초대장 음식 debugging C++ Brazil VC++ DVB 군대 Error Case 개발자 english email isdbt 1seg Dshow 영어 이메일 DVB-T Windows Mobile6.0 Linux 미라지폰 It English Java spam mail ISDB-T Algorithm C 티스토리초대 알고리즘 Wince5.0
 Calendar
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
 Recent Entries
 Recent Comments
 Recent Trackbacks
 Archive
 Link Site
zextor
괴짜 프로그래머의 일상사~@@
Gag & Peace, and more..
Kazakhstan Almaty.......
Min-A
Sadgarret
Steve Yoon's log
가슴 뛰는 삶을 살아라
오스틴 파워
GUI sin
melanie parker_Lady
제레미의 TV 2.0 이야기..
 Visitor Statistics
Total :
Today :
Yesterday :
rss