• Not Answered

script recorder with "inverteffect" not working

Hy all,

by "normal" inverting an b/w image the image changes the colours in black or white.

when recording the invert image process the script shows:

WITHOBJECT "CorelPHOTOPAINT.Automation.13"
    .BitmapEffect "Invertieren", "InvertEffect "
END WITHOBJECT

But when I play the recorded script nothing happens. No invert. No changing colours. Other scripts like Mask Rectangle or Adding Guidelines work.

Using Corel photo-paint x3 v.13.0.0.576. Don't know if I have Corel Service Packs installed. I don't think so.

Has anybody an idea?

Thx in advance,

weinberger

27 Replies - Latest Reply

  • Hi Weinberger,

    In PPX5 the code recorded as follows and works fine:

    WITHOBJECT "CorelPHOTOPAINT.Automation.15"
     .SetDocumentInfo 824, 484
     .BitmapEffect "Invert", "InvertEffect "
    END WITHOBJECT

    I then removed the second line ( .SetDocumentInfo 824, 484), resaved the file and ran it again....still worked fine. I am not sure why yours is not working. I wonder if you change the word  "Invertieren" to "Invert" if that would make any difference. I take it your copy of Photo-Paint was installed in German? If so, then changing to the English spelling may not help, but worth a try.

    Best regards,
    Brian.

  • In reply to Brian:

    Hi Brian,

    Thank you.

    Yes, forgot to mention that my copy of Photo-Paint is in German.

    Tried your proposal to change the word to "Invert". Doesn't make any difference.

    Anyway, thanks a lot and it was worth a try.

    Kind regards,

    weinberger

  • In reply to weinberger:

    If you wanted to write a VBA macro and keep it all VBA, you could duplicate your layer and set the merge mode to Invert.

  • In reply to Brian:

    I'm not that firm with VBA

  • In reply to weinberger:

    Try this: either set Cache levels to 1, OR zoom in to 100% before
    running the script.

    Huib

    On Wed, 13 Apr 2011 08:48:38 +0000 (UTC), "weinberger" <> wrote:

    >Hi Brian,
    >
    >Thank you.
    >
    >Yes, forgot to mention that my copy of Photo-Paint is in German.
    >
    >Tried your proposal to change the word to "Invert". Doesn't make any difference.
    >
    >Anyway, thanks a lot and it was worth a try.
    >
    >Kind regards,
    >
    >weinberger
  • In reply to Twieker:

    great, thanks to twieker

    both are working. isn't that a bug? is this resolved with service pack patches?

    1. now I need to macro/record the zoom to 100%. how to?

    2. is there a possibility to automatically show rulers with opening a file? Everytime I need to click the ruler button. It's annoying.

    Great help

    cheers

  • In reply to weinberger:

    Hi Weinberger,

    someone else wanted rulers to be turned on by default in Photo-Paint, so I made a quick VBA macro for that. If you scroll down the page at this thread until you see my first post - you should see an attachment called BDShowRulers.gms

    Best regards,
    Brian.

  • In reply to Brian:

    thanks for your help brian. but BDShowRulers.gms doesn't work for me.

    I pasted in all those folders:

    C:\Users\Username\AppData\Roaming\Corel\Graphics13\User CorelPHOTO-PAINT

    C:\Program Files (x86)\Corel\CorelDRAW Graphics Suite 13\CorelPHOTO-PAINT

    even in those, although "Draw":

    C:\Program Files (x86)\Corel\CorelDRAW Graphics Suite 13\Draw

    C:\Users\Username\AppData\Roaming\Corel\Graphics13\User Draw

    The rulers won't stick as a default.

    And in VB-Editor BDShowrulers is password protected.

    Best regards,

    weinberger

     

     

     

     



    [edited by: weinberger at 4:27 (GMT -5) on Thu, Apr 14 2011]
  • In reply to weinberger:

    Hi Weinberger,

    it works fine here, but I am using X5, not sure if that makes a difference. You only need to place it in one folder, I use the first one you posted:

    C:\Users\Username\AppData\Roaming\Corel\Graphics13\User CorelPHOTO-PAINT\GMS

    You will note I added GMS to the end of your address, just in case you were not aware it has to go in a folder named GMS. You may have to untick "Delay Load VBA" in Tools>Options>VBA to get it to work.

    Best regards,
    Brian.

  • In reply to Brian:

    Hi Brian,

    yes it's in the GSM folder. By copy and paste I lost the folder Wink

    "Delay Load VBA" is already unchecked.

    I tried to read the Macro in VB-Editor but BDShowrulers is password protected.

    But thanks at all.

    Best regards,

    weinberger

  • In reply to weinberger:

    Oops, sorry about that. This is the code it contains:

    Private Sub GlobalMacroStorage_NewDocument(ByVal Document As IPaintDocument)
        ActiveDocument.ActiveWindow.RulersVisible = True

    End Sub

    Private Sub GlobalMacroStorage_OpenDocument(ByVal Document As IPaintDocument)
        ActiveDocument.ActiveWindow.RulersVisible = True
           
    End Sub

    Private Sub GlobalMacroStorage_Start()
        ActiveDocument.ActiveWindow.RulersVisible = True
       
    End Sub

    I can't remember why I did the 3rd Sub.

  • In reply to weinberger:

    weinberger
    great, thanks to twieker

    both are working. isn't that a bug? is this resolved with service pack patches?


    The bug is still in X5, so no it isn't fixed ..

    weinberger
    1. now I need to macro/record the zoom to 100%. how to?

    I created  a dead simple VBA macro:

    Sub Invert()

    z = ActiveWindow.Zoom
    ActiveWindow.Zoom = 100

    With CorelScript
        .BitmapEffect "Invert", "InvertEffect "
    End With

    ActiveWindow.Zoom = z
    End Sub

    I've attached it, but I'm not sure it will work in the German version?
    (You may have to replace the one line with the German one from your script).

     

    invert.gms
  • In reply to weinberger:

    Hi Weinberger,

    I do have one question for you. Is inverting the image just one part of a multifunctional macro, or are you only making a macro to invert the image? If you are only making a macro to invert the image, then why not simply place a shortcut button on one of your toolbars? Tools>Customization>Commands>Image

    Best regards,
    Brian.

  • In reply to Brian:

    Normal 0 21 false false false DE-AT X-NONE X-NONE MicrosoftInternetExplorer4

    @twieker:

    thanks for the macro. I will try it soon and will let you know if it works. But it's a pity that this bug still exists, two versions later.

    @brian:

    I do have placed the invert button in the toolbar. But the macro is a multifunctional one and I do have to change several files and I am using batch processing.

    I am very thankful for all your help.

    Three different things:

    As we are already in contact I place my question here, altough it belongs to Corel Draw and I attached the file mentioned below. Or shall I post it in the appropriate forum?

    1. I am having trouble in corel draw exporting/converting a cdr file to a tif file. The page settings are setup to A4 210x297mm. But in exporting to a tif only the dimensions of the image are converted. When I'm adding the picture frame the page will be converted as page settings are but it converts the frame too.
    2. Same process: converting cdr to tif. When exporting to b/w tif I am losing a graphic.
    3.  In the Reply-Windows in this forum I only can write doublespaced when pressing the enter key. It looks like you are able to write singlespaced. Maybe it's a problem with Firefox.

    Anywasy, thanks again in advance.

    Best wishes,

    weinberger

    Punkterl_Titel_EURO-MUSIC.cdr
  • In reply to weinberger:

    Hi Weinberger,

    I am not quite sure if I am understanding you correctly. I am interpreting what you are saying to mean you want to export the whole page so that you get all the graphics, plus a white background the size of the A4 page? I am then assuming when you said "adding a picture frame" you meant you are creating a rectangle the size of the page? If I have interpreted you correctly, here are my responses to your 3 questions:

    1. All you need to do is double-click the rectangle tool to create a rectangle the size of the page and give it no outline and no fill. Select all before you export and you will get the A4 sized image.
    2. Black and White is NOT greyscale. Everything in the exported image will be black or white and nothing in between. Your disappearing shape is not being deleted, it is actually being turned white which does not show against the white background. On exporting CorelDraw has a threshold where everything from that lightness level upwards will become white, everything darker than the threshold will become black. If you want your image to appear exactly as it does in the CorelDraw file then choose "Greyscale" instead of "Black and White". If you specifically want to have black and white for file size reasons, or whatever, then change the colour values of that particular shape from 0,0,0,50 to say 0,0,0,60. Please note that it will become BLACK in the resulting black and white tif.
    3. In the reply window in the forums it is normal to drop 2 lines when you hit enter. Press Shift+Enter to move down one line only.

    Best regards,
    Brian.