programmer2 화면 크기에 맞는 영상 크기 구하기 미디어 플레이어 관련 개발을 하다보면 콘텐츠의 Video 크기를미디어 플레이어의 화면 사이즈와 콘텐츠의 Video 비율에 맞게 조정할 필요가 있다.아래는 위 요구에 맞게 구현한 코드다. void adjustVideoSize(int viewWidth,int viewHeight,int videoWidth,int videoHeight,int *adjustedVideoWidth,int *adjustedVideoHeight) { // Get GCD of videoint gcd; {int max, min; if (videoWidth > videoHeight) {max = videoHeight;min = videoWidth;} else {max = videoWidth;min = videoHeight;} int tem.. 2015. 1. 23. 데이터 타입 크기와 signed/unsigned 체크 방법 1. 아래의 코드를 헤더 파일에 정의하고 #if !defined(DC__TEST_TYPE_SIZE) #define DC__TEST_TYPE_SIZE(_type, _size) \ typedef int DC__TEST_TYPE_SIZE_##_type[(sizeof(_type) == (_size)) ? 1 : -1] #endif #if !defined(DC__TEST_TYPE_IS_SIGNED) #define DC__TEST_TYPE_IS_SIGNED(_type) \ typedef int DC__TEST_TYPE_IS_SIGNED_##_type[((_type)((_type)1 2014. 12. 16. 이전 1 다음