Click here to Skip to main content
12,950,268 members (66,329 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a problem: open a bitmap file and draw a string on it with C++ language, do you think about this? Please help me do this, thanks.
Posted 15-Jan-13 13:39pm
Sergey Alexandrovich Kryukov 15-Jan-13 19:52pm
Your platform?
Andrewpeter 16-Jan-13 8:44am
Thanks SA for your question, I code "Console" platform. Hope you help me.
Sergey Alexandrovich Kryukov 16-Jan-13 13:15pm
Sorry, "Console" is not a platform. And, with your problem, it does not matter at all if you use console or not. Do you mean Windows, Linux, something else?
Andrewpeter 16-Jan-13 22:28pm
My platform is Windows. Thanks.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I wanted to advise you to find it out from the CodeProject article referenced below, but wasn't sure you are asking about Windows. Still not 100% sure, but I saw that you mentioned MFC and some of your other questions was for Windows. Please see:
Drawing lines, shapes, or text on bitmaps[^].

Please see my comments to your question, and, next time, please understand that the platform tag is almost always important for your question.

Andrewpeter 16-Jan-13 22:27pm
Yes sir, it's great. Thank you very much.
Sergey Alexandrovich Kryukov 16-Jan-13 22:43pm
My pleasure.
Good luck, call again,
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If you're going to do it with the Windows API (really it's GDI component), You need to know about handling memory DC's. That's quit a long topic give you a full answer.

Here're some sources :
>> Programming Windows Charles Petzold (see chap. 14) -
>> A Codeproject Article -
>> Search google - There's plenty of things about DCs
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

hi dear sergey
if you work with visual c++, below code helps you:

CImage i;
CDC cdc;
cdc.TextOut(_T("Hello world"),10,10);
Andrewpeter 16-Jan-13 8:45am
Thanks, your code is used for MFC?
Sergey Alexandrovich Kryukov 16-Jan-13 22:43pm
Shared between ATL and MFC:

Sergey Alexandrovich Kryukov 16-Jan-13 22:41pm
Who do you call Sergey?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,829
CHill60 3,460
Maciej Los 2,953
Jochen Arndt 1,975
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100