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...