OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   Macros/Add-ons (http://forum.oberonplace.com/forumdisplay.php?f=21)
-   -   Help with script - cropping bitmap (http://forum.oberonplace.com/showthread.php?t=1682)

wangor 18-08-2006 15:18

Help with script - cropping bitmap

I use CorelDRAW 12, and i'm completly new to it, and to VBA scripts.

I've got a shape named "rect" which stores a rectangle and a shape named "box" which stores a bitmap.

I want to crop away every part of "box" that is out of "rect". In other words - i want to remove part of bitmap "box" that sticks out of rectangle "rect".

I have no idea how to do this, i guess it could be done with
but i have no idea how to set "clipping path".
(quote manual: "The Crop method crops the bitmap to its clipping path.")

My questions are:
How to use Shape.crop() ?
What is and how to set clipping path from VBA script level?
Is there any other way to solve my problem?

I tried to use recording, i cropped the bitmap while doing so, but only code that was generated was comment " 'Recording of this command is not supported"

I'd be very grateful if you could paste some code examples.

Thanks in advance.

sallybode 18-08-2006 20:31

The way cropping works in 12 is that you use the node editor, and marquis select two nodes on the same side. Then, holding the Ctrl key, (this constrains the movement to horizontal or vertical) you drag to where the photo should be cropped. Repeat procedure any other side which needs cropping. When you have it as you like it, go "Bitmaps/Crop Bitmap", or you can use the Property Bar icons for the same action.

X3's cropping is easier: it works just as the familiar crop tool in bitmap editing programs and also crops vectors. This is a really useful upgrade.

Rather than cropping, you could also PowerClip the bitmaps inside the size rectangle you want. It doesn't get rid of the excess pixels. It is a good choice for comps until the client makes their final decision.

Note on that: clients are notorious for changing their minds, even after you are sure it is a go. Once you have cropped, you can kiss the remnant you tossed away for good.

wangor 19-08-2006 19:20

PowerClip works very well.

All solved with Box.AddToPowerClip Rect

Thanks for help.

All times are GMT -5. The time now is 04:16.

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