C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[61960] 흠.. 폼을 프린트 하면 왜이렇게 뿌옇게(?) 나올까요?
도라지 [forevermc] 917 읽음    2010-07-21 13:33
안녕하세요^^;;
모니터상으로는 이뿌게.. 잘 나오는데...폼을 프린트하는데... 너무 뿌옇게 나와서 속이 상합니다. ㅠ

소스는 여기 포럼에 있던 소스를 이용했구요;;
조금 편집해서 아래와 같이 만들었습니다.

어떻게 하면 쨍(?) 하게 표시할 수 있을까요? ㅠㅠ

	if (ActiveMDIChild) {
		TForm * pForm = ((TChildFrm*)ActiveMDIChild); // Set Printing Form

		Graphics::TBitmap *mjbmp = new Graphics::TBitmap();
		mjbmp->Width = pForm->ClientWidth;
		mjbmp->Height = pForm->ClientHeight;
		mjbmp->Canvas->CopyRect(Rect(0, 0, mjbmp->Width, mjbmp->Height),
			pForm->Canvas, Rect(0, 0, pForm->ClientWidth, pForm->ClientHeight));

		if (!PrintDialog1->Execute())
			return;
		// Graphics::TBitmap *mjbmp= FormMain->GetFormImage();
		TPrinter *prt = Printer();
		mjbmp->HandleType = bmDIB; // This is *VERY* important
		double h = mjbmp->Height, w = mjbmp->Width, fct, wf;
		if (w > h)
			prt->Orientation = poLandscape;
		else
			prt->Orientation = poPortrait;

		// 프린트 에러상태 검출해야함...

		prt->Title = "SPINDLE TEST PRINT";
		wf = (double)prt->PageWidth / w;
		fct = (double)prt->PageHeight / h;
		if (fct > wf)
			fct = wf;

		prt->BeginDoc();
		prt->Canvas->StretchDraw(Rect(0, 0, fct * w - 1, fct * h - 1), mjbmp);
		prt->Canvas->TextOut(0, 0, "PRINT OK");
		prt->EndDoc();
		delete mjbmp;
	}
	else {
		ShowMessage("프린트할 내용이 없습니다.");
	}

+ -

관련 글 리스트
61960 흠.. 폼을 프린트 하면 왜이렇게 뿌옇게(?) 나올까요? 도라지 917 2010/07/21
61961     Re:흠.. 폼을 프린트 하면 왜이렇게 뿌옇게(?) 나올까요? Lyn 1110 2010/07/21
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.