Mega Code Archive

 
Categories / Delphi / Examples
 

Imagelisttoimagelist

THIS PROCEDURE HAS NOT BEEN TESTED AT ALL so the chances are it won't work without a bit of time spent on it... //////////////////////////////////////////////////////////////////////////////// procedure TStepPropertiesForm.ImageListToImageList(copyFromImageList: TImageList; var copyToImageList: TImageList; newWidth, newHeight: Integer); //NOT CALLED... //copy one image list to another, sizing the 'copyTo' image list (and each of the //bitmaps from the 'copyfrom' list) according to the width and height dimensions //passed in... PUT ME IN THE TIP N TRIK DIR WHEN WE KNOW IT WORKS (along with //ScaleBitMapToSize)... var idx: Integer; swapBitMap: Graphics.TBitMap; begin swapBitMap := Graphics.TBitMap.Create; copyToImageList.Width := newWidth; copyToImageList.Height := newHeight; for idx := 0 to (copyFromImageList.Count - 1) do begin //swapBitMap is passed by reference in the next line: copyFromImageList.GetBitMap(idx, swapBitMap); //and is passed by reference again here... DrawObj.ScaleBitMapToSize(swapBitMap, containerListViewItemWidth, containerListViewItemHeight); copyToImageList.Add(swapBitMap, nil); //WHEN WE SUCCESFULLY GET IMAGES FROM THE MIDDLE TIER //(HOPEFULLY SOON) WE SHOULD USE THE COPYFROMIMAGELIST //FOR THE SMALLIMAGES AND LARGEIMAGES OF THE //CONTAINERLISTVIEW end; swapBitMap.Free; end;