I am trying capture large image from gojs with angular 17 from below code. But it captures image upto 2000*2000 pixels which either cropping it off or making it blur. Is there any way we can capture large images in gojs with angular 17 with full clarity without cropping it off. I tried by changing scale but its cropping the image.
public createImage(diagram: go.Diagram) {
const bounds = diagram.documentBounds.copy();
const imageDataOptions: any = this.createImageOptions(bounds);
return diagram.makeImageData(imageDataOptions);
}
createImageOptions(bounds: go.Rect): go.ImageRendererOptions {
const imageDataOptions: go.ImageRendererOptions = {
background: 'white'
}
if (!_.isNaN(bounds.width) && !_.isNaN(bounds.height)) {
if (bounds.height > DiagramImageUpperBond && bounds.height > bounds.width) {
const newHeight = DiagramImageUpperBond;
const newWidth = bounds.width - ((bounds.height - DiagramImageUpperBond) * (bounds.width / bounds.height))
imageDataOptions.size = new go.Size(newWidth, newHeight);
}
else if (bounds.width > DiagramImageUpperBond && bounds.width > bounds.height) {
const newWidth = DiagramImageUpperBond;
const newHeight = bounds.height - ((bounds.width - DiagramImageUpperBond) * (bounds.height / bounds.width))
imageDataOptions.size = new go.Size(newWidth, newHeight);
}
else {
imageDataOptions.scale = 1
}
}
return imageDataOptions;
}