Board index » cppbuilder » Tiled Background für ne Form:

Tiled Background für ne Form:

Okay, in one of my forms I'm using the following code to tile an image
onto
the background:

void __fastcall TMainIconForm::FormPaint(TObject * Sender)
{
   Canvas->Brush->Bitmap = Background->Picture->Bitmap;
   Canvas->FillRect(ClientRect);

Quote
}

The variable Background in the code is a TImage that stores the picture.
 

Re:Tiled Background für ne Form:


Hi Christian,

Quote
> void __fastcall TMainIconForm::FormPaint(TObject * Sender)
> {
>    Canvas->Brush->Bitmap = Background->Picture->Bitmap;
>    Canvas->FillRect(ClientRect);
> }

I think you forgot to mention your problem.  If your resulting image is
too small, note that on Win9x/Me-based systems, the TBrush::Bitmap
property is limited to the top-left 8x8 portion of the bitmap.

Good luck,
--
Damon Chandler (TeamB)
- BCBCAQ <http://bcbcaq.freeservers.com>
- Graphics API Black Book <http://graphicsBB.itgo.com>

Re:Tiled Background für ne Form:


Quote
"Damon Chandler (TeamB)" wrote:
> I think you forgot to mention your problem.  If your resulting image is
> too small, note that on Win9x/Me-based systems, the TBrush::Bitmap
> property is limited to the top-left 8x8 portion of the bitmap.

Sorry, I didnt have a Problem with this code, but with my Mail Client
;(
This Message had to go to a friend of mine, not back in the Newsgroup it
was from.
(Application Error: please change the user :)
But anyhow, thanks for that 8x8 Tip above, i didn know this.

        Christian

Re:Tiled Background für ne Form:


Hello Damon, Christian,

"Damon Chandler (TeamB)" <dm...@cornell.edu> schreef in bericht
news:3ABEDFA0.6B243D34@cornell.edu...

Quote
> Hi Christian,
> > void __fastcall TMainIconForm::FormPaint(TObject * Sender)
> > {
> >    Canvas->Brush->Bitmap = Background->Picture->Bitmap;
> >    Canvas->FillRect(ClientRect);
> > }

> I think you forgot to mention your problem.  If your resulting image is
> too small, note that on Win9x/Me-based systems, the TBrush::Bitmap
> property is limited to the top-left 8x8 portion of the bitmap.

Hmm, I had to test this (with 64x64 pix) to be shure<g>, but on Win 98SE at
least you can use any size for a brush bitmap you want. (don't know about
Me).
One caveat with the above code however, after use you need to set
Canvas->Brush->Bitmap = NULL;

Quote
> Damon Chandler (TeamB)

--
Greetings from overcast Amsterdam

         Jan

email: bijs...@worldonline.nl
http://home.worldonline.nl/~bijster

Other Threads