OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-10-2011, 05:48
brujitacastiza
Guest
 
Posts: n/a
Default cdrTwoColorPattern by code

Hi,

I have a problem with this.

I export some image as pcx and I can use it as a 2 colors fill, but using the Corel dialog box, and I want to use it by code.

Anyone know how to take the pcx file and insert it in this code ??

Dim b As String

ActiveSelection.Fill.ApplyPatternFill cdrTwoColorPattern, b, 0, CreateRGBColor(0, 120, 120), CreateRGBColor(50, 50, 50), False

I´ve tried to read it as a text, but it fail ...

Open file.pcx For Input As #1
Line Input #1, b
Close #1

I think I need to convert it to a correct string.... thank you...
Reply With Quote
  #2  
Old 11-10-2011, 14:07
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 TwoColorPattern

Instead of trying to read the file, you need to load it. Something like this:
Code:
Sub MyTwoColorFill()
    Dim s As Shape
    Dim pf As PatternFill
    
    Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5)
    Set pf = s.Fill.ApplyPatternFill(cdrTwoColorPattern)
    With pf
        .Load "D:\Temp\Tile.pcx"
        .FrontColor = CreateRGBColor(0, 120, 120)
        .BackColor = CreateRGBColor(50, 50, 50)
        .TransformWithShape = False
    End With
End Sub
Hope that helps,

-Shelby
Reply With Quote
  #3  
Old 08-03-2012, 08:38
brujitacastiza
Guest
 
Posts: n/a
Default

thank you, it works fine
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
Please revise my code beczukdavid Code Critique 3 02-07-2009 00:15
[useful code] wOxxOm CorelDRAW/Corel DESIGNER VBA 0 19-12-2007 15:00
[useful code] sortDelimitedText wOxxOm CorelDRAW/Corel DESIGNER VBA 0 19-12-2007 14:51
v11 code in v13 diwin CorelDRAW/Corel DESIGNER VBA 5 26-06-2007 18:43
Why does this code run so slow? Webster CorelDRAW/Corel DESIGNER VBA 3 20-03-2007 05:18


All times are GMT -5. The time now is 17:09.


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