Convertir casi cualquier decendiente de TGraphic a TBitMap
g puede ser un TIcon, TMetafile, TJPEGImege, TGifImage o TPNGObject, entre muchos otros
Código Delphi
[-]
function ToBMP(g: TGraphic): TBitMap;
begin
try
Result:=TBitmap.Create;
Result.Width:= g.Width;
Result.Height:= g.Height;
Result.Palette:=g.Palette;
Result.PixelFormat:=pf24bit;
Result.Canvas.Draw(0,0,g);
except
Result:=nil;
end;
end;