On Friday 07 April 2017 23:02:17 Krzysztof wrote:
> I'm polishing slider button. Made new shape bitmaps with gimp. This time
> gimp created different pixels on each side, some of them have transparency
> (base color was black for circle shape, it is a result of smooth /
> antyalias option). TImagelist size is 7x7 because this is size of top-left,
> bottom-left, bottom-right and top-right corners. For rest edges it is
> enough to have 1px width/height because I can use "stretch" option while
> adding png files into timagelist. Unfortunately these 1 pixel bitmaps have
> transparency. When adding them as stretched, they becomes some kind of
> gradient. Don't know if this is just normal stretch policy (algorithm) or I
> need to check something when exporting to PNG in gimp. Currently my options
> are as on second screenshot. Translation from Polish is "save background
> color" and "save color's values for transparent pixels", compression is set
> to 0. In first screenshot, indexes 1 and 3 are added with stretch mode,
> they sizes are 7x1 and 1x7, just simply one black pixel with transparency
> arround 60%. I can solve this by making these 1x7px bitmaps as 7x7 by
> simply copy and paste in gimp and add without stretch check. That is not a
> problem because size of my slider buttons is fixed. But just wondering if
> it's possible to add such bitmaps as "repeated", not "stretched".
Currently there is no such option, I suggest that you extend the MSEgui 
frame-imagelist design tool from Alexandre ("minoshi").

> BTW: How to make transparent colorty at runtime? For example, I would like
> to make shape in gimp with base color stricte black (it may have black
> transparency pixels due to smoothing / antyaliasing). Add it to image list
> as base shape and then manipulate at runtime, for example set color to
> green (or still black) with alpha 50%:
> timagelist.bitmap.init(rgbtocolor(0,127,0,50)). Can't find any rgbtocolor
> related function with alpha param

TMaskBitmap has a separate bitmap for the mask, see TMaskedBitmap.Mask. It can 
be monochrome, gray-scale or RGB with separate opacity values per channel.
There is also TMaskedBitmap.Opacity, a color value which will be combined with 
the mask bitmap if there is one or will be used in order to define the 
opacity of the image bitmap. TColor has no alpha-channel.


Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
mseide-msegui-talk mailing list

Reply via email to