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 06-11-2006, 10:05
igor___
Guest
 
Posts: n/a
Default How change Color mode used for effects with VBA?

Hi All!
How change Color mode used for effects with VBA in Color Management?

Problem 1):
if Color mode switch = CMYK (in X3)
incorrectly convert RGB color to CMYK,
if Color mode switch=RGB(Old Version Corel)
– that's all right.

Why?

2) Be available code, wich right convert All Colors (and Pantone) in CMYK model?

Thanks.
Reply With Quote
  #2  
Old 06-11-2006, 10:49
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Can you be more specific on what exactly is the problem. How do you judge when the RGB color is converted to CMYK incorrectly? Do you have any examples?

Also I don't think that X3's compositing mode is available to VBA...
Reply With Quote
  #3  
Old 06-11-2006, 11:40
igor___
Guest
 
Posts: n/a
Default

To convert all color to CMYK
I used code:

Quote:
Public Sub ConvertAllColorsToCMYK()

Dim colp As Pages
Dim p As Page
If ActiveSelection.Shapes.Count <> 0 Then
ConvertShapes ActiveSelection.Shapes
Else
Set colp = ActiveDocument.Pages
For Each p In colp
ConvertShapes p.Shapes
Next p
End If
End Sub

Private Sub ConvertShapes(ss As Shapes)
Dim s As Shape

For Each s In ss
Select Case s.Type
Case cdrTextShape, cdrRectangleShape, cdrPolygonShape, _
cdrLinearDimensionShape, cdrEllipseShape, cdrCurveShape, _
cdrConnectorShape, cdrBitmapShape

ConvertShapeColors s

Case cdrGroupShape
ConvertShapes s.Shapes
End Select
On Error Resume Next
If Not s.PowerClip Is Nothing Then
ConvertShapes s.PowerClip.Shapes
End If
Next s
End Sub

Private Sub ConvertShapeColors(s As Shape)
Dim c As FountainColor

' 1. Convert Fill colors
Select Case s.Fill.Type
Case cdrUniformFill
ConvertColor s.Fill.UniformColor

Case cdrPatternFill
ConvertColorFP s.Fill.Pattern.FrontColor
ConvertColorFP s.Fill.Pattern.BackColor

Case cdrFountainFill
ConvertColorFP s.Fill.Fountain.StartColor
ConvertColorFP s.Fill.Fountain.EndColor

For Each c In s.Fill.Fountain.Colors
ConvertColorFP c.Color
Next c
End Select

' 2. Convert outline color
If s.Outline.Type = cdrOutline Then
ConvertColorFP s.Outline.Color
End If
End Sub

Private Sub ConvertColor(c As Color)
c.ConvertToCMYK ' here RGB object color convert incorrect
' if in color mangement Color mode CMYK
End Sub
Reply With Quote
  #4  
Old 06-11-2006, 12:46
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

You might get better results by converting to Lab Mode first then converting to CMYK.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #5  
Old 07-11-2006, 06:14
igor___
Guest
 
Posts: n/a
Default

Thanks ddonnahoe!
Reply With Quote
  #6  
Old 07-11-2006, 08:29
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Igor,

My question was mostly about how do you judge whether an RGB color is converted to CMYK correctly or incorrectly? I'm interested to see your path of thought about this...
Reply With Quote
  #7  
Old 22-11-2006, 00:44
SiR
Guest
 
Posts: n/a
Default

to igor___
Please, send me this macros or give link to it. I'm very intrested in it.
sir@amik.ru
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
Where to begin with CorelDRAW and VBA shelbym CorelDRAW/Corel DESIGNER VBA 2 03-04-2007 09:15
CD 10, VBA not returning true outline width Webster CorelDRAW/Corel DESIGNER VBA 1 24-11-2004 17:09
VBA help needed - changing colours fremoikaner CorelDRAW/Corel DESIGNER VBA 1 18-11-2004 06:06
How to change VBA Design/run Mode ? -=HKLC=- CorelDRAW/Corel DESIGNER VBA 1 21-10-2004 23:49
Detect if VBA is installed (an answer and a question) reanan CorelDRAW/Corel DESIGNER VBA 3 04-12-2002 14:35


All times are GMT -5. The time now is 13:48.


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