1
我發現這個很棒的組件,並安裝它,它運行的很好,但我遇到了一些小問題。不幸的是我不知道如何自己做。NGLN的圖像網格
有人可以幫我添加一個新的功能,這個組件。這將允許它從ImageList中獲取圖像?我會在執行期間填充ImageList動態。
現在我做以下,顯示TILE的預覽:
procedure TTools.Preview_ImageExecute(Sender: TObject);
var image_temp : TBitmap;
begin
image_temp := TBitmap.Create;
LoadBitMap(ComboBox1.Text,image_temp,Main.ASDb1);
Image1.Picture.Bitmap:=image_temp;
image_temp.Free;
end;
想與圖像網格以某種方式使用這個......應該以某種方式讓我加載我所有的瓷磚..我會用一個for循環來填滿它......
同時我用的ListBox玩,併成功地做到這一點:
procedure TTools.Lst1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var CenterText : integer;
begin
Lst1.Canvas.FillRect(Rect);
Il1.Draw(lst1.Canvas,rect.Left +4, rect.Top +4, Index);
Centertext := (rect.Bottom - rect.Top -lst1.Canvas.TextHeight(text)) div 2;
Lst1.Canvas.TextOut(rect.left + il1.width + 8, rect.Top + CenterText, lst1.Items.Strings[index]);
end;
procedure TTools.Lst1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
Height := IL1.Height+4;
end;
procedure TTools.Button4Click(Sender: TObject);
var i : integer;
image_temp : TBitmap;
begin
image_temp := TBitmap.Create;
for i:=0 to Main.Images.Count-1 do
begin
Lst1.Items.Add(Main.Images.Item[i].Name);
LoadBitMap(Main.Images.Item[i].Name,image_temp,Main.ASDb1);
IL1.AddMasked(image_temp, clNone);
end;
Image_temp.Free;
end;
這工作,如果我有0列,但我不能它與說4列一起工作,有人可以幫忙嗎?
問候 羅伯特
羅伯特,你應該發佈你的答案作爲一個答案,而不是編輯你的問題。你甚至有望在幾天後將其標記爲可接受的答案。 –