 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Erbas-White Guest
|
Posted: Fri Dec 16, 2005 1:33 am Post subject: Odd-shaped form |
|
|
I'm using BCB5, but can upgrade if need be (depending on the answer to
my question).
I have not ever done anything with any 'odd-shaped' forms, such as an
ellipse or a graphic. How is this done, and are there any special VCL
components for doing this?
I have a request from a client to 'jazz up' the main form of his
program, with a graphics designer providing the actual drawing.
Any comments appreciated.
David Erbas-White
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Dec 16, 2005 3:11 am Post subject: Re: Odd-shaped form |
|
|
"David Erbas-White" <derbas (AT) arachneering (DOT) com> wrote
| Quote: | I have not ever done anything with any 'odd-shaped' forms,
such as an ellipse or a graphic. How is this done
|
Use a region. Look in the Win32 API at the various Create...Rgn()
functions, the ExtCreateRegion() function, and the SetWindowRgn() function.
Alternatively, only on Win2K and later OSs, you can use layered attributes
to specify a transparent color for the form (if you upgrade to BCB6, TForm
has new TransparentColor and TransparentColorValue properties for that).
Look at the SetWindowLayeredAttributes() function, and the WS_EX_LAYERED
window style, in the Win32 API.
| Quote: | I have a request from a client to 'jazz up' the main form of his
program, with a graphics designer providing the actual drawing.
|
If the graphics are stored as bitmaps, then you can create regions from
them:
Converting a bitmap to a region
http://www.codeguru.com/Cpp/G-M/bitmap/usingregions/article.php/c1751
Gambit
|
|
| Back to top |
|
 |
Boian Mitov Guest
|
Posted: Fri Dec 16, 2005 3:18 am Post subject: Re: Odd-shaped form |
|
|
Hi David,
I have a free open source component that does that. Go to
www.mitov.com and then to the Free Downloads. It is written in BCB and
you can look at the source. If you don't like it, you can use the source
as reference to how to implement region.
Cheers,
Boian
David Erbas-White wrote:
| Quote: | I'm using BCB5, but can upgrade if need be (depending on the answer to
my question).
I have not ever done anything with any 'odd-shaped' forms, such as an
ellipse or a graphic. How is this done, and are there any special VCL
components for doing this?
I have a request from a client to 'jazz up' the main form of his
program, with a graphics designer providing the actual drawing.
Any comments appreciated.
David Erbas-White
|
|
|
| Back to top |
|
 |
David Erbas-White Guest
|
Posted: Fri Dec 16, 2005 4:49 am Post subject: Re: Odd-shaped form |
|
|
Thanks to both of you, I'll look at both references!
David Erbas-White
|
|
| Back to top |
|
 |
David Erbas-White Guest
|
Posted: Fri Dec 16, 2005 6:26 am Post subject: Re: Odd-shaped form |
|
|
Boian,
The demounit.h file in your zip file for the component is corrupted --
it looks as though it's been replaced by a copy of the DFM file. If you
have an opportunity to find the original at some point, I'd appreciate it.
David Erbas-White
|
|
| Back to top |
|
 |
Jim Dodd Guest
|
Posted: Fri Dec 16, 2005 6:10 pm Post subject: Re: Odd-shaped form |
|
|
David Erbas-White wrote:
| Quote: | Boian,
The demounit.h file in your zip file for the component is corrupted --
it looks as though it's been replaced by a copy of the DFM file. If you
have an opportunity to find the original at some point, I'd appreciate it.
David Erbas-White
|
If Boian doesn't get back to you soon, I have an old version of his
component and can send you a copy of demounit.h dated Apr. 14, 1999
if you'd like it.
Regards,
Jim Dodd
Onset Computer Corp.
|
|
| Back to top |
|
 |
David Erbas-White Guest
|
Posted: Fri Dec 16, 2005 7:09 pm Post subject: Re: Odd-shaped form |
|
|
Jim,
That would be great, as I'm leaving on a trip tomorrow and would like to
be able to take it with me. My email address above is valid.
David Erbas-White
Jim Dodd wrote:
| Quote: | David Erbas-White wrote:
Boian,
The demounit.h file in your zip file for the component is corrupted --
it looks as though it's been replaced by a copy of the DFM file. If
you have an opportunity to find the original at some point, I'd
appreciate it.
David Erbas-White
If Boian doesn't get back to you soon, I have an old version of his
component and can send you a copy of demounit.h dated Apr. 14, 1999
if you'd like it.
Regards,
Jim Dodd
Onset Computer Corp.
|
|
|
| Back to top |
|
 |
Jim Dodd Guest
|
Posted: Fri Dec 16, 2005 10:08 pm Post subject: Re: Odd-shaped form |
|
|
Boian Mitov wrote:
| Quote: | Hi David,
I have a free open source component that does that. Go to
www.mitov.com and then to the Free Downloads. It is written in BCB and
you can look at the source. If you don't like it, you can use the source
as reference to how to implement region.
Cheers,
Boian
|
Boian,
David later mentions how one of the files in the demo project is
corrupted in the package on your Website. I also found that the
file you uploaded to Torry's site is also corrupted in the same
way. It's the DemoUnit.h file.
Regards,
Jim Dodd
Onset Computer Corp.
|
|
| Back to top |
|
 |
Boian Mitov Guest
|
Posted: Fri Dec 16, 2005 11:15 pm Post subject: Re: Odd-shaped form |
|
|
Hi Jim,
Thank you folks! I will fix it. It is the demo header file, and you can
use the component without it, but I will get it fixed.
Cheers,
Boian
Jim Dodd wrote:
| Quote: | Boian Mitov wrote:
Hi David,
I have a free open source component that does that. Go to
www.mitov.com and then to the Free Downloads. It is written in BCB and
you can look at the source. If you don't like it, you can use the
source as reference to how to implement region.
Cheers,
Boian
Boian,
David later mentions how one of the files in the demo project is
corrupted in the package on your Website. I also found that the
file you uploaded to Torry's site is also corrupted in the same
way. It's the DemoUnit.h file.
Regards,
Jim Dodd
Onset Computer Corp.
|
|
|
| Back to top |
|
 |
Boian Mitov Guest
|
Posted: Fri Dec 16, 2005 11:45 pm Post subject: Re: Odd-shaped form |
|
|
Hi David,
I had to recreate the file from scratch . Here it is:
//---------------------------------------------------------------------------
#ifndef DemoUnitH
#define DemoUnitH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "BMShapedForm.h"
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TBMShapedForm *BMShapedForm1;
TBitBtn *BitBtn1;
TBitBtn *BitBtn2;
void __fastcall BitBtn1Click(TObject *Sender);
void __fastcall BitBtn2Click(TObject *Sender);
private: // User declarations
bool Stretched;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Cheers,
Boian
David Erbas-White wrote:
| Quote: | Boian,
The demounit.h file in your zip file for the component is corrupted --
it looks as though it's been replaced by a copy of the DFM file. If you
have an opportunity to find the original at some point, I'd appreciate it.
David Erbas-White
|
|
|
| Back to top |
|
 |
David Erbas-White Guest
|
Posted: Sat Dec 17, 2005 12:11 am Post subject: Re: Odd-shaped form |
|
|
Thanks to both you and Jim for your prompt response!
David Erbas-White
Boian Mitov wrote:
| Quote: | Hi David,
I had to recreate the file from scratch . Here it is:
//---------------------------------------------------------------------------
#ifndef DemoUnitH
#define DemoUnitH
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include "BMShapedForm.h"
#include
#include
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TBMShapedForm *BMShapedForm1;
TBitBtn *BitBtn1;
TBitBtn *BitBtn2;
void __fastcall BitBtn1Click(TObject *Sender);
void __fastcall BitBtn2Click(TObject *Sender);
private: // User declarations
bool Stretched;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Cheers,
Boian
David Erbas-White wrote:
Boian,
The demounit.h file in your zip file for the component is corrupted --
it looks as though it's been replaced by a copy of the DFM file. If
you have an opportunity to find the original at some point, I'd
appreciate it.
David Erbas-White
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|