Brush c как задать цвет
Перейти к содержимому

Brush c как задать цвет

  • автор:

Задание цвета в массиве Brush

Подскажите, как в массиве Brush задавать цвета элементам массива.

2 ответа

01 сентября 2012 года
763 / / 24.05.2012
foreach ( SolidBrush brush in brushArray )
brush . Color = Color . Red ;

Простой Brush ты создать не смог бы, это абстрактный класс. Все остальные браши, кстати, можно инициализировать цветом в конструкторе при создании.

02 сентября 2012 года
64 / / 23.03.2012

Здравствуйте, CassandraDied!
К сожалению, такой код не работает. Компиллятор его пропускает, а дебуггер программу прерывает.

How to change a brush’s color

As shown above, the reason I don’t want to use CreateSolidBrush and DeleteObject again and again, is that it is slow and I need to be able to change the color of the brush quickly. I have found SetDCBrushColor . Which can change the color of the selected brush? But doesn’t seem to change my brush even after selecting it to the context. That’s why I’m wondering if there is any alternative to SetDCBrushColor . So that I can use my brush in FillRect . Any help is greatly appreciated. Thanks in advance.

C# как изменить цвет фигуры

А тут нужно как то изменить цвет фигуры с красного на желтый:

private void Timer1_Tick(object sender, EventArgs e) < label1.Text = Convert.ToString(color); sec++; // секунды speed = f2.NumberSpeed; rc = new Rectangle(x, y, w, h); this.Invalidate(rc, true); if (flag == STATUS.Left) < x -= speed; y -= speed; >if (flag == STATUS.Right) < x += speed; y += speed; >if (x >= (this.ClientSize.Width - w)) < flag = STATUS.Left; >else if (x rc = new Rectangle(x, y, w, h); this.Invalidate(rc, true); > 

Именно в этой части:

if (flag == STATUS.Left)

Подскажите как это сделать.

Brushes

Did you know that you can use your iPad, iPhone, or Android device to design beautiful, high-quality brushes from photos of anything that inspires you? Save the brushes to your Creative Cloud Library and access them anywhere across Photoshop and Illustrator!

About brushes

Brushes let you stylize the appearance of paths. You can apply brush strokes to existing paths, or you can use the Paintbrush tool to draw a path and apply a brush stroke simultaneously.

There are different types of brushes in Illustrator: calligraphic, scatter, art, pattern, and bristle. You can achieve the following effects using these brushes:

Create strokes that resemble those drawn with the angled point of a calligraphic pen and are drawn along the center of the path. When you use the Blob Brush tool, you can paint with a calligraphic brush and automatically expand the brush stroke into a fill shape that merges with other filled objects of the same color that intersect or are adjacent in stacking order.

Disperse copies of an object (such as a ladybug or a leaf) along the path.

Stretch a brush shape (such as Rough Charcoal) or object shape evenly along the length of the path.

Create brush strokes with the appearance of a natural brush with bristles.

Paint a pattern—made of individual tiles—that repeats along the path. Pattern brushes can include up to five tiles, for the sides, inner corner, outer corner, beginning, and end of the pattern.

Brush types

A. Calligraphic Brush B. Scatter Brush C. Art Brush D. Pattern Brush E. Bristle Brush

Scatter brushes and Pattern brushes can often achieve the same effect. However, one way in which they differ is that Pattern brushes follow the path exactly, while Scatter brushes do not.

Arrows in a Pattern brush

Brushes panel overview

The Brushes panel (Window > Brushes) displays brushes for the current file. Whenever you select a brush in a brush library, it is automatically added to the Brushes panel. Brushes that you create and store in the Brushes panel are associated only with the current file, which means that each Illustrator file can have a different set of brushes in its Brushes panel.

Show or hide a type of brush

Choose any of the following from the panel menu: Show Calligraphic Brushes, Show Scatter Brushes, Show Art Brushes, Show Bristle Brushes, Show Pattern Brushes.

Change the view of brushes

Choose Thumbnail View or List View from the panel menu.

Change the order of brushes in the Brushes panel

Drag a brush to a new location. You can move brushes only within their type. For example, you cannot move a Calligraphic brush to the Scatter brush area.

Duplicate a brush in the Brushes panel

Drag the brush onto the New Brush button or choose Duplicate Brush from the Brushes panel menu.

Delete the brushes from the Brushes panel

Select the brushes and click the Delete Brush button . You can select brushes that aren’t used in a document by choosing Select All Unused from the Brushes panel menu.

Work with brush libraries

Brush libraries (Window > Brush Libraries > [library]) are collections of preset brushes that come with Illustrator. You can open multiple brush libraries to browse through their contents and select brushes. You can also open brush libraries using the Brushes panel menu.

To automatically open a brush library when you start Illustrator, choose Persistent from the brush library’s panel menu.

Copy brushes from a brush library to the Brushes panel

Drag the brushes to the Brushes panel or choose Add To Brushes from the brush library’s panel menu.

Import brushes into the Brushes panel from another file

Choose Window > Brushes Libraries > Other Library and select the file.

In the Brush Library panel, click on the individual brush definition or all the brush definitions that you need to import and select Add To Brushes from the Brush Library panel menu (flyout menu).

Create new brush libraries

Add the brushes you want to the Brushes panel, and delete any brushes you don’t want.

Choose Save Brush Library from the Brushes panel menu, and place the new library file in one of the following folders so that it will appear in the Brush Libraries menu when you restart Illustrator:

  • (Windows) User/AppData/Roaming/Adobe/Adobe Illustrator < version number >Settings/Brushes
  • (Mac OS) Library/Application Support/Adobe/Adobe Illustrator < version number >Settings/Brushes
  • Replace with the following values, depending on the version of Illustrator that you have installed on your system. For more information, see Replace Illustrator version number .

If you place the file in a different folder, you can open the library by choosing Window > Brush Libraries > Other Library and selecting the library file.

Apply brush strokes

You can apply brush strokes to a path created with any drawing tool, including the Pen tool, Pencil tool, or basic shape tools.

Do one of the following:

  • Select the path, and then select a brush in a brush library, the Brushes panel, or the Control panel.
  • Drag a brush onto the path. If the path already has brush strokes applied to it, then the new brush replaces the old brush.

If you want to apply a different brush to the path and want to use the brush stroke settings used with the original brush, hold down Alt (Win) or Option (Mac OS) when clicking the new brush you want to apply.

Draw paths and apply brush strokes simultaneously

Select a brush in a brush library or the Brushes panel.

Select the Paintbrush tool .

Position the pointer where you want the brush stroke to begin, and drag to draw a path. A dotted line follows the pointer as you drag.

Do one of the following:

  • To draw an open path, release the mouse button when the path is the desired shape.
  • To draw a closed shape, hold down Alt (Windows) or Option (Mac OS) as you drag. The Paintbrush tool displays a small loop . Release the mouse button (but not the Alt or Option key) when you are ready to close the shape. Illustrator sets down anchor points as you draw. The number of anchor points is determined by the length and complexity of the path and by the Paintbrush tolerance settings. Tip: To adjust the shape of a brushed path after you finish drawing it, first select the path. Then position the Paintbrush tool on the path, and drag until the path is the desired shape. You can use the technique to extend a brushed path as well as change the shape of the path between the existing end points.

Paintbrush tool options

Double-click the Paintbrush tool to set the following options:

Controls how far you have to move your mouse or stylus before Illustrator adds a new anchor point to the path. For example, a Fidelity value of 2.5 means that tool movements of less than 2.5 pixels aren’t registered. Fidelity can range from 0.5 to 20 pixels; the higher the value, the smoother and less complex the path.

Controls the amount of smoothing that Illustrator applies when you use the tool. Smoothness can range from 0% to 100%; the higher the percentage, the smoother the path.

Fill New Brush Strokes

Applies a fill to the path. This option is most useful when drawing closed paths.

Determines whether Illustrator keeps the path selected after you draw it.

Edit Selected Paths

Determines whether you can change an existing path with the Paintbrush tool.

Within: _ pixels

Determines how close your mouse or stylus must be to an existing path to edit the path with the Paintbrush tool. This option is only available when the Edit Selected Paths option is selected.

Remove brush strokes

Select a brushed path.

In the Brushes panel, choose Remove Brush Stroke from the panel menu or click the Remove Brush Stroke button .

You can also remove a brush stroke by selecting the Basic brush from the Brushes panel or Control panel.

Convert brush strokes to outlines

You can convert brush strokes into outlined paths to edit the individual components of a brushed path.

Select a brushed path.
Choose Object > Expand Appearance.

Illustrator places the components of the expanded path in a group. Within the group are a path and a subgroup containing the brush stoke outlines.

Create or modify brushes

You can create and customize calligraphic, scatter, art, pattern, and bristle brushes depending on your requirement. For scatter, art, and pattern brushes, you must first create the artwork.

Follow these guidelines when creating artwork for brushes:

  • The artwork cannot contain gradients, blends, other brush strokes, mesh objects, bitmap images, graphs, placed files, or masks.
  • For art and pattern brushes, the artwork cannot contain type. To achieve a brush-stroke effect with type, create an outline of the type and then create a brush with the outline.
  • For pattern brushes, create up to five pattern tiles (depending on the brush configuration), and add the tiles to the Swatches panel.

You can make the brushes you create available for every new document by adding the brush definition to the New Document Profile. For more information on new document profiles, see About new document profiles.

Create a brush

For scatter and art brushes, select the artwork you want to use. For pattern brushes, you can select the artwork for the side tile, but it isn’t necessary. For detailed guidelines to create pattern brushes, see Guidelines for constructing pattern tiles. To know more about pattern brush options, see Pattern brush options.

Click the New Brush button in the Brushes panel. Alternatively, drag the selected artwork to the Brushes panel.

Select the type of brush you want to create, and click OK.
In the Brush Options dialog box, enter a name for the brush, set brush options, and click OK.

If you do not want to see a seam between the artwork pieces used to create the pattern brush, turn off the Anti-Aliasing option from Edit > Preferences > General (Windows) or Illustrator > General > Preferences (Mac OS).

Modify a brush

  • To change the options for a brush, double-click the brush in the Brushes panel. Set the brush options and click OK. If the current document contains brushed paths that use the modified brush, a message appears. Click Apply To Strokes to change pre-existing strokes. Click Leave Strokes to leave pre-existing strokes unchanged, and apply the modified brush to new strokes only.
  • To change the artwork used by a scatter, art, or pattern brush, drag the brush into your artwork and make the changes you want. Then Alt‑drag (Windows) or Option-drag (Mac OS) the modified brush onto the original brush in the Brushes panel.
  • To modify a brushed path without updating the corresponding brush, select the path and click the Options Of Selected Object button in the Brushes panel or select options of selected object from the Brushes panel menu (flyout menu).

Brush options

You can specify different options for the different types of brushes. To change the options for a brush, double-click the brush in the Brushes panel.

Scatter, Art, and Pattern brushes all have identical options for colorization.

To customize a stroke instance for Art Brushes or Pattern Brushes, click the Options of Selected Objects icon in the Brushes Panel and set the stroke options. For art brush you can set the stroke width along with flipping, colorization, and overlapping options. For pattern brush, you can set the scaling options along with flipping, fitting, and colorization options.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *