Click here to Skip to main content
15,899,124 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGUI Builder Pin
Anonymous11-Nov-04 16:21
Anonymous11-Nov-04 16:21 
GeneralRe: GUI Builder Pin
alex.barylski11-Nov-04 20:56
alex.barylski11-Nov-04 20:56 
Questionhow to simulate the action of key of power Pin
yingkou11-Nov-04 14:21
yingkou11-Nov-04 14:21 
AnswerRe: how to simulate the action of key of power Pin
Christian Graus11-Nov-04 15:02
protectorChristian Graus11-Nov-04 15:02 
GeneralRe: how to simulate the action of key of power Pin
yingkou12-Nov-04 13:22
yingkou12-Nov-04 13:22 
GeneralRe: how to simulate the action of key of power Pin
Christian Graus12-Nov-04 22:23
protectorChristian Graus12-Nov-04 22:23 
GeneralIs an adapter Wireless or Not Pin
Anonymous11-Nov-04 12:11
Anonymous11-Nov-04 12:11 
GeneralGDI+ GraphicsPath AddString Pin
rob_toutant11-Nov-04 10:52
rob_toutant11-Nov-04 10:52 
Has anyone else found that adding a String to a GraphicsPath, GraphicsPath.AddString, produces a smaller font size than using Graphics.AddString -

there is nothing in my code which is adding any global transformations to the path.

In the microsoft documentation it shows that the font size for Using GraphicsPath.AddString is in World Units ??? anybody have a suggestion to make the font size correct ?

Mad | :mad:
<br />
//code which produces the correct font display size<br />
<br />
void DrawTextPathRect(Graphics *g,float x, float y,float width, float height,LPCSTR str, LPCSTR strFont, float size, int align, int style,COLORREF cr, int alpha)<br />
{<br />
        CString s(_T(str));<br />
        CString sFont(_T(strFont));<br />
        Font font(sFont.AllocSysString(), size);<br />
<br />
        FontFamily ff<br />
<br />
        font.GetFamily(&ff);<br />
<br />
        StringFormat sf;<br />
        sf.SetAlignment((StringAlignment) (align&3));<br />
        RectF p(x, y,width,height);<br />
<br />
        SolidBrush crBrush(Color(alpha, GetRValue(cr), GetGValue(cr), GetBValue(cr)));<br />
<br />
        g->SetCompositingMode( CompositingModeSourceOver );<br />
        g->SetSmoothingMode( SmoothingModeAntiAlias );<br />
        g->SetCompositingQuality( CompositingQualityAssumeLinear );<br />
        g->SetTextRenderingHint( TextRenderingHintAntiAlias );<br />
<br />
     // Draw string.<br />
   g->DrawString(<br />
   s.AllocSysString(),<br />
   s.GetLength(),<br />
   &font,<br />
   p,<br />
   &sf,<br />
   &crBrush);<br />
<br />
<br />
}<br />
<br />
//this produces the font which does not match the above <br />
// it is smaller by about 20 percent<br />
<br />
GraphicsPath *BuildTextPathRect(float x, float y,float width, float height,LPCSTR str, LPCSTR strFont, float size, int align, int style)<br />
{<br />
        CString s(_T(str));<br />
        CString sFont(_T(strFont));<br />
        Font font(sFont.AllocSysString(), size);<br />
<br />
        FontFamily ff;<br />
        font.GetFamily(&ff);<br />
<br />
        StringFormat sf;//Set=(StringFormat) align;<br />
        sf.SetAlignment((StringAlignment) align);<br />
        RectF p(x, y,width,height);<br />
        GraphicsPath *path = new GraphicsPath();<br />
<br />
        REAL enSize = font.GetSize();<br />
        path->AddString(s.AllocSysString(), s.GetLength(), &ff, (FontStyle) style, enSize, p, & sf);<br />
<br />
        return path;<br />
<br />
}<br />


robert
Generaledit box properties Pin
MDowning11-Nov-04 10:43
MDowning11-Nov-04 10:43 
GeneralRe: edit box properties Pin
John R. Shaw11-Nov-04 12:09
John R. Shaw11-Nov-04 12:09 
QuestionEnhancement in CEditView ??? Pin
Gl@nce11-Nov-04 10:36
Gl@nce11-Nov-04 10:36 
AnswerRe: Enhancement in CEditView ??? Pin
John R. Shaw11-Nov-04 12:19
John R. Shaw11-Nov-04 12:19 
GeneralXP Visual Styles in Custom Explorer bars Pin
carlb11-Nov-04 9:34
carlb11-Nov-04 9:34 
GeneralTaskbar button height Pin
Fantmx11-Nov-04 9:03
Fantmx11-Nov-04 9:03 
GeneralRe: Taskbar button height Pin
PJ Arends11-Nov-04 10:50
professionalPJ Arends11-Nov-04 10:50 
GeneralRe: Taskbar button height Pin
Fantmx11-Nov-04 13:10
Fantmx11-Nov-04 13:10 
GeneralRe: Taskbar button height Pin
PJ Arends12-Nov-04 6:35
professionalPJ Arends12-Nov-04 6:35 
GeneralCalling JScript from MFC App Pin
nlecren11-Nov-04 7:35
nlecren11-Nov-04 7:35 
GeneralSelf-deleting executable Pin
BlackDice11-Nov-04 5:58
BlackDice11-Nov-04 5:58 
GeneralRe: Self-deleting executable Pin
Rick York11-Nov-04 6:49
mveRick York11-Nov-04 6:49 
GeneralRe: Self-deleting executable Pin
Navin11-Nov-04 6:57
Navin11-Nov-04 6:57 
GeneralRe: Self-deleting executable Pin
BlackDice11-Nov-04 7:14
BlackDice11-Nov-04 7:14 
QuestionHOW CAN I CONVERT VISUAL C++ DLL(a DLL which writed in visual C++) TO BORLAND DLL? Pin
gurk@n11-Nov-04 5:13
gurk@n11-Nov-04 5:13 
AnswerRe: HOW CAN I CONVERT VISUAL C++ DLL(a DLL which writed in visual C++) TO BORLAND DLL? Pin
Anonymous11-Nov-04 7:46
Anonymous11-Nov-04 7:46 
GeneralVirtual serial port and TCP/IP Pin
Nikolaou11-Nov-04 4:41
Nikolaou11-Nov-04 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.