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 04-06-2013, 22:27
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default X6 Export PNG with transparent background

I set the exportfilter to include transparency but I'm getting a black background and if I open the resulting png in Corel Paint there is no object or mask. How can I get a PNG with a transparent background. Thanks:

Code:
   
    FilePth = "D:\"
    strName = "test.png"

    Dim expfltPNG As ExportFilter

    
    Set expfltPNG = ActiveDocument.ExportBitmap(FilePth + strName, cdrPNG, cdrSelection, cdrPalettedImage, 1000, 1000, _
    300, 300, cdrNormalAntiAliasing, True, True, False, False, cdrCompressionNone)
    
     With expfltPNG
        .Interlaced = True
        .InvertMask = False
        .ColorIndex = 1
        .Finish
    End With
    
    Set expfltPNG = Nothing
Reply With Quote
  #2  
Old 05-06-2013, 18:40
shelbym's Avatar
shelbym shelbym is online now
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Png

This is working for me with X6. Have a small sample file you would like to attached and I can verify against it.

-Shelby
Reply With Quote
  #3  
Old 05-06-2013, 21:26
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks Shelby, which version of X6 are you using? I'm using the original version with no service packs. As for a sample, just draw an elipse. If I export it by hand I get transparency and no black background, but using the code fails.
Reply With Quote
  #4  
Old 07-06-2013, 19:02
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Here are two files that show the difference between exporting by hand and using the code.:
Attached Images
  
Reply With Quote
  #5  
Old 08-06-2013, 11:56
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default SP's

Quote:
Originally Posted by knowbodynow View Post
Thanks Shelby, which version of X6 are you using? I'm using the original version with no service packs. As for a sample, just draw an elipse. If I export it by hand I get transparency and no black background, but using the code fails.
Is there a reason you have not updated to any of the SP's? There were a couple of Methods depreciated in X6.1.

I too tried the macro and .ColorIndex failed, so I commented it out and changed the image type from Paletted to RGB (It worked with Paletted as well) and it exports fine with Transparency.
Reply With Quote
  #6  
Old 08-06-2013, 14:06
shelbym's Avatar
shelbym shelbym is online now
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Png

I was testing with X6 64-bit Update 1 (16.1.0.843)

-Shelby
Reply With Quote
  #7  
Old 08-06-2013, 23:34
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks, Steve, the changes you suggested worked. I'm avoiding updating Corel products because I don't agree with the new membership scheme and particularly dislike having to accept a new terms of service agreement in order to update. Like Foster Coburn there are several terms I don't want to agree to. I might have reached the end of the line with Corel unless they change their approach - not likely I'm sure.
Reply With Quote
  #8  
Old 10-06-2013, 17:01
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default ...

Quote:
Originally Posted by knowbodynow View Post
Thanks, Steve, the changes you suggested worked. I'm avoiding updating Corel products because I don't agree with the new membership scheme and particularly dislike having to accept a new terms of service agreement in order to update. Like Foster Coburn there are several terms I don't want to agree to. I might have reached the end of the line with Corel unless they change their approach - not likely I'm sure.
Glad I could be of help. There are some parts of the terms of service I don't care for much, myself, but I must use CorelDRAW to make a living so am just dealing with them. You know they really haven't changed that much from earlier versions and have you looked at the Adobe CC legals?

It will take more than that to kick me off Corel's bandwagon.
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
Export Transparent PNG File? katruax CorelDRAW/Corel DESIGNER VBA 1 24-05-2012 14:04
Transparent Gifs knowbodynow CorelDRAW/Corel DESIGNER VBA 9 21-05-2008 23:06
Transparent Background David Williams General 0 27-03-2007 11:21
Background to object Fine! But Object to Background - How? marian General 2 15-07-2005 04:51
Exporting Transparent GIFs RobC CorelDRAW/Corel DESIGNER VBA 5 14-01-2004 15:31


All times are GMT -5. The time now is 12:56.


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