Home Image-Pro Automation (Macros, Apps, Reports)
Options

String Array of Image Names

Hello

I'm writing an automation that requires subtracting several mask images generated from 1 master image. Rather than give each mask a different name which is messy and hard to keep track of I would like to create an array of McImages.

For example

Dim mask(5) As McImage

Dim x As Integer

For x = 1 to 5

	With Measure.Measurements.CreateCommands.Mask(MakeMasks)
            .Run(ThisApplication.ActiveImage)
        End With
	Masks(x) = "Mask" & number.ToString(x)
        DapiMaskName1 = ThisApplication.ActiveImage 'Assigns the mask image name to variable so that it can be selected

Next x 

Not the exact code but close. McImage doesn't seem to accept arrays of images like this, is there another way or would I have to use separate filenames for each one.

Regards

 

David

Best Answer

  • Options
    edited November 2013 Answer ✓
    Hi David,

    You should assign image directly to the array element:

    Masks(x) = ThisApplication.ActiveImage

    Also, CreateCommands.Mask has output parameter, which you can use directly:

    ---
            With Measure.Measurements.CreateCommands.Mask(CreateMasks)
                .Run(doc1, image1)
            End With
            Masks(x)=image1
    Yuri

Answers

Sign In or Register to comment.