Solved

Transparent non-rectangularness?

Posted on 2001-07-13
10
217 Views
Last Modified: 2010-04-06
Ok experts, this has been driving me mad. I want to create a jazzy little app has a non-rectangular shape. The shape needs to come from a bitmap. Now while using CoolForm will no doubt be everybody's immediate response, there doesn't seem to be a D6 version so I can't.

The effect I'm after is exactly the same as setting the form's brush style to bsClear (and the border to none) and then having a tyransparent TImage on top. Although this works, it all goes nasty when the form gets moved.

Any ideas?

The Neil =:)
0
Comment
Question by:TheNeil
[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
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 8

Expert Comment

by:TOndrej
ID: 6280226
You can use SetWindowRgn, example on http://www.gnomehome.demon.nl/uddf/pages/forms.htm#forms14
0
 
LVL 5

Author Comment

by:TheNeil
ID: 6280336
TOndrej,

That's fine for eliptical windows but I want my form to use the shape of the image (with the transparency) )or a rectangle with the image inside it. It also falls over when you try to move the form - the transparency doesn't get updated

The Neil =:(
0
 
LVL 6

Accepted Solution

by:
Jaymol earned 100 total points
ID: 6280340
Hi TheNiel - I'd recommend downloading the JEDI libraries.  One of the units (I think it's jclGraphics) has a function in it something like SetWindowRGNToBitmap.  (Not too sure on the function name.)

I've used that before for similar reasons and found it to be really good.  Most of the stuff in JEDI has been fully coded so it's simple to use and covers most of the possible problems with the use of such functions.

Good luck,

John.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:TOndrej
ID: 6280378
> That's fine for eliptical windows

A region may be of any shape, e.g. polygon
As Jaymol suggested, have a look at JclGraphics.CreateRegionFromBitmap
www.delphi-jedi.org

> It also falls over when you try to move the form - the transparency doesn't get updated

That's not true. When you set a window region then anything outside of that region is simply no longer a part of the window, updating is automatic by Windows, as well as handling mouse clicks.
E.g. if you have a donut-shaped window region then your window will never see a mouse click into the hole in the middle.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6280381
The function name is CreateRegionFromBitmap and it's in the unit JclGraphics.

John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6280382
heh
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6281547
Hello

  Look at article, to how to make cool forms looking
http://delphi.about.com/library/weekly/aa120898.htm


 try TSkinForm, it's free and call, but you have to register if you want the source code
http://www.friendsoft.net/english/index.htm

also look at the forms effects in torry site
http://www.torry.net/effects.htm
http://www.torry.net/nonrect.htm

Best regards
Mohammed Nasman
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6281839
TheNeil, check this out:

http://www.informatics.no/progvareOF.htm

I've been using it to create my irregularly-shaped forms for quite some time...



DragonSlayer.
0
 
LVL 5

Author Comment

by:TheNeil
ID: 6281848
Thanks everyone but Jaymol's solution works just fine so he gets the points

The Neil =:)
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6284893
Thanks.

Glad to help.

John.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…

762 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