Click here to Skip to main content
16,013,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 774 Pin
Jon Hulatt4-Feb-02 23:23
Jon Hulatt4-Feb-02 23:23 
GeneralC2100 Pin
4-Feb-02 16:15
suss4-Feb-02 16:15 
GeneralRe: C2100 Pin
Le centriste4-Feb-02 16:31
Le centriste4-Feb-02 16:31 
Questionhow do you compile? Pin
4-Feb-02 15:19
suss4-Feb-02 15:19 
AnswerRe: how do you compile? Pin
Christian Graus4-Feb-02 16:31
protectorChristian Graus4-Feb-02 16:31 
GeneralRe: how do you compile? Pin
Jon Hulatt4-Feb-02 23:28
Jon Hulatt4-Feb-02 23:28 
GeneralAnother string / buffer question Pin
Tom Wright4-Feb-02 12:35
Tom Wright4-Feb-02 12:35 
GeneralFont size and ISAPI Pin
Guillaume F.4-Feb-02 12:11
Guillaume F.4-Feb-02 12:11 
Hi,
I was trying to write some string in a bitmap. Every things work fond except that I cannot change the font size. Why can I put my font in italic without any problem and I can't change my font size. This code is use in a ISAPI. Source code follow...
Thanks
Guillaume Frechette

bool Write(CString sText,int nFontType,int nFontSize,CRect cRect)
{
CClientDC dc(NULL);
CDC mdc;
CFont* pFont=NULL;
CFont* pOldFont=NULL;
CFont myFont;
LOGFONT lf;

mdc.CreateCompatibleDC(&dc);
CBitmap* pOldBitmap = mdc.SelectObject(&m_Image);
BITMAP bmp;
m_Image.GetBitmap(&bmp);
pFont = mdc.GetCurrentFont();
if(pFont){
pFont->GetLogFont(&lf);
lf.lfHeight = -MulDiv(nFontSize,
GetDeviceCaps(dc.GetSafeHdc(),LOGPIXELSY),72);
lf.lfWidth = 0;
lf.lfItalic = 1;
myFont.CreateFontIndirect(&lf);
}
else
return false;
pOldFont = mdc.SelectObject(&myFont);
mdc.DrawText(_T(sText),cRect,DT_LEFT|DT_VCENTER|DT_SINGLELINE);
dc.BitBlt(0,0,bmp.bmWidth,bmp.bmHeight,&mdc,0,0,SRCCOPY);
if(pOldFont)
mdc.SelectObject(pOldFont);
CBitmap* pNewBitmap = mdc.SelectObject(pOldBitmap);
return true;
}
GeneralString problem Pin
Tom Wright4-Feb-02 11:32
Tom Wright4-Feb-02 11:32 
GeneralRe: String problem Pin
lucy4-Feb-02 11:48
lucy4-Feb-02 11:48 
GeneralRe: String problem Pin
Nemanja Trifunovic4-Feb-02 11:47
Nemanja Trifunovic4-Feb-02 11:47 
GeneralRe: String problem Pin
Stan Shannon4-Feb-02 12:07
Stan Shannon4-Feb-02 12:07 
GeneralRe: String problem Pin
Tom Wright4-Feb-02 12:12
Tom Wright4-Feb-02 12:12 
GeneralRe: String problem Pin
Jon Hulatt4-Feb-02 23:27
Jon Hulatt4-Feb-02 23:27 
GeneralRe: String problem Pin
Christian Graus4-Feb-02 16:35
protectorChristian Graus4-Feb-02 16:35 
GeneralLots of Page Faults Pin
Le centriste4-Feb-02 9:27
Le centriste4-Feb-02 9:27 
GeneralRe: Lots of Page Faults Pin
Jon Sagara4-Feb-02 9:41
Jon Sagara4-Feb-02 9:41 
General.Net Pin
Mazdak4-Feb-02 9:20
Mazdak4-Feb-02 9:20 
GeneralRe: .Net Pin
Jay Beckert4-Feb-02 10:07
Jay Beckert4-Feb-02 10:07 
GeneralRe: .Net Pin
Mazdak4-Feb-02 11:36
Mazdak4-Feb-02 11:36 
GeneralRe: .Net Pin
Christian Graus4-Feb-02 16:37
protectorChristian Graus4-Feb-02 16:37 
GeneralRe: .Net Pin
Jon Sagara4-Feb-02 16:50
Jon Sagara4-Feb-02 16:50 
GeneralRe: .Net Pin
Christian Graus4-Feb-02 16:56
protectorChristian Graus4-Feb-02 16:56 
GeneralRe: .Net Pin
Jay Beckert5-Feb-02 11:05
Jay Beckert5-Feb-02 11:05 
GeneralRe: .Net Pin
Christian Graus5-Feb-02 11:13
protectorChristian Graus5-Feb-02 11:13 

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.