[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Adding text on to a bitmap handle.

Posted on 1998-11-16
1
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
migel earned 40 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

656 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