unit Graphics;
......
function TPicture.GetBitmap: TBitmap;
begin
ForceType(TBitmap);
Result := TBitmap(Graphic);
end;
procedure TPicture.ForceType(GraphicType: TGraphicClass);
begin
if not (Graphic is GraphicType) then
begin
FGraphic.Free;
FGraphic := nil;
FGraphic := GraphicType.Create;
FGraphic.OnChange := Changed;
FGraphic.OnProgress := Progress;
Changed(Self);
end;
end;