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 23-06-2005, 07: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 Determining Ink Coverage

In VBA for CD12 is there a way to determine how much ink coverage there will be on a CMYK print job? I am currently only interested in determining CMYK. I was thinking... Find the area of the page and the area taken up by all objects on the page. Find the CMYK values for each object and subtract the usage area from the total page area to find the negative space. Something along this line. I need to get something to eat. I can't think straight right now.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #2  
Old 27-06-2005, 16:56
Webster
Guest
 
Posts: n/a
Default Determining Ink Coverage

You want to know how much ink is used in an ink jet print, right?

I have done something very similar - and have been able to build up a database of ink densities used in each graphic enabling me to relate this information back to how many cartridges have been used.

It is then very easy to work out accurate costings according to actual ink usage. Very handy.

I export a CMYK bitmap of the graphic I want to measure. This is imported into PhotoPaint, and converted to a low res CMYK image. A very wide blur is applied, and a point is sampled. Surprisingly accurate.

The information is then written to a text file that can be imported into a database and/or quoting program that I have for storage or annalysis.

This is the code I use in Corel 10 PhotoPaint.



Sub GetCol()

Dim c1 As Long, c2 As Long, c3 As Long, c4 As Long
Dim model As Long
Dim doc As Document
Dim DocNm As String
DocNm = "C:\Export\tif.TIF"

Set doc = OpenDocument(DocNm)
If doc.Layers.Count > 0 Then doc.Layers.Merge
If doc.Mode <> cdrImageCMYK Then doc.ConvertTo cdrImageCMYK
doc.Resample 10, 10, False 'makes a very low res image

With CorelScript
.BitmapEffect "Gaussian Blur", "GaussianBlurEffect GaussianBlurRadius=4500,GaussianBlurResampled=0"
.GetPixelColor 5, 5, model, c1, c2, c3, c4

c1 = c1 / 255 * 100
c2 = c2 / 255 * 100
c3 = c3 / 255 * 100
c4 = c4 / 255 * 100

If c1 = 0 Then
c1 = 1
End If
If c2 = 0 Then
c2 = 1
End If
If c3 = 0 Then
c3 = 1
End If
If c4 = 0 Then
c4 = 1
End If

End With
doc.Dirty = False
doc.Close

Open "C:\1Storage\DoNotDelete\GetColor\Colors.txt" For Output As #1
Write #1, c1
Write #1, c2
Write #1, c3
Write #1, c4
Close #1

Dim res
res = MsgBox("Data written to file. Close PhotoPaint?", vbYesNo, "Close PhotoPaint")
If res = 6 Then
Quit
Else:
Exit Sub
End If

End Sub
Reply With Quote
  #3  
Old 27-06-2005, 17:35
Webster
Guest
 
Posts: n/a
Default Determining Ink Coverage

Forgot to say -

Corel 10 didn't have the functions that C12 no doubt has.

This bit.......

With CorelScript
.BitmapEffect "Gaussian Blur", "GaussianBlurEffect GaussianBlurRadius=4500,GaussianBlurResampled=0"
.GetPixelColor 5, 5, model, c1, c2, c3, c4
etc

...probably can be done much better now.
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
Determining whether a bitmap has a color mask applied to it pmeier CorelDRAW/Corel DESIGNER VBA 3 13-07-2003 23:46


All times are GMT -5. The time now is 03:22.


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