|
SetMapMode 를 사용해 본적은 없어서 잘 모르겠지만,
SetMapMode 함수는 그리기 바로 직전에 사용을 해야 한다는군요.
(그린 다음에 호출을 하면 안된다고..)
그래서 아래 예제처럼 OnPaint에 사용을 하는 것 같아 보입니다.
cuperido
Are you using the SetMapMode() function with a TCanvas object? Any
changes that you make with the Handle that a TCanvas object returns
should be assumed temporary. IOW, you need to call the SetMapMode()
function immediately before drawing to your Canvas. For example, the
following code will show only a dot in the top left corner...
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
SetMapMode(Canvas->Handle, MM_LOMETRIC);
}
// OnPaint event handler
void __fastcall TForm1::FormPaint(TObject *Sender)
{
Canvas->LineTo(0, -254);
}
Whereas the following code should display a (estimated) 1 inch
vertical line...
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::FormPaint(TObject *Sender)
{
SetMapMode(Canvas->Handle, MM_LOMETRIC);
Canvas->LineTo(0, -254);
}
Good luck,
--
Damon C. (TeamB)
WARSHIP 님이 쓰신 글 :
: 안녕하세요~
:
: 폼에 TImage32 를 띄워서 그위에 그림을 그리던중에
: SetMapMode함수가 먹지 않아서 이렇게 질문을 드립니다.
: (TImage,TPaint던가도 안되더군요)
:
: 보통
: SetMapMode( img->Canvas->Handle, MM_LOMETRIC );
: 이런식으로 하면 Y축 방향이 바뀌고 단위도 바껴서
: 원래 그림보다 작게 나온다던지 변화가 있어야하는데
: 아무리 바꿔줘도 변화가 없어서 이렇게 질문을 드립니다.
:
: SetMapMode 함수가 반환하는 값이나,
: GetMapMode 함수로 설정된 값을 보면
: 바뀌어 있기는한데 화면에 표시되는것은 똑같이 나오는군요.
: 검색을 해봐도 만족할 만한 답변이 없어서 이렇게 질문을 올립니다.
:
: 그럼 날씨가 더운데 조심하시구요. 좋은하루 보내시기 바랍니다.
|