TformShaper Component for Delphi

 

English version of this document

 

 

Romanian version of this document


ENGLISH VERSION OF DOCUMENT

 

ATENTION: THIS IS A NAGWARE COMPONENT. YOU CAN USE IN ANY APPLICATION WITHOUT PERMISION OF AUTOR. IF YOU WANT TO USE IT WITHOUT THE NAGSCREEN YOU MUST PAY A 10 USD. YOU WILL RECEIVE THE SOURCES OF THIS COMPONENT AND A FUTURE VERSION OF THIS.

 

Platform: Delphi 3.x

 

Instalation: Instalation is easy and standard. After instalation TFormShaper Component can be found in the Samples palette.

 

Property:

1. Design-time:

a. FileName (String) - a file for initialisation;

b. Process (Boolean) - process the image and result a initialisation file. See below;

c. DrawToForm (True) - paint on the form the final contour and you see what is the final image of the form;

d. ButtonMin (TBitBtn) - will be assign on the existing BitButton a procedure for minimalize the form. If the form is MainForm, then a minimalisation of form a minimalise a application.

c. ButtonClose (TBitBtn) - will be assign on the existing Bitbutton a procedure form close the form. If the form is MainForm will be close the application;

2. Run-time

a. Active (Boolean) - activate the component.

 

Imagine processing

 

The image must be a black-white image, must have a contour at a pixel dimension. The image can have many polygons but any polygon must be CLOSED.

 In Design-time will be set the Process property to true and appear the form who process the image. The right step is: Load Image -> mark any polygon with one click of mouse -> Process -> Save File.

 ATENTION: Watch the messages who appear on the StatusBar. May be you have a problems with image prelucration in a specialy a corner. Use the below image for exemple.

 

 

Completation (not necessarly):

If use a form without CaptionBar for can move the form with mouse click (like mouse click on the Caption Bar) you must be write the next few line in the body of the unit.

 

private

procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;

public

 

procedure TForm1.WMNCHitTest (var M: TWMNCHitTest);

begin

inherited; //call the inherited message handler

if M.Result = htClient then //is the click in the client area?

M.Result := htCaption; //if so, make Windows think it's on the caption bar.

end;

 

PS Sorry for my bad english.

 

This component have been tested but is possible will be have bugs. If foud someone please send me a e-mail with the description of this at the adress: danuti@usa.net

 

 


ROMANIAN VERSION OF DOCUMENT

 

ATENTIE: Este un component Nagware. Poate fi utilizat in orice aplicatie fara acordul autorului. Daca se vrea utilizarea lui fara NagScreen atunci trebuie sa platesti 10 USD. In acest pret intra si sursele componentului precum si urmatoarele versiuni.

 

Platforma: Delphi 3.x

 Instalare: Instalarea este standard. Dupa instalare se va gasi in pagina de [Samples]

 Proprietati:

1. Design-Time

a. FileName (String) - se seteaza fisierul de initializare.

b. Process (Boolean) - face un fisier de initializare. Descrierea urmeaza mai jos.

c. DrawToForm (Boolean) - deseneaza pe form conturul formului asa cum va arata el in final. ATENTIE: daca form-ul are Caption atunci formul final va fi decalat in jos cu dimensiunea Caption-ului.

d. ButtonMin (TBitBtn) - asigneaza unui BitBtn procedura de minimalizare a formului. ATENTIE: va inlocui actuala procedura OnClick a butonului respectiv (doar in Run-Time).

e. ButtonClose (TBitBtn) - va asigna unui BitBtn procedura de inchidere a formului. Daca este main-form atunci inchide aplicatia, daca este un alt form atunci il inchide (fara al distruge).

2. Run-Time

a. Active (Boolean) - seteaza componenta activa sau nu.

 

Procesarea imaginii

 

Imaginea trebuie sa fie alb-negru, sa aiba conturul negru de dimensiunea unui pixel.

Poate fi compusa din oricate poligoane conditia esentiala este ca fiecare poligon sa fie INCHIS.

 In Design-time se face Process ca True si apare formul de prelucrare a imaginii. Se va face Load Image, se da cate un Click de mouse in interiorul fiecarul poligon, apoi Process si la final se salveaza intr-un fisier rezultatul procesarii.

 ATENTIE: Urmariti mesajele care apar la StatusBar. Pot apare unele probleme la prelucrarea imaginii in special la colturi. Mai jos este un exemplu de poligon cu colturi la care nu sunt probleme de prelucrare.

 

 

Completari pe care trebuie sa le faceti singuri.

Daca folositi form-uri fara caption atunci trebuie sa includeti urmatoare procedura in partea de Private a declaratiilor pentru ca sa puteti misca formul cu ajutorul mouselui.

 

private

procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;

public

 

procedure TForm1.WMNCHitTest (var M: TWMNCHitTest);

begin

inherited; //call the inherited message handler

if M.Result = htClient then //is the click in the client area?

M.Result := htCaption; //if so, make Windows think it's on the caption bar.

end;

 

Acest component a fost testat dar este posibil ca sa mai existe bug-uri. Daca gasiti vreunul va rog trimite-ti un mail la adresa: danuti@usa.net