OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   Macros/Add-ons (http://forum.oberonplace.com/forumdisplay.php?f=21)
-   -   Convert lenses to bitmaps - help (http://forum.oberonplace.com/showthread.php?t=8110)

grzjanik 09-03-2012 04:52

Convert lenses to bitmaps - help
 
Hi, guys.

Sorry for my english. :)

I'm use Corel 12 and have problem with powerclips.
Alex's code (thanks Alex) converts all lenses to bitmaps on the Active.page.
Unfortunately bitmap in powerclips change size and position.
I don't know why.

Code:
Quote:

Sub ConvertLensesWithTransTest()
Dim s As Shape, sr As ShapeRange
Set sr = ActivePage.Shapes.FindShapes()
For Each s In sr
If Not s.Effects.LensEffect Is Nothing Then
s.ConvertToBitmapEx cdrCMYKColorImage, True, True, 300, cdrNormalAntiAliasing, True
End If
Next s
End Sub

Screens before and after:

http://grzjanik.ovh.org/oberon/before.jpg http://grzjanik.ovh.org/oberon/after.jpg

Please any help.

Regards.

~GrzJanik

shelbym 09-03-2012 09:09

Lens CorelDRAW 12
 
If I recall CorelDRAW 12 had issues with powerclips and lenses. The code you have should not see the lens in the powerclip at all, it should just ignore it.

-Shelby

grzjanik 09-03-2012 09:51

Powerclips
 
Thanks Shelby/

How to skip the powerclips?

grzjanik 09-03-2012 14:48

Powerclips
 
Maybe instead of skip powerclips, do this:

1. search for shapes (and convert lenses)
2. if found PowerClip - enter edit mode
3. search for shapes (and convert lenses)
4. if there are no lenses - leave edit mode
5. search for shapes (and convert) next
6. and so to the end of the page

Then the change will apply to all objects on the page.

Is this possible?

This is very important for me.

Thanks for help.
~GrzJanik

grzjanik 13-03-2012 08:00

Help
 
Maybe some other solution to get the desired effect?

~GrzJanik

shelbym 15-03-2012 21:27

Powerclip and Lens
 
Alright, I had a little time to look at this, give this a try. The only issue with this code is that it will not dig into groups.
Code:

Sub ConvertLensesWithTransTest()
    Dim s As Shape, ss As Shape
   
    For Each s In ActivePage.Shapes
        If Not s.PowerClip Is Nothing Then
            s.PowerClip.EnterEditMode
                For Each ss In s.PowerClip.Shapes
                    If Not ss.Effects.LensEffect Is Nothing Then
                        ss.ConvertToBitmapEx cdrCMYKColorImage, True, True, 300, cdrNormalAntiAliasing, True
                    End If
                Next ss
            s.PowerClip.LeaveEditMode
        Else
            If Not s.Effects.LensEffect Is Nothing Then
                s.ConvertToBitmapEx cdrCMYKColorImage, True, True, 300, cdrNormalAntiAliasing, True
            End If
        End If
    Next s
End Sub

Best of luck,

-Shelby

grzjanik 19-03-2012 08:52

Yeah
 
Thanks Shelby.

Thats great work!

This is code works with groups:

Quote:

Sub ConvertLensesWithTrans()
Dim s As Shape, ss As Shape, sr As ShapeRange
Set sr = ActivePage.Shapes.FindShapes()
For Each s In sr
On Error Resume Next
If Not s.PowerClip Is Nothing Then
s.PowerClip.EnterEditMode
For Each ss In s.PowerClip.Shapes
If Not ss.Effects.LensEffect Is Nothing Then
ss.ConvertToBitmapEx cdrCMYKColorImage, True, True, 300, cdrNormalAntiAliasing, True
End If
Next ss
s.PowerClip.LeaveEditMode
Else
If Not s.Effects.LensEffect Is Nothing Then
s.ConvertToBitmapEx cdrCMYKColorImage, True, True, 300, cdrNormalAntiAliasing, True
End If
End If
Next s
End Sub
Best of luck,

~GrzJanik

PS. When pasting text in the quote my tabs is disappear, why?

shelbym 19-03-2012 11:23

Formatting
 
Don't use Quote, use Code. :-) It will keep the formatting.

-Shelby

grzjanik 20-03-2012 02:33

Thank You
 
Code:


Sub Thanks_Shelby()

    Msgbox "I'll remember."
       
        ' :) 

End Sub

Regards.

~GrzJanik


All times are GMT -5. The time now is 05:32.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com