I am exporting groups as images, and
- Code: Select all
GroupShape.SaveAsImage()
- Code: Select all
Spire.Presentation.GroupShape grouped = eachshape as Spire.Presentation.GroupShape; //eachshape is Spire.Presentation.Shape
if(grouped!=null)
{
Image saveimage;
//saveimage = grouped.SaveAsImage(); gives a blurry image for some reason
Bitmap TemporaryImage = new Bitmap(((Spire.Presentation.ISlide)grouped.Slide).SaveAsEMF());
float magicnumber = 1.3333333333f;
saveimage = TemporaryImage.Clone(new Rectangle((int)(grouped.Left * magicnumber), (int)(grouped.Top* magicnumber), (int)(grouped.Width* magicnumber), (int)(grouped.Height* magicnumber)), TemporaryImage.PixelFormat);
TemporaryImage.Dispose();
}
This almost works. It crops things slightly wrong. The left/top/width/height coordinates of the GroupShape do not represent actual coordinates on the image the slide produces, it appears to be miss-scaled by around 33%, but not exactly. Can you suggest a cleaner way to do this? This method captures some background text if the group overlapped with it.
If not, can you show me the code to move a group to a new slide that is 100% white? (I will just export the image of this slide and crop the white)
Thanks, your support is fast and knowledgeable.