I can create a picture with vector graphics but can not figure out how to save it and re-open it that way. I tried the PICTURE.SAVE method but it doesn’t work for me. There’s no parameter, at least not documented, that I can find that allows for saving as a vector-graphics file. I did discover using:
MyPicture.Save(f, Picture.SaveAsDefaultVector)
Also tried
MyPicture.Save(f, Picture.SaveAsWindowsEMF)
But it doesn’t save. No error message but also, no file result.
No error messages. I stepped through process, it appears to save, but there’s no result. When it went to save the file with the .Saveasdefaultvector extension I noticed it the File Exists property flipped to False.
I think I did. The entire graphics/picture realm is a hard world for me to crack. But that said, I took the picture from a fully functional, vectored drawing on another window. I need the vectors because I don’t want pixellated text. Works beautifully in the other window. Prints to a beautiful PDF file. But when I copy this graphic and try to save it … it won’t happen.
Have you tried copying the example in the documentation and seeing if that works with your saving code. Then you will know if it is your drawing code or something with the saving code.
So here’s the code you suggested with a stringshape added. I scaled it to 2.0 to see if the text pixelates or not. It doesn’t. Looks great on the canvas. But … how do I save it? This is my sticking point.
Var SavePicture as new Picture(200, 200)
Var r As New RoundRectShape
r.Width = 120
r.Height = 120
r.Border = 100
r.BorderColor = Color.RGB(0, 0, 0) // black
r.FillColor = Color.RGB(255, 102, 102)
r.CornerHeight = 15
r.CornerWidth = 15
r.BorderWidth = 2.5
Var ss as new StringShape
ss.Text = “Hello”
SavePicture.Graphics.DrawObject(r, 100, 100)
g.DrawPicture(SavePicture, 0, 0) // Draw SavePicture in the Canvas
g.ScaleX = 2.0
g.ScaleY = 2.0
g.DrawText (ss.text, 50, 50)
Var file As FolderItem
If TargetMacOS Then
file = FolderItem.ShowSaveFileDialog("", "vector.pict")
Else
file = FolderItem.ShowSaveFileDialog("", "vector.emf")
End If
If file <> Nil Then
SavePicture.Save(file, Picture.SaveAsDefaultVector)
End If
When pasting code you should highlighting it and pressing the </> button, or type ``` before and after it.
I found something in a former thread that talks about shutting off ‘Supports HiDPI’. In the docs I found that you can only do this through “Shared Build Settings” but I don’t know how to do that.