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

x
?
Solved

How to output a string of characters on top of the wallpaper

Posted on 2006-06-29
7
Medium Priority
?
450 Views
Last Modified: 2013-12-03
I'm using a VC++ 6 application that can display bitmap files as wallpapers. Now I want to output a string of letters on top of that bitmap, i.e., different strings for different bitmaps. Please any expert can give any suggestion?
Btw that string can be assigned different fonts and/or color and must have a transparrent background as not to affect the bitmap itself.
0
Comment
Question by:Volga
[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
7 Comments
 
LVL 2

Expert Comment

by:seet82
ID: 17015315
when u say wallpaper, you are refering to the application wallpaper right?

one way to do it is using GDI calls to draw the string after you have drawn the bitmap

i'm currently posting outside and has no access to my MSDN and can't post examples...if u wish, i could do that when i reach hom
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17015968
Following article with src will help you :

'Rendering text on top of a bitmap'
http://www.codeproject.com/gdi/BitmapTest.asp

-MAHESH
0
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 17016050
you can get a handle to the desktop window using GetWindowDC() and then you can call TextOut()


HDC dc = GetWindowDC(GetDesktopWindow());

TextOut(hdc, 0, 0, "Jason", 6);

BUT..... this text will dispear when the desktopwindow repaints itself so you need to know when the desktop will repaint itself andthen recall the above code.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 17016458
You could add bitmap button to your main form, make it as big as the form and assign the wallpaper as bitmap. The button needs to be first in tab order. Any other control can be made transparent by property thus appearing properly above the wallpaper.

If you need jpeg or png you might turn the *button* to an owner-draw button Then you need to supply a callback function DrawItem which does all drawing itself. You could move all code that paints the wallpaper now to the DrawItem function. Moreover, the function is suitable to do any additional drawing, e. g. drawing coloured text to anywhere using the current device context (GDI).

Regards, Alex

0
 

Author Comment

by:Volga
ID: 17018760
Thanx for al your help. However I still could not make it to work. Now let's forget about wallpapers for now and get back to a simple question:
How do I output a line of text on any deskop?
I have a hard time writing some routine, so a real example will be very helpful.
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 400 total points
ID: 17019261
>>How do I output a line of text on any deskop?

You can do one of 2 things:

1. Get the DC of the desktop. You can then draw on that.
CClientDC dcDesktop(CWnd::GetDesktopWindow());
dcDesktop.TextOut(...);

OR

2. Get the DC of the display device.
CDC dc;
dc.CreateDC("DISPLAY", NULL, NULL, NULL);
dcDesktop.TextOut(...);
dc.DeleteDC();

-MAHESH
0
 

Author Comment

by:Volga
ID: 17022320
Thanx again for the advice from the experts. All are good suggestions but Mahesh gave me a code that really worked in my application.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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