i used MakeBitmap in order to export an image of my diagram.
Could you provide more information please? What platform and which version numbers (platform and GoXam)? Is what is seen in the control that which is clipped? Or is it the image in the bitmap? Does the bitmap have the correct contents?
i’ll start from the end,
Is this WPF or Silverlight? And which version thereof?
How did you call MakeBitmap?
Wpf 1.2.4.7
// important: include link arrows in flow picture.
double width = bounds.Width;
double height = bounds.Height;
double scale = 2.0;
if (width > 2000)
{
scale = 2000/width;
}
if (height > 2000)
{
scale = Math.Min(scale, 2000/height);
}
width *= scale; height *= scale;
var image = _diagram._diagram.Panel.MakeBitmap(new Size(width, height), 96, new Point(bounds.X, bounds.Y), scale);
the problem is not related to saving the image to a file as this occurs also when the saing is skipped.
That’s very odd – I’ve never heard or seen that kind of error in WPF.
When you say that it happens “when the saving is skipped”, do you mean when not calling MakeBitmap?
What other code executes when this problem occurs?
After the clipping appears, do mouse actions in the “invisible” area still work as if the rest were visible?
After the clipping happens, what are the ways of restoring the proper appearance?
what i meant by “saving is skipped” is when i dont save the bit map to a file.
This wouldn’t explain the problem, but why do you start with a scale of 2.0?
Does the size of the diagram relative to the size of the viewport matter in causing the problem?
scale just output a bigger picture to my understanding.
So if you make the Diagram smaller so that there are scrollbars in both directions, you still have the clipping problem?
i think the clipping is relative to the left edge. if the diagram is closer to the left edge its container you get a smaller part clipped or not at all.
I was finally able to reproduce the problem.
As a work-around, try calling MakeBitmap with an Action argument (the optional argument that comes last) that does:
myDiagram.Panel.MakeBitmap(. . .,
bmp => {
var pos = myDiagram.Panel.Position;
myDiagram.Panel.Position = new Point(pos.X, pos.Y+1);
myDiagram.Panel.Position = pos;
});
This is crude but I hope it helps in this situation.