Recent

Author Topic: [SOLVED] Different pictures with different values  (Read 8231 times)

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
[SOLVED] Different pictures with different values
« on: April 12, 2016, 03:36:24 pm »
This is what i want to do:
If a choose to be a color to be orange i want all the pictures i use to be of the orange kind
If a choose to be a color to be red i want all the pictures i use to be of the red kind
If a choose to be a color to be green i want all the pictures i use to be of the green kind

But i don't know how to do this.
I thing i need a TImageList for it.
Can any give me a example of how to do this?
« Last Edit: April 16, 2016, 05:10:55 am by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1269
Re: Different pictures with different values
« Reply #1 on: April 12, 2016, 04:02:23 pm »
Are you presenting your user ONLY three choices?  (Orange, Red, Green)?

Where will the Pictures be used (Toolbar?  TPicture?)

Where are the pictures stored? (Resources, different Files, one file as per TImageList.SaveToFile, database)
« Last Edit: April 12, 2016, 04:05:36 pm by Mike.Cornflake »
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #2 on: April 12, 2016, 06:14:01 pm »
Are you presenting your user ONLY three choices?  (Orange, Red, Green)?
Yes that is what i am thinking of. But maybe 2 more.
Where will the Pictures be used (Toolbar?  TPicture?)
TPicture.
Where are the pictures stored? (Resources, different Files, one file as per TImageList.SaveToFile, database)

Haven't thought about that on. But what is your advise in this?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1269
Re: Different pictures with different values
« Reply #3 on: April 12, 2016, 06:47:23 pm »
This is all too vague for me to respond to.  The number of ways this can be implemented is large,and I have no desire to enumerate all options.
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #4 on: April 12, 2016, 09:08:55 pm »
lets say i store my images in the resources is that helpful.
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #5 on: April 13, 2016, 10:18:00 am »
I just need somewhere to start...
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1269
Re: Different pictures with different values
« Reply #6 on: April 13, 2016, 10:29:54 am »
Ok.   Heres an idea.   Lets say you have 3 base pictures.   "picture1.jpg" "picture2.jpg" and "picture3.jpg"

Create your different colourised versions of those (I don't even know what this means).   When you save them, add the colour to the start of the filename.  "redpicture1.jpg" and so on.

Add your colour options to a radio group.   In the radiogroup. Onchange at a string with the name of the colour.

Then finally  Picture1. Loadfromfile( ColourStringSetByRadioGroup + 'picture1.jpg');
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #7 on: April 13, 2016, 10:51:05 am »
Thanks.


This works for just a few pictures but what if you have say like 20 different pictures?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1269
Re: Different pictures with different values
« Reply #8 on: April 13, 2016, 10:54:31 am »
That would have been useful to know earlier on. Please fully specify what you're looking for. As I say, possibilities are endless with what you've provided so far.
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Different pictures with different values
« Reply #9 on: April 13, 2016, 10:59:47 am »
What do you mean by "pictures"? I have the feeling that you have monochrome icons and want to colorize them (i.e. replace the black color by some user-defined color). Please confirm.

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #10 on: April 13, 2016, 11:51:50 am »
Nope  i am not using icons but real PNG-files.
These have transparent backgrounds but the color is different
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

balazsszekely

  • Guest
Re: Different pictures with different values
« Reply #11 on: April 13, 2016, 12:08:21 pm »
The big question is how those images are displayed? As part of a Toolbar, Button or something else? Do you want to load them directly from memory or it's ok to save them to HDD first. How big those images are? Without the details is hard to give a useful advice.

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Different pictures with different values
« Reply #12 on: April 13, 2016, 12:11:51 pm »
I still don't understand what you want to do. Maybe my word "icons" was misleading... OMG! Please post one of these images before and after the modification that you want to apply. Use some image processing program to get the final image.

balazsszekely

  • Guest
Re: Different pictures with different values
« Reply #13 on: April 13, 2016, 12:18:02 pm »
@wp
If I understood correctly, the OP has all the images ready(each image in 3 different color/nuance). He does not want to modify the image itself in the program, just a method to store/load/ them at runtime according to the clients need.

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Different pictures with different values
« Reply #14 on: April 13, 2016, 12:46:03 pm »
@GetMen: Thanks. Thats what i want.  :D
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

 

TinyPortal © 2005-2018