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-07-2006, 15:17
xenio
Guest
 
Posts: n/a
Default Replacing bitmap color mode

CorelDrawX3
There is a way to change the color model of all the bitmap in a document, with a script or a different way?
I prepare the page with cmyk bitmap anyone on is powerclip, sometime I need to export in gray PDF and the conversion in grayscale is very bad.
So I have to convert manually all the bitmap mode to grayscale using the icc profile and then export to pdf.

I try to use the 'find' tool (find all bitmap) but this does not search inside the Powerclip.
Any Idea?
Thanks,
Xenio
Reply With Quote
  #2  
Old 24-07-2006, 10:45
xenio
Guest
 
Posts: n/a
Default

At least, I did it by myself, I am not a coder, but with some cut and paste some trial and error here it is the macro:
Change all the bitmap mode to grayscale (PowerClipped bitmaps too).

Any better code are welcome.
Thanks,
Xenio

Code:
Sub ChangeMode()

Dim s As Shape, sp As Shape
Dim pwc As PowerClip
Dim ChangeCountPowerClip As Integer
Dim ChangeCount As Integer

ChangeCountPowerClip = 0
ChangeCount = 0

For Each s In ActiveDocument.ActivePage.Shapes
    Set pwc = Nothing
    Set pwc = s.PowerClip
    
    If Not pwc Is Nothing Then
        For Each sp In pwc.Shapes
            If sp.Type = cdrBitmapShape Then
                If sp.Bitmap.Mode <> cdrGrayscaleImage Then
                   sp.Bitmap.ConvertTo cdrGrayscaleImage
                   ChangeCountPowerClip = ChangeCountPowerClip + 1
                End If
            End If
        Next sp
    End If
    
    If s.Type = cdrBitmapShape Then
        If s.Bitmap.Mode <> cdrGrayscaleImage Then
            s.Bitmap.ConvertTo cdrGrayscaleImage
            ChangeCount = ChangeCount + 1
        End If
    End If

Next s
MsgBox ChangeCount & " Bitmap and " & ChangeCountPowerClip & " inside PowerClip"
End Sub
Reply With Quote
  #3  
Old 29-04-2007, 03:12
designhouse
Guest
 
Posts: n/a
Default Replacing bitmap color mode

make a subroutine & call it from main

I think it is more effective cause your code may not convert images in nested powerclips & my codes can

Code:
Private Sub DoReplaceOnShapes(ss As Shapes)

    Dim s As Shape
    For Each s In ss
        Select Case s.Type
            Case cdrBitmapShape
            If s.Bitmap.Mode = cdrRGBColorImage Or cdrDuotoneImage Or cdrLABImage Or cdrPalettedImage Or cdr16ColorsImage Or cdrBlackAndWhiteImage Then
            s.Bitmap.ConvertTo cdrCMYKColorImage
            End If
            End Select
        On Error Resume Next
        If Not s.PowerClip Is Nothing Then DoReplaceOnShapes s.PowerClip.Shapes
    Next s
End Sub
regards,
amit
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
Clipping Path in bitmap with X3 xenio General 3 06-07-2006 21:01
Apply Envelope to bitmap RonHill General 2 19-06-2006 21:14
[BUG] - Rotatted Bitmap doing bad. Kursad General 7 19-07-2005 11:49
Bitmap names in Corel 12... meandirtyjoe CorelDRAW/Corel DESIGNER VBA 1 17-05-2005 09:14
replacing duotone bitmap please_reboot CorelDRAW/Corel DESIGNER VBA 4 18-04-2004 22:30


All times are GMT -5. The time now is 06:08.


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