Solved

Transparent non-rectangularness?

Posted on 2001-07-13
10
214 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi procedure  - Unsatisfied forward or external declaration. 2 140
Magic Software info 18 125
Working with hours 3 46
Multi-layered image in FireMonkey 9 15
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now