GetExportSizeAndPos determines the portion of a diagram that will be returned as a bitmap. However the GetDiagramWidth/Height/Left/Top functions that determine the size look at all objects on the diagram, including non-visible objects. This can result in a bitmap having extraneous white space when a hidden object is outside the visible objects.
I would like to suggest the 4 GetDiagram.... functions be changed to return the value of only visible and non-group objects:
function TatDiagram.GetDiagramWidth: integer;
var
c: integer;
begin
result := 0;
for c := 0 to DControlCount - 1 do
if DControls[c].Visible and (DControls[c].IsGroup = false) then
result := Max(Round(DControls[c].SurroundRect.Right), result);
end;
IsGroup = false is necessary as a group's size is determined by it's member objects, some of which may be hidden.
Secondly, the GetExportSizeAndPos returns the width-1 and height-1 of the objects so any bimap will be missing one pixel from the right and bottom.