BPSoftware.com
Home   Utilities   Purchase   FAQ   Support   Contact        
Shareware Utilities
 APrintDirect
 AIconExtract
 AFile Attribute Manager
Freeware Utilities
 AddrMon
 AFileSync
 ASysIcon
 B&P Table Utilities
 BPACLer
 BPSNMPMon
 BPSNMPUtil
 CharCount
 Delphi® Components
 MacAddr
Miscellaneous
 BPSoftware Blog
 Purchase Shareware
 Support

 Subscribe!

Saturday, January 14, 2006
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: , ,

posted by Brad Prendergast at 7:12:00 AM
Comments:
Links to this post:

Create a Link

Recent Posts
 Syncing
 Piecing it all together (Part 3)
 Piecing it all together (Part 2)
 Piecing it all together (Part 1)
 Some Component Updates
 Geeky Thought
 FTP Batch
 Plug Me In
 Feed Me
 Santa Did Come

 Subscribe!


Labels



Archives
 October 2005
 November 2005
 December 2005
 January 2006
 February 2006
 March 2006
 April 2006
 May 2006
 June 2006
 July 2006
 August 2006
 September 2006
 December 2006
 January 2007
 February 2007
 March 2007
 September 2007
 October 2007
 November 2007
 July 2008
 November 2008
Powered by Blogger