Is there command to determine if a given bitmap shape is a duplicate as opposed to an import, link, copy, or clone?
I'm working on a macro to scan CorelDRAW files for bitmaps which need to be downsampled to keep file size down. It works fine, however there are certain cases involving duplicates in which downsampling is counter-productive. A lot of what we do involves duplicating a bitmap and then adjusting its scaling, crop envelope, etc. In these cases, downsampling can actually increase file size significantly because you lose the duplicate reference in the file and actually end up creating multiple new bitmaps.
I'm aware of the programming concepts of references vs. copies, so I can see what's going on and why, but I haven't seen a way to determine, for example, that these three bitmaps are all one reference, while these other two are unique, etc.
Is it possible with the current object model?
Note -- when these situations arise it's when we apply different, unique scaling and crop envelopes to the duplicates, so cloning won't work as an alternative.
Hi.
When you create the duplicate you can give it a name in vba using the shape.name property.
You can exclude processing of shapes with a certain name either in your looping, or the preferable cql query method.
~John
Hi John, thanks for your quick reply.
The project in question is for scanning a document after a designer has worked on it. The duplicates aren't being created by a macro in the first place. It's a question of given any CorelDRAW file, regardless of how it was created, can I scan it and find out which bitmaps are duplicates and which aren't.
HI.
This would be tough. There's no sure way.
You can use properties such as same size height and width or position and static id. The static id of the duplicated shape should be a greater number.
Ie: If the size and width are the same and the position x is greater and the item shares the same y position and the static id is greater.
Still it would need a lot of testing. I'll post more if I can think of something else.