View Single Post
Old 25-11-2014, 10:51
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Create a New Object layer from Mask

This is my first attempt at PhotoPaint macros. I write them all the time for Draw, but it's a little different in Paint. I'm using X7.
Sub ClipWhite()
    Dim doc As Document, lyr As Layer
    Set doc = ActiveDocument
    Set lyr = doc.ActiveLayer
    'create new object from selection
    'create mask from active object
    'delete original object
    If Application.Documents.Count = 0 Then
        Set doc = Nothing
    End If
End Sub
I have this code that inverts the active mask and crops the image to the mask, but now I want to edit it to create a new object from the mask after the invert, delete the original background layer.

I'm doing it this way rather than making the background layer and object, since that effectively removes the mask selection.
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote