![]() |
![]() |
PatternCanvas.Pixel
Property Pixel(x As Long, y As Long) As Boolean
Member of PatternCanvas
The Pixel property returns or sets the color of a pixel in a bitmap pattern. If set to True, the pixel represents black. If set to False, the pixel represents white.
This property is equivalent to the Visual Basic PSet command, for changing and reading pixel colors.
The following code example inverts an existing bitmap pattern and applies both the inverted pattern and the original pattern to a rectangle.
Sub Test() Dim c As New PatternCanvas Dim x As Long, y As Long c.PutCopy PatternCanvases(8) For x = 0 To c.Width - 1 For y = 0 To c.Height - 1 c.Pixel(x, y) = Not c.Pixel(x, y) Next y Next x With ActiveLayer.CreateRectangle(0, 0, 3, 3) .Fill.ApplyPatternFill cdrTwoColorPattern, , 8 End With With ActiveLayer.CreateRectangle(3, 0, 6, 3) .Fill.ApplyPatternFill cdrTwoColorPattern .Fill.Pattern.Canvas = c End With End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.