Solved

Bitmaps

Posted on 1997-12-18
4
328 Views
Last Modified: 2013-12-03
I dont really know how to word this question, so I'll explain.  I have a bitmap (of a large key).  I wish to display this bitmap, but I want it to be transparent (around the key, not through it).  I want other application running under the key to be shown through it (including the desktop, explorer etc).

I am running Windows 95 with Delphi 3.0

Any help would be appreciated.
0
Comment
Question by:SJohnson
[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
  • 2
4 Comments
 
LVL 4

Expert Comment

by:StevenB
ID: 1354146
 If your picture is not too complicated then you might consider redrawing it as a Metafile, as this will handle the transparency.
  If this is not possible then you could either investigate the TImageList, which I believe has some transparency attributes, or search for a transparent image component on one of the component sites (Delphi Deli, Delphi Super Page).

  Steven.
0
 
LVL 3

Expert Comment

by:altena
ID: 1354147
take a look at the "bitblt" function in the win32 API.

(and play around with the "dwRop" parameter.)

  Good Luck
0
 
LVL 1

Author Comment

by:SJohnson
ID: 1354148
Maybe the question wasnt clear enough, I dunno.  Lets try again.  I have an image of a key (it would be impossible to make this a metafile).  I want to place this image on a form, as a transparent image, but also having the form either transparent as well, or, displaying the image independantly (without a form).  Does that help???  I will have to think a bit harder to try and explain it any better.

Stu
0
 
LVL 3

Accepted Solution

by:
altena earned 100 total points
ID: 1354149
Ok I'll also try again:

If you want to draw a transparent picture you basically do this:
  Define a color in the bitmap that is means transparent
  Use bitblt a few times to create a bitmap in memory that
  blends the "key" bitmap with the background. (See the animation book by Nigel Thomson for details). Then bitblt
that bitmap onto the screen: voila results.

To display this "key" independantly (without form): Just grab the screen-hdc and perfornm the same trick i described above.
and do the same trick.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

617 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