473,856 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make font background transparent

I do the following to pick a font.

Each letter this creates is displayed in a small solid colored rectangle.

Instead, I'd like the background image to show around the letters

Is there an easy change that would make the area around the letters


SavedTextColor= SetTextColor(hd cPaint, TextColor);

SavedBkColor=Se tBkColor(hdcPai nt,HighlightCol or);

memset(&lfLogic alFont, 0, sizeof(LOGFONT) );

lstrcpy(lfLogic alFont.lfFaceNa me, "Courier New");

lfLogicalFont.l fHeight=long(Zo omFactor*cyClie nt/30);

hFont=CreateFon tIndirect(&lfLo gicalFont);

hFontOld = SelectFont(hdcP aint, hFont);
Feb 6 '07 #1
2 2561
>I do the following to pick a font.
>Each letter this creates is displayed in a small solid colored rectangle.
Instead, I'd like the background image to show around the letters
Is there an easy change that would make the area around the letters
Have a look at the SetBkMode API - TRANSPARENT.

Feb 7 '07 #2
thanks, I'll look

"David Lowndes" <Da****@example .invalidwrote in message
news:5k******** *************** *********@4ax.c om...
I do the following to pick a font.
Each letter this creates is displayed in a small solid colored rectangle.
Instead, I'd like the background image to show around the letters
Is there an easy change that would make the area around the letters
transparent .

Have a look at the SetBkMode API - TRANSPARENT.


Feb 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape control. My control draws a shape (circle, square, rectangle ...)
by: zwylle | last post by:
Hi all, to avoid a nervous breakdown I finally decided to seek help :D I have a table defined with plain color background and in some cells I show pictures to frame my site. The problem I have occurs for one special cell. The background of this cell is as you can see an image. A text should be displayed on this image. I don't want the text to be bigger than the picture.
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
by: Susan Bricker | last post by:
Is there a way to change the background color of command buttons? I know that I saw some VBA code somewhere that showed how to do this. I think it involved making the button transparent and then creating a box the same size and making it have a color for the background. Although, I can't visualize the logic or how to kick off the 'click' event with this overlay sitution. Ok ... I am rambling. Does anyone have the answer to this one? ...
by: Ignacio Domínguez | last post by:
Hi there. I know I can make a form transparent by setting the transparent color, opacity, etc. Is there a way of making the background of a label and the background of a picturebox transparent also, so that I can place some text on top of an image (seing the image behind the text instead of the gray box of the label) and showing to the user only the image without the background of the picturebox or form, and the text over it? Any Ideas?...
by: Kalvin | last post by:
I keep getting my string inside a black box with this code. I would like to make the background transparent. Any help on this will be appreciated very much. '**** BEGIN CODE **** Try Dim NewFont As New Font(fg.Font.FontFamily, 10, FontStyle.Regular) Dim g As Graphics
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
by: benfly08 | last post by:
Hi, guys. I'm developing a web application for Sales Department people in my company. I used my 1024X768 resolution and "Medium" IE text size to test my Layout and it worked fine. However, some people in Sales Department use different settings like "800X600", "Larger" IE text size or even "Large font" in Appearance tab in Display Property. Those different settings would mess up my layout. What I want to do is to set font size of labels,...
by: Rudi Hausmann | last post by:
Hi! I want to "paint" some blocks with text in it. As the box can overlap I want the text to be transparent using opacity. Though, the text shall stay well visible. Here is what I produced so far: <div style="overflow: hidden; white-space: nowrap; opacity: 0.7; width: 50px; background-color: Fuchsia;">
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.