Mega Code Archive

 
Categories / Delphi / Examples
 

Loadbitmapfromresource

THE PROCEDURE BELOW CURRENTLY DOES NOT WORK so debug it and achieve immortality (now there's an incentive) procedure TSideSectionStyleForm.TempLoadDesignsThumbNailBitMapsFromResource; {currently NOT called...} var idx: Integer; exeFileName, exeFilePath: String; sssFileName: String; bitMapName: String; begin exeFileName := Application.ExeName; exeFilePath := ExtractFilePath(exeFileName); GetSelectedFileNames(sssFileList, thumbsDataDirFF); DListView.Items.Clear; sssBitMapList.Clear; sssBitMapList.Width := ModuleImageWidth; sssBitMapList.Height := ModuleImageHeight; DListView.AllocBy := sssFileList.Count; if (sssFileList.Count > 0) then begin for idx := 0 to (sssFileList.Count - 1) do begin sssFileName := exeFilePath + thumbsDataDir + sssFileList.Strings[idx]; sssBitMap.Width := 1; sssBitMap.Height := 1; sssBitMapList.masked := False; if (idx < 10) then begin bitMapName := 'A' + 'MOD' + '00' + IntToStr(idx + 1) + '.BMP'; end; if ((idx > 10) and (idx < 99)) then begin bitMapName := 'A' + 'MOD' + '0' + IntToStr(idx + 1) + '.BMP'; end; if ((idx > 100) and (idx < 999)) then begin bitMapName := 'A' + 'MOD' + IntToStr(idx + 1) + '.BMP'; end; sssBitMap.LoadFromResourceName(HINSTANCE, bitMapName); sssBitMapList.Add(sssBitMap, nil); end; end; end;