I have found some unusual behavior with transparent dynamically-created images. Modifying the script above slightly to make the new document transparent:
Code: Alles auswählen
Dim pl
Dim doc
Dim image
Set pl = CreateObject("PhotoLine.Application")
pl.Visible = True
' Create a new, empty document
Set doc = CreateObject("PhotoLine.Document")
If (Not doc Is Nothing) Then
' Turn on picture mode
doc.DocumentMode = False
' Create an image, RGB (1), size (800;600)
Set image = CreateObject("PhotoLine.Image")
'image.InitPicture 1, Array(800, 600)
image.InitPicture 1+16384, Array(800, 600), Array(0, 0, 0, 0) ' <=== change the above to this
' Insert the image in the document. The document will adjust its size
' to the image size.
doc.RootLayer.Insert image, -1
End If
Then if you create a filled vector layer using Vector Drawing, Circle, etc., right-click the vector layer and select Merge Down, the vector is moved and distorted. It does not happen if you select Flatten Image. The same thing happens if you dynamically create the vector and use doc.Merge([vLayer, aLayer]) as opposed to doc.Merge(). (Which is how I noticed this.)
If you manually create a new image with a transparent color, none of this happens. Is there something missing from the way the dynamic new document was created?