
Is it better to be tall or short?
[lead-in paragrah omitted]I recently needed to access bitmap resources from a file. The bitmap contained a number of individual [standard sized] images
‘strung’ together. These also needed to be loaded into a TImageList.
procedure AddCommCtrlBitMaps(imagelist: TImageList);
var
handle: THandle;
bitmap: TBitMap;
colTrans: TColor;
begin
handle := LoadLibrary('COMCTL32.DLL');
if (handle=0) then
RaiseLastOSError;
bitmap:= TBitMap.Create;
try
bitmap.LoadFromResourceName(handle,'#124');
imagelist.Add(bitmap,bitmap);
colTrans := bitmap.Canvas.Pixels[0,15];
imagelist.AddMasked(bitmap,coltrans);
finally
bitmap.Free;
FreeLibrary(handle);
end;
end;
Your task young padawan –
what is the VB equivalent? C++? or any other language? Hey, maybe this is the start of a
‘Translation Challenge of the Week’??Labels: Code, Delphi, WIN32