I almost finished the Library. I will call it "toolbar.library", unless Mason likes it and allows it to call aiss.library.
As a side effect, it can not only load AISS images, also any kind of images (like JPEG, PNG, GIF, IFF, BMP etc.) and Icons, scale them and display them or provide access to the ARGB Bitmap.
It can also do some postprocessing, like adding a shadow or Glow-Effect (in any color).
The interface works like this:
aiss* button = aiss_Open("TBImages:cut",width,height);
aiss_Blit(button,state,x,y,RastPort);
aiss_Close(button);
You can query information or apply effects with
aiss_DoMethod(button,state,taglist);
wheras
taglist[].ti_Tag can be...
// states
STATE_NORMAL = 0
STATE_SELECTED = 1
STATE_GHOSTED = 2
// apply methods
AISSM_CONTRAST = (AISSTAG_BASE + 100) ; -255..+256 contrast change
AISSM_ADDSHADDOW = (AISSTAG_BASE + 101) ; 0..255 strength
AISSM_ADDGLOW = (AISSTAG_BASE + 102) ; RGB Glow Color
AISSM_TINT = (AISSTAG_BASE + 103) ; RGB Tint Color
AISSM_EMBROSS = (AISSTAG_BASE + 104) ; 0..255 Embros effect
AISSM_SATURATION = (AISSTAG_BASE + 105) ; -255...255 boost or fade colors
AISSM_SHARPEN = (AISSTAG_BASE + 106) ; -255..255 Sharpen/Blur the image
AISSM_RESIZE = (AISSTAG_BASE + 107) ; change the image size without rescaling, e.g. add 3 pixels border for glow
AISSM_RESCALE = (AISSTAG_BASE + 108) ; rescale image smaller or larger
// query attributes
AISSA_ARGBBITMAP = (AISSTAG_BASE + 200) ; get the ARGB BitMap
AISSA_MASK = (AISSTAG_BASE + 201) ; get the 1bit Mask (for <256 color blitting)
AISSA_WIDTH = (AISSTAG_BASE + 203) ; get the width in pixel
AISSA_HEIGHT = (AISSTAG_BASE + 204) ; get the height in pixel
AISSA_NAME = (AISSTAG_BASE + 205) ; get the name as a string
e.g.
aiss_DoMethod(button,STATE_GHOSTED,Tags(AISSM_SATURATION,-128));
would fade the ghosted image 50% grey.
aiss_DoMethod(button,STATE_SELECTED,Tags(AISSM_RESIZE,32|(32<<16),AISSM_ADDGLOW,0xFFEE55));
would resize the image to 32/32 and add a yellowish glow effect to the selected image.
Does that sound cool or do you have any suggestions/wishes?
Edited by Wanderer on 2008/9/25 20:51:55
Edited by Wanderer on 2008/9/25 20:54:07
Edited by Wanderer on 2008/9/25 20:57:13
Edited by Wanderer on 2008/9/25 20:58:32
Edited by Wanderer on 2008/9/25 21:00:33
Edited by Wanderer on 2008/9/25 21:20:47