Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to change the shape of your forms?



How to change the shape of your forms?..

Answer / editcdc

Found this write-up online:

n general terms, the algorithm goes like this:

1.

We adjust the form to the dimensions of the BMP file.
This is simple. For the purpose, the following two lines
will do it:

// Ajustar el área / to Ajust the area
ClientWidth := Image1.Width;
ClientHeight:= Image1.Height;

2.

We read the first pixel of the form and take it as
"transparent".
3.

We search for the first "non-transparent" pixel and
from this point we generate a polygon with the silhouette of
the "non-transparent" part (see GenRegion in the file
ffigura.pas).
4.

We get rid of the title bar (if it's still bothering
us). To do it:

BorderStyle := bsNone; // Titulo estorba / no Title

5.

We change the shape of the form according to the
polygon. To do it we make use of the CreatePolygonRgn and
SetWindowRgn API functions (see ActiveSkin in ffigura.pas).
Unlike the example of the first part of this article, in
this one we don't define an elliptical (circular) region.
6.

We set from the TImage the necessary events for
dragging the form like we did in the example of the first
article.

Except for the third step, nothing seems too difficult. To
generate the polygonal region we just look for the frontier
of the figure, then we advance thru all the outline of the
figure until we reach the starting point (or run out of
memory, in this case 1024 points). This series of points
define a polygon used to generate a region with the function
CreatePolygonRgn. Then we use SetWindowRgn y we get the form
with the given shape. It works but it has limitations: our
figure must have only one frontier, therefore it can't be a
figure with a hole in the middle (in any case the algorithm
will ignore the hole in the middle).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

How to Add TrueType fonts to windows in code?

0 Answers  


what are the different types of dBASE Unique style indexes ?

0 Answers  


How to Display a 24 bit True Color bitmap image on a 256 color display?

0 Answers  


How to open or create a project using the TReport component?

0 Answers  


Is it possible to connect to InterBase from a Delphi app without using the BDE?

0 Answers  


How to get a TRichEdit to scroll in code?

0 Answers  


Explain the findnext method?

0 Answers  


When I try to execute sql query from delphi7 it throws the following exception ORA-01704: string literal too long. I know the reason why its throwing this exception. My problem is.... I have catched this exception throw Try.... Except block.....In except block i am performing rollback..... due to above error its also throwing exception in rollback transaction...........due to rollback exception...........it had created some problem in connection...........every time when i try to open or close a connection it throws an exception " Operation is not allowed when the object is open"

1 Answers  


What you can contribute to the IBM?.

0 Answers   IBM,


How to Loada local html file in the HTML control ?

0 Answers   IBM,


How to do a locate on a non-indexed field?

0 Answers  


How to Get values in a TDBGrid before they are posted?

0 Answers  


Categories