Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
100 user(s) are online (54 user(s) are browsing Forums)

Members: 0
Guests: 100

more...

Headlines

 
  Register To Post  

How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
Hi all,
I'm building a docky for network activity.
It works well but I'm now trying to use a transparent background... and I don't succeed.

My goal is to change the black background by a transparent one on this Docky :
http://www.os4depot.net/filedata/snapshot/7680_1_snap.jpg

1) I tried CyberGraphics FillPixelArray() who seems to manage alpha layer (first byte of ARGB) by

RectFill(dd->rp,0,0,dd->ds.width-1,dd->ds.height-1);
FillPixelArray(dd->rp,0,0,dd->ds.width-1,dd->ds.height-1,0xFF000000);
SetRPAttrs(dd->rp,RPTAG_APenColor,0xFF00FF00, RPTAG_DrMd,JAM1,NULL);

The color changes is OK, but I see no difference if I change 0XFF by something else.

2) I try, too, Graphics ObtainBestPenA()
pen = ObtainBestPenA(cm, 0x00000000, 0x00000000, 0x00000000, NULL );

but it is the same, the color changes but not the transparency.

Is it possible to do this ?
Thanks by advance for your help.
zzd10h

Go to top
Re: How to use Alpha layer for Docky ?
Home away from home
Home away from home


See User information

I haven;t done this in a docky so it a bit of a guess but try something like:

/* set atransperent colour */

SetRPAttrs(dd->rp,RPTAG_APenColor,0x00000000, RPTAG_DrMd,JAM1,NULL);

/* Clear the background */

RectFill(dd->rp,0,0,dd->ds.width-1,dd->ds.height-1);

/* Set it opache again */

SetRPAttrs(dd->rp,RPTAG_APenColor,0xFF00FF00, RPTAG_DrMd,JAM1,NULL);

/* Do text rendering */

Note you *must* set the alpha part colour back to 0xFF as it may seem to work without doing that for the moment, but *will* break later if alpha blending od text is implemented / released.


Using pens will not work at all as pens don't do alpha values.


Go to top
Re: How to use Alpha layer for Docky ?
Just popping in
Just popping in


See User information
Hi,

On non-composited screens, AmiDock uses a "fake" transparency effect (i.e. the bitmap is filled with the contents of the window behind the dock), meaning that you can only add things over the background but you cannot render half or totally transparent contents without doing the blending at the same time (or you'll lose background information).

So if you want to support this configuration you need to follow this rule or provide an alternate rendering if you want to do fancy stuff when compositing is enabled.

Now, what you are trying to do should work on composited screens, but you have to tell AmiDock that you are using composited mode (see DOCKYGET_SupportsComposite and DOCKYGET_CompositeMode) so that it does not try to de-multiply the docky bitmap. Also I'm not sure you can use legacy pens to fill alpha channel, you're better off with direct ARGB painting (see SetRPAttrs() with RPTAG_APenColor).

Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
Hi,
thanks for your replies, BroadBlues and CentaurZ.

I succeed to do what I wanted, to make a transparent background :)

http://zzd10h.amiga-ng.org/NetDock/NetDock_Transparent.jpg

Following the advices of CentaurZ to use DOCKYRENDERMODE_RPPA.
(on the french Amiga-NG forum)

I removed all the SetBPen, the RectFill, the FillPixelsArray... and it works.

Thanks again !
Your help is very nice.

Go to top
Re: How to use Alpha layer for Docky ?
Home away from home
Home away from home


See User information
@zzd10h

I like the look of your network activity docky. I've been using the DiskLED docky to indicate network activity on my Sam460, but your docky provides more info.

When will it be released?

EDIT: I just noticed the news release on the front page, so it's already available.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: How to use Alpha layer for Docky ?
Home away from home
Home away from home


See User information
zzd10h

Quote:
I succeed to do what I wanted, to make a transparent background :)


Looks good

Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
Thank you Samo79 & Hans, it's nice !

As you have noticed, the transparent version is not on OS4depot yet. I have others things to implement before to release it.

Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
Nice!

Go to top
Re: How to use Alpha layer for Docky ?
Home away from home
Home away from home


See User information
Looking nice

X5000
Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
For info,
I put a new version of NetDock (50.1) on OS4Depot with

-support of Transparent background by default (thank you CentaurZ)

-add of multiples tooltypes to specify a color for each elements (see ReadMe.txt and NetDock_Tooltypes_Examples.jpg included)

-add of an alternate icon from TommySammy (thank you)

http://zzd10h.amiga-ng.org/NetDock/NetDock_Default.jpg

http://zzd10h.amiga-ng.org/NetDock/NetDock_Colors.jpg

http://www.os4depot.net/?function=sho ... utility/docky/netdock.lha

Edit : Is somebody knows if it's possible to add a Docky to AmiUpdate ?
Because, unlike a normal application, APPDIR:NetDock doesn't work.
Thank you


Edited by zzd10h on 2013/2/6 15:32:01
Go to top
Re: How to use Alpha layer for Docky ?
Just popping in
Just popping in


See User information
@zzd10h
Quote:

Edit : Is somebody knows if it's possible to add a Docky to AmiUpdate ?
Because, unlike a normal application, APPDIR:NetDock doesn't work.
Thank you


Yes, define the following function (AFAIR this is the example provided on AmiUpdate website) :

Quote:

/**********************************************************
**
** The following function saves the variable name passed in
** 'varname' to the ENV(ARC) system so that the application
** can become AmiUpdate aware.
**
**********************************************************/
static void SetAmiUpdateENVVariable(CONST_STRPTR varname, CONST_STRPTR progpath )
{
/* AmiUpdate support code */
APTR oldwin = NULL;
TEXT varpath[1024] = "AppPaths";

/* stop any "Insert volume..." type requesters */
oldwin = IDOS->SetProcWindow((APTR)-1);

/*
finally set the variable to the
path the executable was run from
don't forget to supply the variable
name to suit your application
*/

IDOS->AddPart( varpath, varname, 1024);
IDOS->SetVar( varpath, progpath, -1, GVF_GLOBAL_ONLY|GVF_SAVE_VAR );

/* turn requesters back on */
IDOS->SetProcWindow( oldwin );

}


and call it when AmiDock tells you about the location of the docky library (removing the file name) :
Quote:

case DOCKYSET_FileName:
{
char buffer[LARGE_BUFFER];

IUtility->Strlcpy(buffer, (STRPTR)msgData, LARGE_BUFFER);
*(IDOS->FilePart(buffer)) = '\0';
SetAmiUpdateENVVariable("NetDock", buffer);

break;
}


Then you just need to tell AmiUpdate the name of the env var to check (here : NetDock)

Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
Thank you (again) ,
I thought that this example was just for system lower than AmigaOS 4.1.1.
I will set it !

Go to top
Re: How to use Alpha layer for Docky ?
Just can't stay away
Just can't stay away


See User information
It works, great !

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project