On Tuesday 11 April 2017 21:45:03 Krzysztof wrote:
> Can you explain this? Lets say that I have timagelist1 which contain images
> for normal grid state, initialized with timagelist1.bitmap.init(cl_black)
> or any other color and second timagelist2 which contain exactly same images
> but for selected state and are initialized with
> timagelist2.bitmap.init(cl_white) or any other color. Now, how to make them
> work with grid (ttreeitemedit)? Is it possible to have only one timagelist
> and init different color per image, not per whole timagelist? Because I
> think that for IndexLookup I have to use only one timagelist.
>
Correct.
> Note that I'm creating images at runtime with mseftglyphs and base color
> cl_black. It depends on user which color scheme he choice (that is why
> timagelist.bitmap.init() is called)
>
Instead to fill the whole imagelist pixmap you need to color the individual 
images. Example for two colors, every glyph has been added twice:
"
var
 co1,co2: colorty;
 i1: int32;
 bmp1: tmaskedbitmap;
begin
[...] setup co1 and co2

  bmp1:= tmaskedbitmap.create(bmk_rgb);
  bmp1.options:= [bmo_masked,bmo_graymask];
  with timagelist1 do begin
   bmp1.size:= size;
   for i1:= 0 to count - 1 do begin
    getimage(i1,bmp1);
    if odd(i1) then begin
     bmp1.init(co2);
    end
    else begin
     bmp1.init(co1);
    end;
    setimage(i1,bmp1);
   end;
  end;
  bmp1.destroy();
end;
"

Martin

------------------------------------------------------------------------------
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
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to