ÉîÈëdz³öMFCµÚ2°æ(PDF¸ñʽ)-µÚ176²¿·Ö
°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·ҳ£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0053¡¡¡¡£ý£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0054¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0055¡¡¡¡#ifndef¡¡_DEBUG¡¡¡¡//¡¡debug¡¡version¡¡in¡¡ScribVw¡£cpp¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0056¡¡¡¡inline¡¡CScribbleDoc*¡¡CScribbleView£º£ºGetDocument£¨£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0057¡¡¡¡¡¡¡¡¡¡£û¡¡return¡¡£¨CScribbleDoc*£©m_pDocument£»¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0058¡¡¡¡#endif¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡SCRIBBLEVIEW¡£CPP¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0001¡¡¡¡#include¡¡¡¨stdafx¡£h¡¨¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0002¡¡¡¡#include¡¡¡¨Scribble¡£h¡¨¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0003¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0004¡¡¡¡#include¡¡¡¨ScribDoc¡£h¡¨¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0005¡¡¡¡#include¡¡¡¨ScribVw¡£h¡¨¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0006¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0007¡¡¡¡#ifdef¡¡_DEBUG¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0008¡¡¡¡#define¡¡new¡¡DEBUG_NEW¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0009¡¡¡¡#undef¡¡THIS_FILE¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0010¡¡¡¡static¡¡char¡¡THIS_FILE£§£§¡¡=¡¡__FILE__£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0011¡¡¡¡#endif¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0012¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0013¡¡¡¡/////////////////////////////////////////////////////////////////¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0014¡¡¡¡//¡¡CScribbleView¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0015¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0016¡¡¡¡IMPLEMENT_DYNCREATE£¨CScribbleView£»¡¡CScrollView£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0017¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0018¡¡¡¡BEGIN_MESSAGE_MAP£¨CScribbleView£»¡¡CScrollView£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0019¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//£û£ûAFX_MSG_MAP£¨CScribbleView£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0020¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_WM_LBUTTONDOWN£¨£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0021¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_WM_LBUTTONUP£¨£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0022¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_WM_MOUSEMOVE£¨£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0023¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//£ý£ýAFX_MSG_MAP¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0024¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Standard¡¡printing¡¡mands¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0025¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_MAND£¨ID_FILE_PRINT£»¡¡CView£º£ºOnFilePrint£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0026¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_MAND£¨ID_FILE_PRINT_DIRECT£»¡¡CView£º£ºOnFilePrint£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0027¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ON_MAND£¨ID_FILE_PRINT_PREVIEW£»¡¡CView£º£ºOnFilePrintPreview£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0028¡¡¡¡END_MESSAGE_MAP£¨£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0029¡¡
894¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡957¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¸½ä›£Â¡¡¡¡¡¡¡¡Scribble¡¡Step5¡¡¡¡ÍêÕûÔʼ´a¡¡
#0030¡¡¡¡/////////////////////////////////////////////////////////////////¡¡
#0031¡¡¡¡//¡¡CScribbleView¡¡construction/destruction¡¡
#0032¡¡
#0033¡¡¡¡CScribbleView£º£ºCScribbleView£¨£©¡¡
#0034¡¡¡¡£û¡¡
#0035¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡TODO£º¡¡add¡¡construction¡¡code¡¡here¡¡
#0036¡¡
#0037¡¡¡¡£ý¡¡
#0038¡¡
#0039¡¡¡¡CScribbleView£º£º~CScribbleView£¨£©¡¡
#0040¡¡¡¡£û¡¡
#0041¡¡¡¡£ý¡¡
#0042¡¡
#0043¡¡¡¡BOOL¡¡CScribbleView£º£ºPreCreateWindow£¨CREATESTRUCT&¡¡cs£©¡¡
#0044¡¡¡¡£û¡¡
#0045¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡TODO£º¡¡Modify¡¡the¡¡Window¡¡class¡¡or¡¡styles¡¡here¡¡by¡¡modifying¡¡
#0046¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡¡¡the¡¡CREATESTRUCT¡¡cs¡¡
#0047¡¡
#0048¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return¡¡CView£º£ºPreCreateWindow£¨cs£©£»¡¡
#0049¡¡¡¡£ý¡¡
#0050¡¡
#0051¡¡¡¡////////////////////////////////////////////////////////////////¡¡
#0052¡¡¡¡//¡¡CScribbleView¡¡drawing¡¡
#0053¡¡
#0054¡¡¡¡void¡¡CScribbleView£º£ºOnDraw£¨CDC*¡¡pDC£©¡¡
#0055¡¡¡¡£û¡¡
#0056¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CScribbleDoc*¡¡pDoc¡¡=¡¡GetDocument£¨£©£»¡¡
#0057¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ASSERT_VALID£¨pDoc£©£»¡¡
#0058¡¡
#0059¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Get¡¡the¡¡invalidated¡¡rectangle¡¡of¡¡the¡¡view£»¡¡or¡¡in¡¡the¡¡case¡¡
#0060¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡of¡¡printing£»¡¡the¡¡clipping¡¡region¡¡of¡¡the¡¡printer¡¡dc¡£¡¡
#0061¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CRect¡¡rectClip£»¡¡
#0062¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CRect¡¡rectStroke£»¡¡
#0063¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pDC¡¡·GetClipBox£¨&rectClip£©£»¡¡
#0064¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pDC¡¡·LPtoDP£¨&rectClip£©£»¡¡
#0065¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡rectClip¡£InflateRect£¨1£»¡¡1£©£»¡¡//¡¡avoid¡¡rounding¡¡to¡¡nothing¡¡
#0066¡¡
#0067¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Note£º¡¡CScrollView£º£ºOnPaint£¨£©¡¡will¡¡have¡¡already¡¡adjusted¡¡the¡¡
#0068¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡viewport¡¡origin¡¡before¡¡calling¡¡OnDraw£¨£©£»¡¡to¡¡reflect¡¡the¡¡
#0069¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡currently¡¡scrolled¡¡position¡£¡¡
#0070¡¡
#0071¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡The¡¡view¡¡delegates¡¡the¡¡drawing¡¡of¡¡individual¡¡strokes¡¡to¡¡
#0072¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡CStroke£º£ºDrawStroke£¨£©¡£¡¡
#0073¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CTypedPtrList&¡¡strokeList¡¡=¡¡pDoc¡¡·m_strokeList£»¡¡
#0074¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡POSITION¡¡pos¡¡=¡¡strokeList¡£GetHeadPosition£¨£©£»¡¡
#0075¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡while¡¡£¨pos¡¡£¡=¡¡NULL£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡895¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡958¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÚÎåƪ¡¡¡¡¡¡¡¡¸½ä›¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0076¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£û¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0077¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CStroke*¡¡pStroke¡¡=¡¡strokeList¡£GetNext£¨pos£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0078¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡rectStroke¡¡=¡¡pStroke¡¡·GetBoundingRect£¨£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0079¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pDC¡¡·LPtoDP£¨&rectStroke£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0080¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡rectStroke¡£InflateRect£¨1£»¡¡1£©£»¡¡//¡¡avoid¡¡rounding¡¡to¡¡nothing¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0081¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if¡¡£¨£¡rectStroke¡£IntersectRect£¨&rectStroke£»¡¡&rectClip£©£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0082¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0083¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pStroke¡¡·DrawStroke£¨pDC£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0084¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0085¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0086¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0087¡¡¡¡/////////////////////////////////////////////////////////////////¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0088¡¡¡¡//¡¡CScribbleView¡¡printing¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0089¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0090¡¡¡¡BOOL¡¡CScribbleView£º£ºOnPreparePrinting£¨CPrintInfo*¡¡pInfo£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0091¡¡¡¡£û¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0092¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pInfo¡¡·SetMaxPage£¨2£©£»¡¡¡¡¡¡//¡¡the¡¡document¡¡is¡¡two¡¡pages¡¡long£º¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0093¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡the¡¡first¡¡page¡¡is¡¡the¡¡title¡¡page¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0094¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡the¡¡second¡¡is¡¡the¡¡drawing¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0095¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡BOOL¡¡bRet¡¡=¡¡DoPreparePrinting£¨pInfo£©£»¡¡¡¡¡¡//¡¡default¡¡preparation¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0096¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pInfo¡¡·m_nNumPreviewPages¡¡=¡¡2£»¡¡¡¡//¡¡Preview¡¡2¡¡pages¡¡at¡¡a¡¡time¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0097¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Set¡¡this¡¡value¡¡after¡¡calling¡¡DoPreparePrinting¡¡to¡¡override¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0098¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡value¡¡read¡¡from¡¡¡£INI¡¡file¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0099¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return¡¡bRet£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0100¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0101¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0102¡¡¡¡void¡¡CScribbleView£º£ºOnBeginPrinting£¨CDC*¡¡/*pDC*/£»¡¡CPrintInfo*¡¡/*pInfo*/£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0103¡¡¡¡£û¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0104¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡TODO£º¡¡add¡¡extra¡¡initialization¡¡before¡¡printing¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0105¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0106¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0107¡¡¡¡void¡¡CScribbleView£º£ºOnEndPrinting£¨CDC*¡¡/*pDC*/£»¡¡CPrintInfo*¡¡/*pInfo*/£©¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0108¡¡¡¡£û¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0109¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡TODO£º¡¡add¡¡cleanup¡¡after¡¡printing¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0110¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0111¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0112¡¡¡¡///////////////////////////////////////////////////////////////¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0113¡¡¡¡//¡¡CScribbleView¡¡diagnostics¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0114¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0115¡¡¡¡#ifdef¡¡_DEBUG¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0116¡¡¡¡void¡¡CScribbleView£º£ºAssertValid£¨£©¡¡const¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0117¡¡¡¡£û¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0118¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CScrollView£º£ºAssertValid£¨£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0119¡¡¡¡£ý¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0120¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0121¡¡¡¡void¡¡CScribbleView£º£ºDump£¨CDumpContext&¡¡dc£©¡¡const¡¡
896¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡959¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¸½ä›£Â¡¡¡¡¡¡¡¡Scribble¡¡Step5¡¡¡¡ÍêÕûÔʼ´a¡¡
#0122¡¡¡¡£û¡¡
#0123¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CScrollView£º£ºDump£¨dc£©£»¡¡
#0124¡¡¡¡£ý¡¡
#0125¡¡
#0126¡¡¡¡CScribbleDoc*¡¡CScribbleView£º£ºGetDocument£¨£©¡¡//¡¡non¡debug¡¡version¡¡is¡¡inline¡¡
#0127¡¡¡¡£û¡¡
#0128¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ASSERT£¨m_pDocument¡¡·IsKindOf£¨RUNTIME_CLASS£¨CScribbleDoc£©£©£©£»¡¡
#0129¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return¡¡£¨CScribbleDoc*£©m_pDocument£»¡¡
#0130¡¡¡¡£ý¡¡
#0131¡¡¡¡#endif¡¡//_DEBUG¡¡
#0132¡¡
#0133¡¡¡¡/////////////////////////////////////////////////////////////////¡¡
#0134¡¡¡¡//¡¡CScribbleView¡¡message¡¡handlers¡¡
#0135¡¡
#0136¡¡¡¡void¡¡CScribbleView£º£ºOnLButtonDown£¨UINT£»¡¡CPoint¡¡point£©¡¡
#0137¡¡¡¡£û¡¡
#0138¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Pressing¡¡the¡¡mouse¡¡button¡¡in¡¡the¡¡view¡¡window¡¡starts¡¡a¡¡new¡¡stroke¡¡
#0139¡¡
#0140¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡CScrollView¡¡changes¡¡the¡¡viewport¡¡origin¡¡and¡¡mapping¡¡mode¡£¡¡
#0141¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡It's¡¡necessary¡¡to¡¡convert¡¡the¡¡point¡¡from¡¡device¡¡coordinates¡¡
#0142¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡to¡¡logical¡¡coordinates£»¡¡such¡¡as¡¡are¡¡stored¡¡in¡¡the¡¡document¡£¡¡
#0143¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CClientDC¡¡dc£¨this£©£»¡¡
#0144¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OnPrepareDC£¨&dc£©£»¡¡
#0145¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡dc¡£DPtoLP£¨&point£©£»¡¡
#0146¡¡
#0147¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡m_pStrokeCur¡¡=¡¡GetDocument£¨£©¡¡·NewStroke£¨£©£»¡¡
#0148¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Add¡¡first¡¡point¡¡to¡¡the¡¡new¡¡stroke¡¡
#0149¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡m_pStrokeCur¡¡·m_pointArray¡£Add£¨point£©£»¡¡
#0150¡¡
#0151¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡SetCapture£¨£©£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Capture¡¡the¡¡mouse¡¡until¡¡button¡¡up¡£¡¡
#0152¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡m_ptPrev¡¡=¡¡point£»¡¡¡¡¡¡//¡¡Serves¡¡as¡¡the¡¡MoveTo£¨£©¡¡anchor¡¡point¡¡for¡¡the¡¡
#0153¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡LineTo£¨£©¡¡the¡¡next¡¡point£»¡¡as¡¡the¡¡user¡¡drags¡¡the¡¡
#0154¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡mouse¡£¡¡
#0155¡¡
#0156¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return£»¡¡
#0157¡¡¡¡£ý¡¡
#0158¡¡
#0159¡¡¡¡void¡¡CScribbleView£º£ºOnLButtonUp£¨UINT£»¡¡CPoint¡¡point£©¡¡
#0160¡¡¡¡£û¡¡
#0161¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡Mouse¡¡button¡¡up¡¡is¡¡interesting¡¡in¡¡the¡¡Scribble¡¡application¡¡
#0162¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡only¡¡if¡¡the¡¡user¡¡is¡¡currently¡¡drawing¡¡a¡¡new¡¡stroke¡¡by¡¡dragging¡¡
#0163¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡the¡¡captured¡¡mouse¡£¡¡
#0164¡¡
#0165¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if¡¡£¨GetCapture£¨£©¡¡£¡=¡¡this£©¡¡
#0166¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return£»¡¡//¡¡If¡¡this¡¡window¡¡£¨view£©¡¡didn't¡¡capture¡¡the¡¡mouse£»¡¡
#0167¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡then¡¡the¡¡user¡¡isn't¡¡drawing¡¡in¡¡this¡¡window¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡897¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡960¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÚÎåƪ¡¡¡¡¡¡¡¡¸½ä›¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0168¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0169¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CScribbleDoc*¡¡pDoc¡¡=¡¡GetDocument£¨£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0170¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0171¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CClientDC¡¡dc£¨this£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0172¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0173¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡CScrollView¡¡changes¡¡the¡¡viewport¡¡origin¡¡and¡¡mapping¡¡mode¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0174¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡It's¡¡necessary¡¡to¡¡convert¡¡the¡¡point¡¡from¡¡device¡¡coordinates¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0175¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¡¡to¡¡logical¡¡coordinates£»¡¡such¡¡as¡¡are¡¡stored¡¡in¡¡the¡¡document¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0176¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OnPrepareDC£¨&dc£©£»¡¡¡¡//¡¡set¡¡up¡¡mapping¡¡mode¡¡and¡¡viewport¡¡origin¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0177¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡dc¡£DPtoLP£¨&point£©£»¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0178¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡#0179¡¡