![]() |
#1
|
|||
|
|||
![]()
Anyone,
I’m trying to accomplish two things, any hint or example code would be very helpful because I do not even know where to begin. 1 I’m trying to extrude a preview form a CorelDRAW file (version 8, 9 10 and 11) using Visual Basic 6, VBA for CorelDRAW or CorelSCRIPT. 2 I’m trying to generate a preview from the active worksheet to use in a worksheet manipulation Wizard. For this I’m also using Visual Basic 6, VBA for CorelDRAW or CorelSCRIPT. If there are no available samples or hints for Visual Basic 6, VBA for CorelDRAW or CorelSCRIPT then any C, C++ or MFC sample would also help. C, C++ or MFC are not my "native languages" but at I can read the code a little. |
#2
|
|||
|
|||
![]()
what exactly do you mean by "preview"? are you wanting to export the file into some other format to use elsewhere? i'm not quite following exactly what you're needing... :?
|
#3
|
|||
|
|||
![]()
Thanks for asking,
Part 1 CorelDRAW has a preview bitmap enclosed in their binary file format. This preview is always on the same location (as far as I know) in the CDR file. I want to create a Wizard that can handle pre-made templates in CDR format (for repetitive designing tasks). In that Wizard someone has to pick the template of his/here choice. I could add a custom made preview in a sort of database but then you would have no preview in the Wizard when you make your own template. If I had a way to extract that bitmap data (the preview) from the CDR file I wouldn’t have to make a custom preview for every template. Part 2 Once a template is open (you see the worksheet behind the Wizard) there will be some items that the Wizard can replace like text or another part of the design like a piece of clipart. Then it would be nice if there was a way you could generate a preview from the active worksheet and point out in the Wizard that a circled part of the preview is the part of the worksheet you are going to replace. If there where several items of text to replace the Wizard will probably be always right in front of the active worksheet hiding the design and then it will be very difficult to tell which text you are chancing at that moment (where in the design it actually is located). Part 2 could probably be achieved by a solution of part 1. I could search the newly opened template where exact the locations of the parts that can be replaced are in the worksheet, use the preview from part 1 and circle the locations in the preview. But this is complicated and maybe there is an easier way to do this. I hope this clarifies things a little and that you can help me. |
#4
|
|||
|
|||
![]()
hmmm, i have no idea how to do that. maybe alex does...
:cry: |
#5
|
||||
|
||||
![]()
You can extract thumbnails from a CDR file by using GetCDRFileThumbnail function of CorelScript object. You need to have CorelDRAW running for this though.
Here is how you do it: Code:
CorelScript.GetCDRFileThumbnail "C:\Graphic1.cdr", "C:\Thumbnail.bmp" As for the second part of your problem, I'm not sure you can do it. There is very little chance you can find any object location information in a CDR file. It is way buried into and the format constantly changes from version to version. |
#6
|
|||
|
|||
![]()
Thanks Alex, this works!
On the second part I was probably not clear enough. I will not look for locations in the file it self but in the worksheet when it is open. I get the extends of all the objects on the worksheet and draw a square round the extends with the center of the extends as the center of the square (to get the same positioning as in the square thumbnail), then iterate trough the objects and find the objects that can be replaced and their extends. The extends and location of the replaceable objects on the worksheet I then scale down to locations in the thumbnail. Sorry for my English but I’m Dutch and tend to write English sentences in Dutch grammar. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CorelDraw 10 DXF export relative coordinates - VBA solution? | asb617 | CorelDRAW/Corel DESIGNER VBA | 2 | 01-04-2010 02:34 |
NEED HELP ON CORELDRAW SCRIPT. FREE PHOTO CALENDAR IF U CAN! | johnlfitz | CorelDRAW/Corel DESIGNER VBA | 8 | 06-06-2008 22:59 |
CorelDraw 8 error in DLL file - help !!! cannot open!!! | Anonymous | General | 4 | 31-10-2004 15:52 |
run macro at start up Corel 11 ???? | -=HKLC=- | CorelDRAW/Corel DESIGNER VBA | 14 | 30-10-2004 09:29 |
Open - Resize - Savefile in Photo Paint | greenee | Corel Photo-Paint VBA | 2 | 28-06-2003 03:54 |