M!Image working sample transparent gif's

Post your tools and samples or ask for them.
mina
Finland
Posts: 11
Joined: 21 Apr 2018, 07:36
Location: Finland

M!Image working sample transparent gif's

Post by mina » 21 Aug 2019, 08:20

Hi @ll,
still working with TD 3.1 and need to place some transparent gif's in a form
to indicate the efficiency of solar panels.

solarpanels.png

Has someone a working sample with MImgLoadFromFile, MImgSetTranspColor and finally show the gif?

Thanks in advance,
Mina
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: M!Image working sample transparent gif's

Post by Dave Rabelink » 21 Aug 2019, 10:09

Something like this?

MImage_GIFTransp_TD31.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

mina
Finland
Posts: 11
Joined: 21 Apr 2018, 07:36
Location: Finland

Re: M!Image working sample transparent gif's

Post by mina » 22 Aug 2019, 06:50

Dear Dave,

Your sample works fine but the transparent custom control can't be placed over other pictures
and that is exactly my target.
(s. modified app)
Any other option?

BR
Mina
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: M!Image working sample transparent gif's

Post by Dave Rabelink » 22 Aug 2019, 07:41

So to have the exact requirement.

The initial image in your startpost, is that the situation you need to create?
So that you have a house image where dynamically the roof-tiles are colored?

If that is the case, I would create an image where the rooftiles have a fixed color value.
Based on the needs, you replace the fixed color with another color using

Code: Select all

bOk = MImgSubstColor( hImage, nOldColor, nNewColor )
Or when the template image has a fixed palette, change the rooftiles (which are colored with a specific palette index) using

Code: Select all

bOk = MImgSetPaletteColor( hImage, nIndex, nColor )
Then display the image with the replacement colors.

Or is there a different requirement?
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: M!Image working sample transparent gif's

Post by Dave Rabelink » 22 Aug 2019, 09:00

An example:

The house image (png) has 2 fixed colors for the solar panels.
Using the buttons you can replace the colors.

MImage_SubstColor_TD31.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

mina
Finland
Posts: 11
Joined: 21 Apr 2018, 07:36
Location: Finland

Re: M!Image working sample transparent gif's

Post by mina » 23 Aug 2019, 08:18

The second sample was a great help.

Appreciate your efforts and support!
Mina

Return to “Tools & Samples”

Who is online

Users browsing this forum: [Ccbot] and 0 guests