![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi all,
I am writing some script that will collect statistics about colors in document. However I am having problems with the class that will collect these statistics. This is what I try in order to have a property in the class that will collect colors from the document. Code:
Dim oPalette As Palette Public Property Set Palette(ByRef thePalette As Palette) Set oPalette = thePalette End Property Public Property Get Palette() As Palette Set Palette = oPalette End Property Private Sub Class_Initialize() Dim oPalette As Palette Set oPalette = New Palette Set Me.Palette = oPalette End Sub Quote:
Code:
Set oPalette = New Palette ![]() The idea is to collect colors from the ones that are used in the document in a property of the instance of the class. Hope it makes sense :roll: _____ Looking through the VBA help of CDR12 I found Palettes.Create However I do not like to have a physical file for the palette. Is it possible, or I am riding the wrong horse? _____ Another thing that I am not sure - is it possible to combine colors from different standard palettes in one custom one? |
#2
|
||||
|
||||
![]()
Yes, unfortunately you can't create an instance of pallete by just using the New keyword.. You need to use Application.Palettes.Create method instead.
However I'm not sure why you need this in your case. I would use Palettes.CreateFromDocument to create a palette from all the colors from the current (active) document like this: Code:
Set oPalette = Application.Palettes.CreateFromDocument("MyPalette") |
#3
|
|||
|
|||
![]() Quote:
Quote:
|
#4
|
||||
|
||||
![]()
It all depends on the object's fill type. If it is Uniform Fill, then use UniformColor property, if it is fountain fill, then use Fountain and go through all of the colors in the list and so on. Obviously, No fill means no color at all...
|
#5
|
|||
|
|||
![]()
OK Thank you for you reply, but I figured out that the error was in my code bellow the line I mentioned.
This is why I deleted my question ![]() For the record - it was something like Quote:
If you are still willing to answer: whats the difference (if any) between cdrColorPantoneHex and cdrColorPantone? Well actually I need to know which color types have Tint property, and because I am not a CorelDraw expert, I actually am not aware of differences between palettes. |
#6
|
||||
|
||||
![]() Quote:
But in meanwhile, a tintable color is any of the Pantones (except for Pantone Process) including Pantone Hexachrome, as well as DIC, TOYO, HKS, DUPONT, FOCOLTONE, and User Inks. I hope this helps |
#7
|
|||
|
|||
![]()
Hopefully last thing in this thread... :roll:
Is there any fast way to get a name for an "unnamed color" like "R: 22 G: 89 B: 111" (At the moment I am doing this "by-hand" in the program code) I mean CorelDraw12 shows a shape filled with uniform fill with such an RGB color, with name "R: 22 G: 89 B: 111" in Object Manager, but when I programatically check the Name property of the Color object - it has a value "unnamed color" Also is there a better way to check wether a color has a name than comparing its Name property with value "unnamed color"? And thank you for the help! ![]() |
![]() |
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 |
CDR12 ?Bug?: HSB Colors | zlatev | CorelDRAW/Corel DESIGNER VBA | 2 | 22-02-2005 13:21 |
How to set palette as default palette with VBA ? | hmalme | CorelDRAW/Corel DESIGNER VBA | 1 | 22-12-2004 13:26 |