Solved

Transparent non-rectangularness?

Posted on 2001-07-13
10
220 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

624 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