controlling OPACITY of an IMAGE

819 views
Skip to first unread message

Piotr Stępień

unread,
Feb 7, 2014, 1:30:35 AM2/7/14
to mitappinv...@googlegroups.com
AI2 chrome windows 7 

I want to mak a slider that will change opacity of an image is there any way to do it ?




Enis

unread,
Feb 7, 2014, 3:13:39 AM2/7/14
to
I don't believe so... An image doesn't have a background color, and while a canvas can be made opaque via background color, the background image doesn't seem to be affected by the change in the Alpha (4th color data item) of the background color.

Someone may have another suggestion but I don't believe it's possible to do.


Piotr Stępień

unread,
Feb 7, 2014, 5:27:01 AM2/7/14
to mitappinv...@googlegroups.com
for now I just added 10 difrent opacity png pictures and im cheging them acording to slider posytion thac the best i could think off

Enis

unread,
Feb 7, 2014, 5:46:59 AM2/7/14
to mitappinv...@googlegroups.com
Until someone has a better idea, that's a great solution...  Just make sure the graphics aren't too big or they'll inflate your APK too much to process... There's a 5MB limit on AppInventor apks...

Taifun

unread,
Feb 7, 2014, 7:34:40 AM2/7/14
to mitappinv...@googlegroups.com

Piotr Stępień

unread,
Feb 7, 2014, 7:44:45 AM2/7/14
to mitappinv...@googlegroups.com
unfortunatli this wont work for me i nead to put a picture of a fully bright lamp on top of the a dark lamp picture so if i move slider it will show me how brite the lamp glows. The ball option wuld be perfect if i could set a bacground image for a ball 

James Hancock

unread,
Feb 7, 2014, 10:41:19 AM2/7/14
to mitappinv...@googlegroups.com
OK, this is pretty rough (because it's late:) ) but... by setting a canvas.background colour/transparency with the slider,  which is behind 
an imagesprite that holds an image of a bulb, the inside of the bulb is mainly opaque/transparent.

File attached: 



trans_bulb.aia

Enis

unread,
Feb 7, 2014, 11:02:21 AM2/7/14
to mitappinv...@googlegroups.com
Nice solution James...

The problem is that all it's really doing is changing what's transparent.  The base of the bulb never dims.  What your aia is really doing is making the backlight go away... it's still showing the base full strength in all settings.  It DOES look like the bulb is going on and off, but not disappearing completely.

Really not sure if this can be done now in AI... His solution of varying photos in various states of opaque may still be the best.

I tried this method before I originally posted, but I had a different type of picture in there, and it never got rid of the actual image... it DID modify some highlights from the backlighting...

Piotr Stępień

unread,
Feb 7, 2014, 12:44:07 PM2/7/14
to mitappinv...@googlegroups.com
Thx for the time you put to this James. but unfortunrtli dos not help me, ill defenetly use your idea in the future thou. I will send you the pictures of the lamp i shuld do that in the bigining (stupid). 
but dond mind I'v alrdy did it with the lots of pictures option it works grate for my app.
lampaoff.png
lampaon.png

kriazent...@gmail.com

unread,
Apr 17, 2014, 7:06:42 AM4/17/14
to mitappinv...@googlegroups.com
How do you change pictures with the slider? in my app i have 10 different images in each in different screens and i want it to change with the slider. can you guide me please
Reply all
Reply to author
Forward
Message has been deleted
0 new messages