본문 바로가기

Digital Image Processing5

GDI+ DrawString, Font 오류 문제 여러가지로 테스트를 진행했지만 GDI+ DrawString을 이용해서 특정 폰트를 가지고 출력할 때 오류가 발생한다.원인은 아직까지 확인하지 못했다. 내가 가지고 있는 폰트중에 "HY견고딕" 이라는 폰트가 있다.폰트 정보는 아래와 같다. 파일 형식: 트루타입 글꼴 파일(.TTF) 저작권: HanYang I&C Co., Ltd OpenType: 레이아웃, TrueType 윤곽선 한글폰트 버전: 3.10 폰트를 확인하면 당연히 ?도 포함되어 있다. 그러나 GDI+로 화면에 출력을 하면 ?가 표시되지 않는다.어떤 폰트를 가지고 출력을 할 때에는 모든 글자가 출력되지 않는 것도 있었다. 당연히 GDI방식과 Direct2D 방식인 DirectWrite API로 처리를 하면 정상적으로 화면에 출력이 된다.원인이 밝.. 2014. 8. 14.
Hit Testing Lines and Curves (라인, 커브 등 오브젝트를 선택하는 방법) http://msdn.microsoft.com/en-us/library/ms969920.aspx AbstractUseful graphics applications, such as CAD or drawing programs, permit the user to select and manipulate graphics objects. This article describes three methods for detecting if the user has selected a line or a curve.The first method is used to hit test lines. It uses two-dimensional vector techniques that resolve the vector components.. 2014. 7. 2.
Use of Two-Dimensional Vectors with Windows NT http://blog.yezhucn.com/dngdi/msdn_vector.htm What Is a Vector?If you are thinking "Just what is a vector?", this section is for you! It's really not uncommon to wonder what a vector is. If your graphics programming experience has been limited to Windows and your application development did not involve graphics editors of one sort or another, you probably have never dealt with vectors. I will no.. 2014. 7. 2.
PtInRegion() API 대체 방법 http://support.microsoft.com/kb/121960/ko http://support.microsoft.com/kb/121960/en-us다각형 안에 포인트가 있는지 확인하기 위해서 일반적으로 사용하는 GDI API입니다.예를 들어 CreatePolygonRgn() 호출하고 PtInRegion() 함수로 포인트가 지역 내에 있는지 여부를 확인 합니다.다각형이 복잡한 경우에 CreatePolygonRgn() 함수는 GDI의 힙 영역에서 사용하기 때문에 종종 메모리 부족 에러를 발생시킵니다. 또한 위의 API들은 속도가 떨어집니다. 따라서 성능에 크게 영향을 미칩니다. 기존에 개발해서 사용한 함수도 다각형이 작을 때는 크게 상관이 없지만 점의 개수가 많아 커질 경우에 몇초 이상의 속도저하가 .. 2014. 7. 2.
Bitmap Memory 저장시 4 바이트 배수 처리 비트맵은 메모리 저장시, 가로 버퍼의 크기는 항상 4 바이트의 배수가 되어야 한다. 실제 사용하는 이미지의 가로 크기가 4 바이트의 배수가 아니어도 4 배수 바이트로 바꾸어 저장을 한다.예를 들어 BMP 데이터의 Width x Height = 78px X 60px일 경우 78byte가 4의 배수가 아니기 때문에 80byte로 만들어 처리를 한다.따라서 실제 저장되는 메모리는 80px X 60px의 크기가 된다.BITMAPINFOHEADER 구조체의 biWidth, biHeight, biBitCount 값을 사용 #define WIDTHBYTES(bits) (((bits)+31)/32*4) //4 바이트 배수로 변환호출시: rwsize = WIDTHBYTES(biBitCount * biWidth); Vis.. 2014. 7. 1.
LIST