Transparency problems with updated project

Workarounds and usability notes.

Transparency problems with updated project

Postby John Robin Dove » Fri Jun 28, 2019 8:17 am

Hi,
Several years ago I made a program with TB + Powerpac for someone so it was made with a much earlier version of Powerpac. This person would now like to change a thing or two. When I exported the revised version certain parts of certain objects which are supposed to be transparent are no longer transparent. So I made a test tbk to show you but when I put the same objects in a new tbk there is no problem!? The objects are Toolbook paintObjects using white as the fillColor to be used as chromaKey. I have tried resaving the tbk with a different name but the problem is still there.

Here is the original version.
Image
and this is the new version.
Image

Any ideas please?

John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Transparency problems with updated project

Postby Clifton » Fri Jun 28, 2019 10:06 am

I would try exporting the image to a hard drive location. Then re-import the image and reset the chromaKey. Also make sure the ChromaKey is truly correct. If you are setting the chromaKey to white and the color needed is slightly off-white (255, 255, 253), then the white chromaKey won't actually work. This may be why your test book worked and the production one does not. If you upgraded your production book, then maybe the original bitmap and chromaKey did not transfer correctly.

It is probably better to use a png and set it in place using pgTBObjSet() with the property htmlText. PNG objects are much more responsive to transparency than chromaKey imaging. I use Paint.net to create PNG transparencies as it is really easy and fast.
Actions code:
pgStyleObject( "myObject", "height, width", "auto, auto" );
pgTBObjSet( "myObject", "htmlText", "<img src='../media/myimage.png' />" ); discard return value;


 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Transparency problems with updated project

Postby John Robin Dove » Sat Jun 29, 2019 4:04 am

Thanks Clifton,

I tried using new objects. This did not work. I tried using png files and strangely this did not work either! There can be no doubt that the png files are using transparency correctly as I have tested them on this site as shown below.

Image

I'll try repairing the book.

UPDATE:
Nope. Nothing has changed. It remains a complete mystery. It's not the end of the world as it's not a brilliant program anyway, in my opinion but I'd like to know why...
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Transparency problems with updated project

Postby Clifton » Sat Jun 29, 2019 5:47 am

Maybe there is an action somewhere which is changing the rgbFill of the object?
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Transparency problems with updated project

Postby John Robin Dove » Sun Jun 30, 2019 8:43 am

Hi Clifton,

The bug would appear to be random. I have now made a new tbk that contains the bug with both bitmaps and PNG files. I suspect maybe my dud version of TB 9.01 is not exporting correctly although in the case of PNGs the ones in the exported media folder seem to be OK. I have spent hours and hours on this and wasted my time so far. If you have 10 minutes to waste perhaps you could try re-exporting the tbk with your TB 9.01. You'll need to add the two PNG files to the export tree again. I also enclose the exported folder. https://www.mediacours.com/tb_examples/prova.zip
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Transparency problems with updated project

Postby Clifton » Sun Jun 30, 2019 3:11 pm

With regard to the PNG graphics ... it seems you have uncovered a little bug in the PowerPac referencing engine. Objects like p1 and b0 are names and ids which are often associated with ToolBook's internal naming conventions and are used in its internal dereferencing engine. However, the PowerPac has a much more sophisticated object referencing engine and it decides which engine to use based on the name of the object. The logic that splits to the ToolBook internal dereferencing engine was flawed if a user used an object name like "sp1". In this case, which fits your scenario, the PowerPac assumed that this was a page reference and sent it to ToolBook's internal dereferencing engine, where an object with this name would not be found and cause the function to fail gracefully. What should have happened is that the PowerPac should have known this was NOT an internal name reserved by ToolBook and defaulted to using the PowerPac dereferencing engine to locate the object(s).

I've fixed this problem and updated the PowerPac object referencing engine to be more intelligent in its decision-making as which engine to use to find objects.

Until this is posted, please change the name of your objects so they do not end in b# or p# and you should be fine.
Names like sp_1 and sp_2 will work fine.

Note that I did not have any trouble with your chromaKey versions of the bmp graphics.
Attachments
prova.zip
My version of the sample submitted.
NOTE: Background url graphics are fine, but I chose a different method.
(466.25 KiB) Downloaded 136 times
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Transparency problems with updated project

Postby John Robin Dove » Mon Jul 01, 2019 6:25 am

Thanks Clifton,

So, two unrelated problems producing the same result! I thought they had to be part of some overall transparency bug but of course they are not. I still don't know why the paintObjects sometimes function as planned and sometimes not. It may even be computer related? Anyway the solution is to use PNG files instead. Another mistake I made was not using transparent fields. I thought the graphics replaced the fields but they are in the fields so these must be transparent. Thanks for your help.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Transparency problems with updated project

Postby Clifton » Mon Jul 01, 2019 6:38 am

With regard to the chromaKey paintObjects, you might try using a button and putting the graphics on the button. That way the paintObject will be stored a bit differently as a resource of the book instead of merely as part of a single object. I have a feeling the chromaKey value will be much more reliable that way.
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Transparency problems with updated project

Postby John Robin Dove » Mon Jul 01, 2019 10:52 am

OK, Thanks
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron