Chinaunix首页 | 论坛 | 博客
  • 博客访问: 14490757
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68081
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 20:52:09

下载本文示例代码
  可以调用GDIObject:: GetObject。这个函数将指定图表设备的消息写入到缓冲区。下例创建了几个有用的辅助函数。 //Determine if font is bold. BOOL IsFontBold (const CFont&font) { LOGFONT stFont; font.GetObject (sizeof (LOGFONT), &stFont); return (stFont.lfBold)? TRUE: FALSE; } //Return the size of a bitmap. CSize GetBitmapSize (const CBitmap&bitmap) { BITMAP stBitmap; bitmap.GetObject (sizeof (BITMAP), &stBitmap); return CSize (stBitmap.bmWidth, stBitmap. bmHeight); } //Create a pen with the same color as a brush. BOOL CreatePenFromBrush (Cpen&pen, cost Cbrush&brush) { LOGBRUSH stBrush; brush.Getobject (sizeof (LOGBRUSH), &stBrush); return pen. Createpen (PS_SOLID, 0, stBrush.ibColor); }   可以调用GDIObject:: GetObject。这个函数将指定图表设备的消息写入到缓冲区。下例创建了几个有用的辅助函数。 //Determine if font is bold. BOOL IsFontBold (const CFont&font) { LOGFONT stFont; font.GetObject (sizeof (LOGFONT), &stFont); return (stFont.lfBold)? TRUE: FALSE; } //Return the size of a bitmap. CSize GetBitmapSize (const CBitmap&bitmap) { BITMAP stBitmap; bitmap.GetObject (sizeof (BITMAP), &stBitmap); return CSize (stBitmap.bmWidth, stBitmap. bmHeight); } //Create a pen with the same color as a brush. BOOL CreatePenFromBrush (Cpen&pen, cost Cbrush&brush) { LOGBRUSH stBrush; brush.Getobject (sizeof (LOGBRUSH), &stBrush); return pen. Createpen (PS_SOLID, 0, stBrush.ibColor); } 下载本文示例代码


获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息获取GDI对象的属性信息
阅读(127) | 评论(0) | 转发(0) |
0

上一篇:定制资源

下一篇:Windows 95的内存共享

给主人留下些什么吧!~~