[07 Jul 2007] Detecting a Brush's Alpha-Channel

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

[07 Jul 2007] Detecting a Brush's Alpha-Channel

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 07 Jul 2007 21:31:54 -0000

Is there a way to check if an image has an alpha channel before telling Hollywood how to load the brush---with or without the LoadAlpha option set to "TRUE"?

I would like to be able to get Hollywood to load a variable brush correctly. But as it is right now, if I make LoadAlpha "TRUE" and I happen to select an image that does not have an alpha channel, I get an error message and my program ends. And if I leave LoadAlpha in its default "FALSE" mode, then a selected image that DOES have an alpha channel is loaded without it.

Is there an easy solution to this problem that I have not thought of yet? (In case anyone is wondering, the GetAttribute option #ATTRHASALPHA does not help here.)

Thanks,
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

[08 Jul 2007] Re: Detecting a Brush's Alpha-Channel

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 08 Jul 2007 08:00:53 +0100

Hello rev

Here it is:

Code: Select all

Const #NOALPHA = 1169
ExitOnerror(False)
LoadBrush (1,"guru_bar.bsh",{LoadAlpha=True})
code=GetLastError()
If code<>0
    If code=#NOALPHA
      LoadBrush (1,"guru_bar.bsh",{LoadBrush=Flase})
    Else
      x=SystemRequest("An error occured!",GeterrorName(code),"OK")
      End
    Endif
EndIf            
ExitOnerror(True)
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[08 Jul 2007] Re: Detecting a Brush's Alpha-Channel

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 08 Jul 2007 14:21:17 +0200
Is there a way to check if an image has an alpha channel before telling Hollywood how to load the brush---with or without the LoadAlpha option set to "TRUE"?

I would like to be able to get Hollywood to load a variable brush correctly. But as it is right now, if I make LoadAlpha "TRUE" and I happen to select an image that does not have an alpha channel, I get an error message and my program ends. And if I leave LoadAlpha in its default "FALSE" mode, then a selected image that DOES have an alpha channel is loaded without it.

Is there an easy solution to this problem that I have not thought of yet? (In case anyone is wondering, the GetAttribute option #ATTRHASALPHA does not help here.)
It's not possible without loading the whole brush. The example described by Zoltan tries to load the brush and then decides upon it. This is somewhat suboptimal, but it's currently the only way to do it.

In a future version, I might implement a more efficient method.
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[08 Jul 2007] Re: Re: Detecting a Brush's Alpha-Channel

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 08 Jul 2007 14:22:53 +0200
Hello rev

Here it is:

Const #NOALPHA = 1169
By the way: You shouldn't use these error codes directly because they are different in different Hollywood versions. In 2.5 the code for "no alpha channel" is indeed 1169 but this only is the case in 2.5. In other versions, the code is different.
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

[08 Jul 2007] Re: Detecting a Brush's Alpha-Channel

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 08 Jul 2007 16:06:14 +0100

Hello Andreas

Thanks to mention it. However it is important only in uncompiled sources e.g. for the applets. By the way what is the matter with the Hollywood player?

Regards!
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[08 Jul 2007] Re: Re: Detecting a Brush's Alpha-Channel

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 08 Jul 2007 22:07:42 +0200
Hello Andreas

Thanks to mention it. However it is important only in uncompiled sources e.g. for the applets. By the way what is the matter with the Hollywood player?
Well, it's finished since a long time and when I compile Hollywood, the players are always created too. But I won't release it currently because I'm still thinking about several changes which I could no longer make if the player was available. Thus, the archive containing the Hollywood players for all platforms currently resides ready-to-be-uploaded-to-Aminet on my hard-disk, but it's not going to be released any time soon... maybe for Hollywood 3 :)

But I can give you a screenshot at least so you can see how it looks (see attachment)
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

[08 Jul 2007] Re: Re: Detecting a Brush's Alpha-Channel

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 8 Jul 2007 14:14:41 -0700 (PDT)

What a great trick!

Thank you very much.
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

[09 Jul 2007] Re: Detecting a Brush's Alpha-Channel

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 09 Jul 2007 00:10:17 +0100

Hello Rev.
What a great trick!

Thank you very much.
You are welcome!

Next question ... ? :)
PEB
Posts: 576
Joined: Sun Feb 21, 2010 1:28 am

[14 Jul 2007] Re: Re: Detecting a Brush's Alpha-Channel

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 14 Jul 2007 12:38:31 -0700 (PDT)

Yep, you helped get me past a really tough spot in bringing ExtraInfo to life. Thanks again!

I actually released version 1.0 prematurely last night, and I already needed to upload a slightly improved 1.1 today. I'm glad you like it.
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

[14 Jul 2007] Re: Detecting a Brush's Alpha-Channel

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 14 Jul 2007 21:11:57 +0100

Hello Paul!

At last we are already know what was your problem :) ExtraInfo is a good job and very nice idea!

The exif info feature is very comprehensive. I am looking for adding ExtraInfo to a DirOpus button.

Keep up the good work! Oh, and I definitively want to be "bloated" with your stuffs. :)

Bye!
Locked