Thanks for clearing that up.
Is it possible to extend the TImageList component, so it can accept TPicture in addition to TBitmap?
TBitmap is very limited (.BMP and .ICO) and doesn't allow for alpha channel transparency like in .PNG files.
var ImgList = TImageList.Create(dockForm);
ImgList.ColorDepth = 6;
ImgList.DrawingStyle = 3;
ImgList.SetSize(32, 32);
var B = TBitmap.Create;
B.LoadFromFile("c:\\temp\\account_balances.bmp");
var i = ImgList.Add(B, nil);
delete B;
btnOk.Images = ImgList;
btnOk.ImageIndex = i;
Aivars wrote:Yes, please send it, since the gulpdock.js that you sent me earlier doesn't appear to have this problem.
Edit1.Name = "testing";
Aivars wrote:I'll add classes required for accessing ImageMargins and ImageAlignment from pluginscripts. Regarding Top/Bottom margin - probably there's odd number of pixels left over.
Button.Width = PSForm.Canvas.TextWidth(Button.Caption) + Imagelist1.Width + bhPadding + bhPadding;
Button.Height = PSForm.Canvas.TextHeight("Jj") + bvPadding + bvPadding;
Aivars wrote:Regarding wrong offset - there's no trickery, that's the standard TButton as they come. Usually when we want buttons with images we avoid using TButton. TBitBtn looks better (but has issues with image lists). I would recommend using plain-text buttons anyway, they look more modern.
Users browsing this forum: No registered users and 2 guests