I’m seeing an UnsupportedOperationException (Cannot Rotate coordinates on a clipped Graphics from Graphics.Clip) while trying to save an Image of a DesktopChart Control to Disk using DrawInto.
Xojo 2023r4 on Windows 10.
Function ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean
Select Case selectedItem.Text
Case "Als Bild speichern..."
Var pngType As New FileType
pngType.Name = "image/png"
pngType.Extensions = ".png"
Var f As FolderItem = Folderitem.ShowSaveFileDialog(pngType, Me.Title + ".png")
If f <> Nil Then
If f.Exists Then f.Remove
Var p As New Picture(Me.Width, Me.Height)
Try
Me.DrawInto(p.Graphics, 0, 0)
p.Save(f, Picture.Formats.PNG)
Catch err As UnsupportedOperationException
MessageDialogSimple(MessageDialog.IconTypes.Stop, "Ok", "Das Speichern dieser Grafik ist mit dieser Version des WAG5 leider noch nicht möglich.")
End Try
End If
End Select
End Function
In other locations, this Method works just fine. In the LR is written “DrawInto will only work if the control is on a window or container.” and this Chart is on a TabPanel within a Container, within a PagePanel, within the Main Window.
And it all looks like this:
4 posts - 2 participants