2012年2月1日
摘要: CFont* pFont = pDC->GetCurrentFont(); LOGFONT logFont ; pFont->GetLogFont(&logFont); logFont.lfEscapement = 900 ;//900/10 = 90 HFONT hFont = CreateFontIndirect(&logFont); pDC->SelectObject(hFont); pDC->TextOut(200,200,"VC中如何把一串文字旋转90度显示的?"); 阅读全文
posted @ 2012-02-01 15:14 carekee 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 一、投影文字 private void Form1_Paint(object sender, PaintEventArgs e) { //投影文字 Graphics g = this.CreateGraphics(); //设置文本输出质量 g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.SmoothingMode = SmoothingMode.AntiAlias; Fon... 阅读全文
posted @ 2012-02-01 15:09 carekee 阅读(1129) 评论(0) 推荐(0) 编辑
摘要: 一、DLL的导出方法1、使用_declspec(dllexport) 方法 DLL里全是C++的类的话,你无法在DEF里指定导出的函数,只能用__declspec(dllexport)导出类。extern "C" _declspec(dllexport) int sum(int a,int b);//本文所有的例子只有一个sum即加法函数。 在制作DLL导出函数时由于C++存在函数重载,因此__declspec(dllexport) function(int,int) 在DLL会被decorate,例如被decorate成为 function_int_int,而且不同的编译 阅读全文
posted @ 2012-02-01 15:04 carekee 阅读(698) 评论(0) 推荐(0) 编辑
摘要: HWND pWnd = FindWindow(NULL,"另存为"); //获得窗口的句柄void saveopen(HWND pWnd){HWND m_hWnd=pWnd;HWND hWndChild =::GetWindow(m_hWnd,GW_CHILD); TCHAR BUF[512];CString filename;CWnd *pedit;while(hWndChild) { char *buf=new char[512];::GetClassName(hWndChild,buf,512);//得到枚举的控件是什么类型的,CString str=buf; str 阅读全文
posted @ 2012-02-01 15:03 carekee 阅读(2096) 评论(0) 推荐(0) 编辑
摘要: 学习MFC过程中从书中提炼出来的表格,方便使用。设备描述表属性、GDI画笔和CPen类、GDI画刷和CBrush类、主要的GDI颜色、CDC文本函数、GDI文本对齐方式、常用设备对象。设备描述表属性当使用CDC输出函数在屏幕画图时,输出的某些特性并没有在函数调用过程中规定,但可以通过设备描述表自身获得。如果想忽略背景颜色,可将背景模式设置为“transparent”。Attribute Default Set with Get with文本颜色 Black CDC::SetTextColor CDC::GetTextColor背景颜色 White CDC::SetBkColor ... 阅读全文
posted @ 2012-02-01 15:02 carekee 阅读(1398) 评论(0) 推荐(0) 编辑
摘要: int DrawArrowLine(HDC hDC, LPPOINT lpPointStart, LPPOINT lpPointEnd, double nArrowBorderLen, double xAngleInRadians, COLORREF cr){const double PI = 3.1415926;double xAngleLine = 0;if (lpPointStart->x == lpPointEnd->x)xAngleLine = PI / 2;else{xAngleLine = atan((double(lpPointEnd->y) - double 阅读全文
posted @ 2012-02-01 14:53 carekee 阅读(2468) 评论(0) 推荐(0) 编辑