I can probably use a flood fill to correct the colour but I would still like to know if this is a bug or something I am doing wrong.
on Test me, v_width, v_height
myMask = image( v_width, v_height, 8, #grayscale )
myMask.fill( myMask.rect, [#shapeType: #roundRect, #color: color( 255, 255, 255 )] )
myMask.fill( point( v_width/ 2, v_height/ 2 ), color( 255, 255, 255 ) )
put myMask.getPixel( 100, 100 )
Seems to affect #roundRect and #oval shapeType but not #rect and not if at least one dimension is under 128 pixels.
Are you using Director 11 or 11.5?... sorry, if you're using D11, because it's just buggy like that.
Try using a vectorshape instead and take the image of the vectorshape.... I have functions that'll create all sorts of shapes using vectorshapes, which can be found here: http://www.mediamacros.com/item/item-1006687738/ - check out the dropdown list for the 13 other vectorshape functions toward the bottom.
so it might look something like this:
vertList = createRectangle(320, 240, 12)
m = new(#vectorshape)
m.vertexList = vertList
m.strokeWidth = 0
m.closed = true
m.fillMode = #solid
m.fillColor = color(255,255,255)
mask = m.image.duplicate()
img = image(320,240,8,#grayscale)
img.copyPixels(mask, img.rect, mask.rect)
newMask = new(#bitmap)
newMask.image = img.duplicate()
-- then you can do what you need to from here.
Thanks Josh. I am using Director 11.5
To get around the issue I am creating the image at 32 bits and copying it to the 8 bit version.