几何尺寸与公差论坛

 找回密码
 注册
查看: 104|回复: 1

PR 245512 First line text of FCF is cropped in graphics window.

[复制链接]
发表于 2009-1-5 19:33:03 | 显示全部楼层 |阅读模式
First line text of FCF is cropped in graphics window.
<< Larry Clark  --  12/08/06  12:09:38>>
In the graphics window, the left edge of the upper text line of FCF labels is getting cropped.  It looks like about 20% of the leftmost character is getting cropped (see attached BMP).  For example, in the case of 8 X &oslash; 15 0.01 / 0.01 , the cropping makes the text appear as 3 X &oslash; 15 0.01 / 0.01.  
Steps to reproduce:
As described.
Results:
See attached BMP
<<END>>

<< Changes made by Neil Kay -- 12/12/08  09:25:32>>
Action:  Matt Gotch to Yanhua Huang, Assigned:  Don Turcotte to CMM Group
<<END>>
<< Changes made by Neil Kay -- 07/23/08  11:23:35>>
Action:  David Petrizze to Matt Gotch
<<END>>
<< Don Turcotte  --  04/26/07  11:00:56>>
Additional fix for 245513.
<<END>>
<< Don Turcotte  --  04/26/07  10:25:47>>
Fixed in V42beta and V43B.
Files inserted to server
------------------------
V42\DIMENS\GDTHELP.CPP
V43B\DIMENS\GDTHELP.CPP
<<END>>
<< Changes made by Don Turcotte -- 04/26/07  10:26:03>>
Action:  Don Turcotte to David Petrizze, Status:  OPEN to REVIEW
<<END>>
<< Bill Velle  --  01/11/07  17:26:00>>
The cropping happens with some fonts when the bitmap is first created by the GD&T logic.  By the time Graph3 gets the bitmap for the FCF it is already too late – the text is clipped.
You can check the bitmap by saving it to a temp file and looking at it with MS PAINT.  The code to do that is:
    #include "atlimage.h"
    CString tmpName;
    tmpName.Format(_T("C:\\_Bitmap%X.jpg"), (DWORD) m_hBitmap);  // A unique name, saved as JPG…
    CImage tmpImage;
    tmpImage.Attach(m_hBitmap);  // This is your HBITMAP
    tmpImage.Save(tmpName);
    tmpImage.Detach();
After the above code is executed you can look at the JPG file using MS Paint.  Whatever is in this file is displayed by Graph3.
This is what I did in Graph3 to verify the bitmap is clipped before Graph3 gets it.  
See Graph3\TextBox.CPP which uses similar code in a DEBUG build.
<<END>>
<< Changes made by Bill Velle -- 01/11/07  17:28:37>>
Category:  graphics to GD&T, Action:  Bill Velle to Don Turcotte, Assigned:  Bill Velle to Don Turcotte
<<END>>
<< Larry Clark  --  01/10/07  11:02:19>>
Please see the attachment FCF_crop.zip which contains a new part program illustrating the same problem.  The graphic font was set to the installation default which is Arial Regular 7pt.  The screen resolution was 1280 by 1024 pixels.
<<END>>
<< Changes made by Larry Clark -- 01/10/07  11:02:54>>
Action:  Larry Clark to Bill Velle, Status:  MOREINFO to OPEN
<<END>>
<< Bill Velle  --  01/10/07  11:31:37>>
Please attach the program & which fonts are being used.  The graphics window is displaying a bitmap which is created elsewhere in PC-DMIS.
<<END>>
<< Changes made by Bill Velle -- 01/10/07  11:31:53>>
Action:  Bill Velle to Larry Clark, Status:  OPEN to MOREINFO
<<END>>
<< Tim Wernicke  --  12/08/06  14:06:58>>
This can usually be worked around by changing screen resolution and/or fonts.  But, our defaults should always work.
<<END>>
<< Changes made by Tim Wernicke -- 12/08/06  14:07:12>>
Category:  GD&T to graphics, Action:  Tim Wernicke to Bill Velle, Assigned:  Don Turcotte to Bill Velle, Priority:  to High
<<END>>
 楼主| 发表于 2009-1-5 19:41:24 | 显示全部楼层

回复: PR 245512 First line text of FCF is cropped in graphics window.

t:\V44B\DIMENS\GDTHELP.CPP
voidDrawFCFCallout(CPCDpart_program *m_pPartProgram, CDC *pDC, CPCDFeatCtrlFrm *pFCF, CRect *pRect, CSize *pSize, intFcfLineNum)

T:\V44B\DIMENS\GDTHELP.CPP(153): pDC->ExtTextOut(pos_x+2,pos_y, ETO_CLIPPED|ETO_OPAQUE, NULL, str, str.GetLength(), NULL); // PR245512

T:\V44B\DIMENS\GDTHELP.CPP(524): pDC->ExtTextOut(pos_x,pos_y+2, ETO_CLIPPED|ETO_OPAQUE, NULL, str, str.GetLength(), NULL); // PR245512

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 01:06 , Processed in 0.036997 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表