15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Problems with COleFont

Ballerini Luca -- ballerini@esalab.it
Thursday, July 25, 1996

Environment: VC++ 4.1 under WinNT 3.51

Hallo,

I'm trying to get rid of the SetSize() function of an COleFont class
generated from an ocx.
The SetSize() function takes a CY structure as parameter. How to set the CY
structure properly from my LOGFONT structure (or from the point size of my
font) to get the right font size?

I hope someone can help me


******************************
Ballerini Luca Stefano
home: +39 (0)721-479154
ballerini@esalab.it
Esalab engineering and service
+39 (0)721-414634
******************************







Benny -- blee@filenet.com
Monday, July 29, 1996


Try the following formula to convert LOGFONT.lfHeight to FONTDESC.cySize:

    CDC* pDC = CWnd::GetDesktopWindow()->GetDC();
    int cyPPI = GetDeviceCaps(pDC->GetSafeHdc(), LOGPIXELSY);
    FontDesc.cySize.int64 = MulDiv(abs(LogFont.lfHeight), 72, cyPPI) * 
10000L;

Benny
 ----------
From: owner-mfc-l
To: mfc-l
Subject: Problems with COleFont
Date: Thursday, July 25, 1996 8:06AM

Environment: VC++ 4.1 under WinNT 3.51

Hallo,

I'm trying to get rid of the SetSize() function of an COleFont class
generated from an ocx.
The SetSize() function takes a CY structure as parameter. How to set the CY
structure properly from my LOGFONT structure (or from the point size of my
font) to get the right font size?

I hope someone can help me


******************************
Ballerini Luca Stefano
home: +39 (0)721-479154
ballerini@esalab.it
Esalab engineering and service
+39 (0)721-414634
******************************








| Вернуться в корень Архива |