Solved

Polygonal Image in Delphi 1

Posted on 1998-12-23
3
301 Views
Last Modified: 2010-04-04
Can I have in Delphi 1 TImage Component with polygonal frame. Part between polygonal frame and component's rectangle must be transparent
0
Comment
Question by:extra
3 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1352695
How about just drawing the image, leaving what's behind uncovered? What do you mean exactly?
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 20 total points
ID: 1352696
You coudl do it like this:

1. Intercept the WM_ERASEBKGRND (sp?) message and stop it.
2. Override the paint method and set the clipregion to be the appropriate polygonal region (see CreatePolygonRgn for how to do this))
3. Permit the paint to do its thing
4. Unset the clipping region (this may not be strictly necessary...)

Cheers,

Raymond.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352697
You could have a masked bitmap that will leave only that on the form...
The part you want to be left on the form should be white and everything to be hidded outside the  polygon should be black....than you AND the original image to the screen, and XOR the mask over the original and you'll get your polygon... If you want me to write you an example let me know..it's pretty easy ;-)

Merry Chrismtas to all!

-Viktor
--Ivanov
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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