OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17-02-2013, 06:35
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 154
Default How to recursively find powerclip inside powerclip

How to recursively find powerclip inside powerclip and edit its contents via VBA
Reply With Quote
  #2  
Old 22-02-2013, 11:23
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Powerclips

When you say edit the contents, what would you like to do?

-Shelby
Reply With Quote
  #3  
Old 22-02-2013, 13:05
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 154
Default

I have to convert rotated bitmaps inside the nested powerclip by again making them bitmap
Reply With Quote
  #4  
Old 22-02-2013, 14:02
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Powerclips

Here is a little example:
Code:
Sub TestFindAllShapes()
    Dim s As Shape, sr As ShapeRange
    
    Set sr = FindAllShapes.Shapes.FindShapes(Type:=cdrBitmapShape)
    
    For Each s In sr.Shapes
        s.Bitmap.ConvertToBW cdrRenderLineArt
    Next s
End Sub

Function FindAllShapes() As ShapeRange
    Dim s As Shape
    Dim sr As ShapeRange
    Dim srAll As New ShapeRange, srPowerClipped As New ShapeRange

    If ActiveSelection.Shapes.count > 0 Then
        Set sr = ActiveSelection.Shapes.FindShapes()
    Else
        Set sr = ActivePage.Shapes.FindShapes()
    End If
    
    Do
        For Each s In sr.Shapes.FindShapes(Query:="!@com.powerclip.IsNull")
            srPowerClipped.AddRange s.PowerClip.Shapes.FindShapes()
        Next s
        
        srAll.AddRange sr
        sr.RemoveAll
        sr.AddRange srPowerClipped
        srPowerClipped.RemoveAll
    Loop Until sr.count = 0
    
    Set FindAllShapes = srAll
End Function
Hope that helps,

-Shelby
Reply With Quote
  #5  
Old 23-02-2013, 03:01
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 154
Default

my sample file is attached, pls see what can be done
Attached Files
File Type: cdr powerclipTest.cdr (44.4 KB, 191 views)
Reply With Quote
  #6  
Old 26-02-2013, 00:54
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Bitmap Resample

Just change the line:
Code:
s.Bitmap.ConvertToBW cdrRenderLineArt
to
Code:
s.Bitmap.Resample , , True, 300, 300
Best of luck,

-Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text in Powerclip Craig Tucker CorelDRAW/Corel DESIGNER VBA 3 27-11-2012 09:11
CQL does not find shapes in PowerClip aakkaarr CorelDRAW/Corel DESIGNER VBA 3 11-05-2011 18:44
Rotation and PowerClip Craig Tucker CorelDRAW/Corel DESIGNER VBA 3 23-08-2007 17:31
powerclip extract zaum CorelDRAW/Corel DESIGNER VBA 2 26-10-2005 08:26
BUG - Lens Effect inside a Powerclip.jpg Hernán General 3 09-04-2005 00:06


All times are GMT -5. The time now is 20:46.


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