Thread: .AddToPowerclip
View Single Post
  #5  
Old 02-02-2016, 09:26
HeauxmBru HeauxmBru is offline
Junior Member
 
Join Date: Jan 2011
Posts: 17
Default

Quote:
Originally Posted by shark View Post
it looks like you are fighting for a year on this issue.

Try change Set s1 = d.Selection to Set s1 = ActiveShape. d.selection returns shape with a cdrSelectionShape type.
Thanks shark!

That did the trick! I would not have thought of ActiveShape

I was trying to make a kind of brushed aluminum fill. Now the code works perfectly.

Code:
   Set s1 = ActiveShape
    s1.GetBoundingBox x, y, w, h
    Set s2 = lr.CreateRectangle2(x, y, w, h)

    s2.Fill.UniformColor.CMYKAssign 0, 0, 0, 10

    Set s2 = s2.ConvertToBitmapEx(cdrCMYKColorImage, , True, 300)

    With s2
        .Bitmap.ApplyBitmapEffect "AddNoise", "AddNoiseEffect NoiseType=Gaussian, Level=50, Density = 50, ColorMode=Intensity"
        .Bitmap.ApplyBitmapEffect "MotionBlur", "MotionBlurEffect Distance=15, Direction=0"
    End With
        
    s2.AddToPowerClip s1
The only other change I had to make was last line of the code by placing s2 in the correct place. I had it backwards.
This was wrong:

Code:
s1.AddToPowerClip s2
Thanks again.
Reply With Quote