How convert Drawing.Color to Drawing.Brush, Windows Forms

Romo Daneghyan

How to Convert from 'System.Drawing.Color' to 'System.Drawing.Brush' ?

This cast does not work.

(Brush)colorDialog1.Color;

I have a color dialog, and I need to pick the color from it and use as Brush color

C.Evenhuis

You have to choose a specific type of Brush, most common is SolidBrush:

using (Brush brush = new SolidBrush(colorDialog1.Color))
{
    // perform operations
}

See http://msdn.microsoft.com/en-us/library/aa983677(v=vs.71).aspx for a list of available brushes.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

C# how to convert system.windows.media.brush to system.drawing.brush

From Dev

How to show drawing brush as a Menu item Icon

From Dev

Drawing soft brush

From Dev

Drawing soft brush

From Dev

Windows Forms Drawing Inefficiency - C#

From Dev

How brush convert to color (UWP)?

From Dev

How to convert from System.Drawing.Color to Excel.ColorFormat in C#? Change comment color

From Dev

Drawing a line with a pixmap brush in Qt?

From Dev

Convert GTK# Color to System.Drawing.Color

From Dev

How to use System.Drawing.Color?

From Dev

Background color for drawing CIImage

From Dev

Cannot implicitly convert type string to System.Drawing.Color

From Dev

Drawing concentric circle in c# windows forms application

From Dev

JavaScriptSerializer is not deserializing System.Drawing.Color. How to deserialize Color object?

From Dev

Texture Brush (Drawing Application ) Using Metal

From Dev

Drawing squares on windows form

From Dev

XFCE windows drawing buggy

From Dev

XFCE windows drawing buggy

From Dev

How to change UIPopoverPresentationController's arrow color without drawing my own

From Dev

How can i change the color of my lines in drawing GUI

From Dev

Changing the drawing color using Xlib

From Dev

Drawing a rectangle but the color of the pen will not work

From Dev

Changing color of the drawing figure with Jbutton

From Dev

How to Convert Text With Attributes Directly Into a CIImage (Without Drawing to Screen)

From Dev

How to drawing a shapes in QtextEdit

From Dev

How to drawing on JFrame

From Dev

Drawing Windows Form inside Window

From Dev

Drawing by Windows GDI inside of Qt

From Dev

Drawing Windows Form inside Window

Related Related

HotTag

Archive