OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Channel mixer bitmap effect bug? (http://forum.oberonplace.com/showthread.php?t=5467)

kliv 23-04-2008 10:50

Channel mixer bitmap effect bug?
 
I am using X3 and I want a macro to:
1. convert the selection to a CMYK bitmap
2. export the cyan and the yellow from that bitmap.

I made the bitmap, but the macro just won't work as is supposed to do - it makes the same result (in my case it makes the yellow exactly like cyan. I cheked it with step throu and it is obvious that the channel mixer won't work 2 times in a run.
Any ideas on a workaround?
This is my code:

Code:

Sub twocolors_C_Y()
    Dim OrigSelection As ShapeRange
    Set OrigSelection = ActiveSelectionRange
    Dim s1 As Shape
    Set s1 = OrigSelection.ConvertToBitmapEx(cdrCMYKColorImage, False, False, 150, cdrNormalAntiAliasing, True, True, 95)
    Dim scyan As Shape
    Set scyan = s1.Duplicate()
    scyan.Bitmap.ApplyBitmapEffect "Channel Mixer", "ChannelMixerEffect InputColourModel=3,OutputChannel=3,PreviewOutputOnly=0,Level1=0|0|0|100,Level2=0|0|0|0,Level3=0|0|0|0,Level4=0|0|0|0"
    scyan.OrderToFront
    scyan.AddToSelection
   
            With ActiveDocument.ExportBitmap( _
            "c:\_C_.jpg", _
            cdrJPEG, cdrSelection, cdrGrayscaleImage, , , 72, 72, cdrSupersampling, , , UseColorProfile:=True)
       
        .Compression = 20: .Optimized = True: .SubFormat = 0: .Smoothing = 3

        .Finish
      End With
    scyan.Delete
    Dim syell As Shape
   
    Set syell = s1.ConvertToBitmapEx(cdrCMYKColorImage, False, False, 150, cdrNormalAntiAliasing, True, True, 95)
    syell.Bitmap.ApplyBitmapEffect "Channel Mixer", "ChannelMixerEffect InputColourModel=3,OutputChannel=3,PreviewOutputOnly=0,Level1=0|0|0|0,Level2=0|0|0|0,Level3=0|50|0|100,Level4=0|0|0|0"
    syell.OrderToFront
    syell.AddToSelection
          With ActiveDocument.ExportBitmap( _
            "c:\_Y_.jpg", _
            cdrJPEG, cdrSelection, cdrGrayscaleImage, , , 72, 72, cdrSupersampling, , , UseColorProfile:=True)
       
        .Compression = 20: .Optimized = True: .SubFormat = 0: .Smoothing = 3

        .Finish
      End With
    syell.Delete
     
End Sub

Of course there's a good explanation why I need this... anybody curious I will elaborate... :looney:

wOxxOm 23-04-2008 16:34

this is a very annoying bug, quite an old one
no workaround except for using 3rd party dll plugins for bitmap effects


All times are GMT -5. The time now is 18:24.

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