Solved

How to get bitmap from character

Posted on 1998-01-05
2
486 Views
Last Modified: 2013-12-02
How can I get a HBITMAP of a single character ?
I have found an example somewhere that uses GetGlyphOutline, but this seems to work only for TrueType fonts. Is there a similar function for bitmap fonts, or does anyone know another method to create a HBITMAP from a single character ?

Thanks, Marc
0
Comment
Question by:parlando
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 200 total points
ID: 1256918
First create memory DC by CreateCompatibleDC.
Then create compatible bitmap using CreateCompatibleBitmap with size as character sell. Select bitmap into DC. Draw character using DrawText or (Ext)TextOut on memory DC. Reselect old bitmap. Now you have character bitmap
0
 

Author Comment

by:parlando
ID: 1256919
Sounds quite simple!
I suppose this works for bitmap fonts as well as for TrueType fonts ?

Thanks for answering !
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now