einhugur pictureeffect distort and transparency

I need help for transparency picture
I’m using einhugur plugin pictureeffect
with the demo shapedistort i would have a picture with transparent oval inside.
But nothing works. einhugur said me this.

[i][b]Your supposed to draw the mask before you distort
So its like

  1. Create your picture and draw into it.

  2. Draw its mask

  3. Distort picture

  4. Distort mask of the original picture (using same distort method as you used on your image)

  5. Apply the distorted mask to the Distorted picture by doing MyImage.Mask = MyDistortedMask.

  6. Draw your picture (it will draw with the defined transparency)
    I am trying many solutions but I’m wrong. I have always a white oval but not transparent.
    I write here the code

[code] Dim pg as PolygonF

MyImageLocation = new PointF()
frame = NewFrame.VecNorm(MyImageLocation)

effect = new ShapeDistortEffect()
effect2 = new ShapeDistortEffect()

function effect // plugin pictureeffect einhugur
// create image in runtime
//replace the Dimmuborgir image
dim pic,MyDistortedMask as picture
pic = new picture(200,200,32)
// color all pic in red
pic.Graphics.ForeColor = &cFF000000
pic.Graphics.FillRect 0,0,200,200
// add white oval ( i would like is transparent when draw it )
pic.Graphics.ForeColor = &cFFFFFF00
pic.Graphics.FillOval 100,100,50,50
pic.mask =pic

/// apply effect /////////////////////////////////////
MyImage = effect.Apply(EnsurePictureBits(pic,32),frame)

MyDistortedMask = new picture(200,200,32)
// color all pic in red
MyDistortedMask.Graphics.ForeColor = &c00000000
MyDistortedMask.Graphics.FillRect 0,0,200,200
// add white oval ( i would like is transparent when draw it )
MyDistortedMask.Graphics.ForeColor = &cFFFFFF00
MyDistortedMask.Graphics.FillOval 100,100,50,50

MyDistortedMask = effect2.Apply(EnsurePictureBits(MyDistortedMask,32),frame)
MyImage.Mask = MyDistortedMask

//MyImage.Mask = NewPicture(MyImage.Width,MyImage.Height,32)
//MyImage.Transparent =1

pg = NewFrame.VecNorm(new PointF(0.0,0.0))


if someone know this example

I am not sure what your doing in your code it makes no sense. It will need a bit of fixing

pic.mask =pic ??? // doing a thing like this will probably just create unpredicted result or endless loop crash.

And your still not going by the steps I posted to you.

Create picture completely before you distort anything, also the mask. It makes no sense your creating mask after you distort that is now how I posted it to you.

Step 1 and 2:
Dim p as Picture
g = p.Graphics

// Draw something in the g

g = p.Graphics.Mask(true)

// Draw something in the mask

Step 3:
Distort the picture § -> put result in new variable distortedP

Step 4:
Distort the pictures mask (p.Mask) -> put result in new variable distortedPMask

Step 5:
apply distortedPMask to distortedP

distortedP.Mask = distortedPMask

Then just draw distortedP.

It might also be worth it to draw p before step 3 to see that your pic looks fine with the mask you made before you did the distorts.

thanks a lot. I will try again