Solved

Adding text on to a bitmap handle.

Posted on 1998-11-16
1
166 Views
Last Modified: 2013-11-20
I have loaded a bitmap and have the bitmap handle.Now I have to add some text on to the bitmap and save it. How do I do?
0
Comment
Question by:rharsha
1 Comment
 
LVL 12

Accepted Solution

by:
migel earned 20 total points
ID: 1324786
Hi!
To add text to the bitmap you must select bitmap into Device Context and simple draw text by API function.
for example:

// Draw text into bitmap at the pt.x, pt.y  position
BOOL DrawTextIntoBitmap(HBITMAP hbm, LPSTR lpszText, HFONT hFont, POINT pt)
{
HDC hdc = CreateCompatibleDC(NULL); // compatible with system screen DC
if (!hdc)
    return FALSE;
HBITMAP hbmOld = (HBITMAP) SelectObject(hdc, hbm);
HFONT hFontOld = (HFONT) SelectObject(hdc, hFont);

TextOut(hdc, pt. x, pt.y,  lpszText, lstrlen(lpszText));
SelectObject(hdc, hFontOld);
SelectObject(hdc, hbmOld);
DeleteDC(hdc);
return TRUE;
}
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 61
windows 10 how make picture as desktop background 2 62
maxBlock challenge 30 129
sum13 challenge 24 107
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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