Recent

Author Topic: [SOLVED] Toolbar image  (Read 1116 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 622
[SOLVED] Toolbar image
« on: January 21, 2023, 10:18:57 am »
Hello forum members I am wondering how you can load one image with several icons to several speedbuttons with such a solution uses for example Irfan view ?
« Last Edit: January 21, 2023, 07:16:43 pm by Pe3s »

Thaddy

  • Hero Member
  • *****
  • Posts: 18475
  • Here stood a man who saw the Elbe and jumped it.
Re: Toolbar image
« Reply #1 on: January 21, 2023, 10:46:43 am »
It is called TImageList....
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

wp

  • Hero Member
  • *****
  • Posts: 13264
Re: Toolbar image
« Reply #2 on: January 21, 2023, 12:12:45 pm »
I don't fully understand what you mean...

Guessing:
- Add a TImageList on the form, set its Width and Height properties to something greater than 32 (which is the height of the image bar shown in your post)
- Doubleclick on the ImageList, click "Add sliced" and select the image strip downloaded from your post. This function takes the ImageList.Width and .Height as base dimension, calculates how many images are contained in the strip and then splits the large image into several smaller images of size Width x Height.
- Now you can place SpeedButtons, BitBtn, a Toolbar, a menu etc on the form, assign their Images property to the ImageList and their ImageIndex to the index of the requested icon.

jamie

  • Hero Member
  • *****
  • Posts: 7377
Re: Toolbar image
« Reply #3 on: January 21, 2023, 03:13:58 pm »
Or a desire to see all of the items in the imagelist as a single image?
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 13264
Re: Toolbar image
« Reply #4 on: January 21, 2023, 04:34:29 pm »
Or a desire to see all of the items in the imagelist as a single image?
In this case, I'd double-click on the ImageList (populated with all images needed in the application) and then click on "Save all..." - this would create a stripe of all the images, base resolution only (if you have several resolutions for high-dpi), and vertically aligned, though.

jamie

  • Hero Member
  • *****
  • Posts: 7377
Re: Toolbar image
« Reply #5 on: January 21, 2023, 06:00:20 pm »
Isn't the "GetFullBitMap(....)" to return the complete image?
The only true wisdom is knowing you know nothing

Pe3s

  • Hero Member
  • *****
  • Posts: 622
Re: Toolbar image
« Reply #6 on: January 21, 2023, 07:16:26 pm »
Thank you for your answers and sorry for the post , I understood where I made a mistake.
Greetings

 

TinyPortal © 2005-2018