Mega Code Archive

 
Categories / Delphi / Graphic
 

Get Windows bitmaps

Title: Get Windows bitmaps Question: Get Windows standars bitmaps Answer: By means of LoadBitmap, we can capture the bitmaps that Windows uses for the buttons of the scrollbars, the checkboxes, etc... Here you have a function that assigns to a TImage one of these bitmaps: procedure TForm1.Button1Click(Sender: TObject); procedure AssignWindowsBMP(Destino:TImage;Cual:integer); { Kinds of Windows bitmaps: OBM_BTNCORNERS OBM_BTSIZE OBM_CHECK OBM_CHECKBOXES OBM_CLOSE OBM_COMBO OBM_DNARROW OBM_DNARROWD OBM_DNARROWI OBM_LFARROW OBM_LFARROWD OBM_LFARROWI OBM_MNARROW OBM_REDUCE OBM_REDUCED OBM_RESTORE OBM_RESTORED OBM_RGARROW OBM_RGARROWD OBM_RGARROWI OBM_SIZE OBM_UPARROW OBM_UPARROWD OBM_UPARROWI OBM_ZOOM OBM_ZOOMD } var tmpBMP : TBitmap; begin tmpBMP:=TBitmap.Create; try tmpBMP.Handle:=LoadBitmap( 0, makeintresource(Cual) ); Destino.Picture.Assign(tmpBMP); DeleteObject(tmpBMP.Handle); finally tmpBMP.Free; end; end; begin AssignWindowsBMP(Image1,OBM_DNARROW); end;