Recent

Author Topic: Component for tiled or resizable graphic background?  (Read 12794 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Component for tiled or resizable graphic background?
« on: June 02, 2010, 02:14:49 am »

Is there some component that can give a panel or some other panel like component. sub as a page control tab,  a background bitmap that will resize, or tile itself when the panel is resized?

Lazarus 3.0/FPC 3.2.2

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: Component for tiled or resizable graphic background?
« Reply #1 on: June 02, 2010, 05:52:18 am »
Does a TImage work, where Align is set to alClient and Stretch to true?
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Component for tiled or resizable graphic background?
« Reply #2 on: June 02, 2010, 08:27:50 am »
Does a TImage work, where Align is set to alClient and Stretch to true?

I think that will be better handled by the OnResize event if it is enabled for TImage. The important thing for me is that it remains permanently the lowest object in the Z-order, and that it can contain other objects. Is that possible?
Lazarus 3.0/FPC 3.2.2

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: Component for tiled or resizable graphic background?
« Reply #3 on: June 02, 2010, 05:31:57 pm »
I did what I think your doing back in the D5 days.  I found the differant objects and shapes on top of the image did not scale by the same % when I used the form resize.  I finaly just used the menu so the user could select one of 5 or so preset sizes.  I did not, however, have the "anchors" properties to help Keep the proper alinement of each control on the image so it may now be doable.

PS: if you have not tought of it yet, a loop working with the controlcount and controls[] fields can save you a lot of coding time.  If you need an example, I'll see if I can find any of those older projects
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

davesimplewear

  • Sr. Member
  • ****
  • Posts: 319
    • Davids Freeware
Re: Component for tiled or resizable graphic background?
« Reply #4 on: June 03, 2010, 06:17:44 am »
I have ported the TJanTiledPanel for tiled images to lazarus available on http://www.users.on.net/~dave.stewart/

Regards
Dave
All things considered insanity seems the best option

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Component for tiled or resizable graphic background?
« Reply #5 on: June 03, 2010, 06:31:00 am »
Thanks,

I will look them all up.
Lazarus 3.0/FPC 3.2.2

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Component for tiled or resizable graphic background?
« Reply #6 on: June 26, 2010, 07:01:37 am »
I have gotten to the stage where I can implement the tiling,
If I simply repeat the image will that consume too many resources or cause Windows to run out memory or something?
Lazarus 3.0/FPC 3.2.2

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Component for tiled or resizable graphic background?
« Reply #7 on: June 27, 2010, 01:15:44 pm »
I tried this and it is working well, thanks.

Are the limitations on the image format it accepts due to the TBitmap implentation? When I try to load jpeg or png images they are not accepted, only bmp images.

I have ported the TJanTiledPanel for tiled images to lazarus available on http://www.users.on.net/~dave.stewart/

Regards
Dave
Lazarus 3.0/FPC 3.2.2

davesimplewear

  • Sr. Member
  • ****
  • Posts: 319
    • Davids Freeware
Re: Component for tiled or resizable graphic background?
« Reply #8 on: July 16, 2010, 09:53:11 am »
I run Linux and load png and jpg regularly, could be a restriction in windows?

Regards
Dave
All things considered insanity seems the best option

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2584
Re: Component for tiled or resizable graphic background?
« Reply #9 on: July 16, 2010, 06:15:51 pm »
Are the limitations on the image format it accepts due to the TBitmap implentation? When I try to load jpeg or png images they are not accepted, only bmp images.

TBitmap, as the name says, only accept bitmaps (.bmp). (only versions of lazarus prior to 0.9.24 accepted other formats)
To load jpeg or png, use a TJpegImage or TPortableNetworkGraphic respectively
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: Component for tiled or resizable graphic background?
« Reply #10 on: July 16, 2010, 07:25:44 pm »
You should use TPicture instead of TBitmap. It allows you to load different image formats.

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: Component for tiled or resizable graphic background?
« Reply #11 on: July 16, 2010, 08:01:01 pm »
You should use TPicture instead of TBitmap. It allows you to load different image formats.
Tpicture, Tbitmap, Timage, Tbitmap,... :-\
Is there some link that compares or describes these tools?
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927

 

TinyPortal © 2005-2018