![]() |
|
#1
|
|||
|
|||
|
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... |
|
#2
|
||||
|
||||
|
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
-Shelby |
|
#3
|
|||
|
|||
|
thank you, it works fine
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |