Click here to Skip to main content
16,020,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CListCtrl :: FindItem() Pin
Hamid Taebi21-Aug-06 22:53
professionalHamid Taebi21-Aug-06 22:53 
GeneralRe: CListCtrl :: FindItem() Pin
Anu_Bala22-Aug-06 0:18
Anu_Bala22-Aug-06 0:18 
GeneralRe: CListCtrl :: FindItem() Pin
Hamid Taebi22-Aug-06 1:08
professionalHamid Taebi22-Aug-06 1:08 
AnswerRe: CListCtrl :: FindItem() Pin
ftsOne22-Aug-06 17:25
ftsOne22-Aug-06 17:25 
Questionreading bitmap bytes from a font file Pin
Vissu8921-Aug-06 21:27
Vissu8921-Aug-06 21:27 
AnswerRe: reading bitmap bytes from a font file Pin
Steve S21-Aug-06 22:07
Steve S21-Aug-06 22:07 
GeneralRe: reading bitmap bytes from a font file Pin
Vissu8922-Aug-06 4:16
Vissu8922-Aug-06 4:16 
GeneralRe: reading bitmap bytes from a font file Pin
Steve S23-Aug-06 3:19
Steve S23-Aug-06 3:19 
Well, often you don't need to do anything other than use CreateFont or CreateFontIndirect, then select that font into a DC before using any of the text output functions. Controls generally support being sent a WM_SETFONT message so that they use the correct font themselves.

To retrieve the bitmap of a font character isn't difficult, but there are limitations.

1. Create the font (use CreateFont or CreateFontIndirect).
2. Select the font into a screen DC
3. Use GetTextExtent to find out how big a bitmap you need for your text.
4. Deselect the font from the screen DC
5. Create a compatible (with the screen DC) DC - your memory DC
6. Create an appropriately sized compatible bitmap (compatible with the screen DC, not the memory DC), and select it into your memory DC.
7. Set a background colour for the memory DC
8. Set a text colour for the memory DC.
9. Select your font into the memory DC.
10. Output your text
--- You now have the bitmap
11. CLEAN UP!
Deselect the font from memory DC and delete it
Deselect bitmap from memory DC and delete it
Delete memory DC
12. Don't forget to release the screen DC you got in stage#2.

There, that was easy, wasn't it ? Smile | :)
Unless you're saving the bitmaps, like I say, you just need to create and select the font you need, before drawing text, in which case, most of the work is done for you Smile | :)


Steve S
Developer for hire

GeneralRe: reading bitmap bytes from a font file Pin
Vissu8923-Aug-06 16:57
Vissu8923-Aug-06 16:57 
GeneralRe: reading bitmap bytes from a font file Pin
Steve S23-Aug-06 21:51
Steve S23-Aug-06 21:51 
Questionlow leve keyboard hook callback not called from service [modified] Pin
_tasleem21-Aug-06 21:12
_tasleem21-Aug-06 21:12 
AnswerRe: low leve keyboard hook callback not called from service Pin
Stephen Hewitt21-Aug-06 21:59
Stephen Hewitt21-Aug-06 21:59 
GeneralRe: low leve keyboard hook callback not called from service [modified] Pin
_tasleem21-Aug-06 22:31
_tasleem21-Aug-06 22:31 
GeneralRe: low leve keyboard hook callback not called from service Pin
Blake Miller22-Aug-06 9:00
Blake Miller22-Aug-06 9:00 
GeneralRe: low leve keyboard hook callback not called from service Pin
_tasleem22-Aug-06 19:44
_tasleem22-Aug-06 19:44 
AnswerRe: low leve keyboard hook callback not called from service Pin
Hamid Taebi21-Aug-06 22:42
professionalHamid Taebi21-Aug-06 22:42 
GeneralRe: low leve keyboard hook callback not called from service [modified] Pin
_tasleem22-Aug-06 0:53
_tasleem22-Aug-06 0:53 
QuestionObject matching algorithm in image processing using VC++ [modified] Pin
dinesh_IP21-Aug-06 20:40
dinesh_IP21-Aug-06 20:40 
QuestionDatabase query in VC++?? Pin
madhu_v21-Aug-06 19:59
madhu_v21-Aug-06 19:59 
QuestionCString to double Pin
QuickDeveloper21-Aug-06 19:59
QuickDeveloper21-Aug-06 19:59 
AnswerRe: CString to double Pin
Justin Tay21-Aug-06 20:19
Justin Tay21-Aug-06 20:19 
AnswerRe: CString to double Pin
Hamid Taebi21-Aug-06 20:49
professionalHamid Taebi21-Aug-06 20:49 
Questioni want to send and receive using USB Port in VC++ Pin
ppadmaraju21-Aug-06 19:55
ppadmaraju21-Aug-06 19:55 
AnswerRe: i want to send and receive using USB Port in VC++ Pin
Cedric Moonen21-Aug-06 20:25
Cedric Moonen21-Aug-06 20:25 
QuestionProblem with Device Driver Launcher Program Pin
Pratheep Kenny21-Aug-06 19:36
Pratheep Kenny21-Aug-06 19:36 

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.