1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
| function GlyphFromImageLists(Source1, Source2: TImageList; Index: integer; BkColor: TColor): TBitmap; overload; var bmp1, bmp2: TBitmap; R1, R2: TRect; bColor1, bColor2: TColor; begin bColor1 := Source1.BkColor; bColor2 := Source2.BkColor; Source1.BkColor := BkColor; Source2.BkColor := BkColor; bmp1 := TBitmap.Create; bmp2 := TBitmap.Create; Result := TBitmap.Create; try Source1.GetBitmap(Index, bmp1); Source2.GetBitmap(Index, bmp2); R1.Left := 0; R1.Top := 0; R1.Right := bmp1.Width; R1.Bottom := bmp1.Height; R2.Left := bmp1.Width; R2.Top := 0; R2.Right := bmp1.Width * 2; R2.Bottom := bmp1.Height; Result.Width := bmp1.Width * 2; Result.Height := bmp1.Height; Result.Canvas.CopyRect(R1, bmp1.Canvas, R1); Result.Canvas.CopyRect(R2, bmp2.Canvas, R1); finally bmp1.Free; bmp2.Free; Source1.BkColor := bColor1; Source2.BkColor := bColor2; end; end; function GlyphFromImageLists(Source1, Source2: TImageList; Index: integer): TBitmap; overload; begin Result := GlyphFromImageLists(Source1, Source2, Index, clBtnFace); end; |