Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use System.Drawing.Color?

I've faced with problem yesterday. I want to use System.Drawing.Color structure in Android and iOS projects. Xamarin documentation claims that MonoTouch framework has System.Drawing.Color structure (link - http://iosapi.xamarin.com/?link=T:System.Drawing.Color). But in monotouch.dll namespace System.Drawing hasn't structure with name Color. enter image description here

What did I do wrong?

like image 891
Alexander Avatar asked Oct 23 '13 07:10

Alexander


People also ask

How to set System drawing color c#?

You could create a color using the static FromArgb method: Color redColor = Color. FromArgb(255, 0, 0); You can also specify the alpha using the following overload.

How to use color FromArgb in c#?

FromArgb(Int32, Int32, Int32) Creates a Color structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.

What is System drawing in C#?

The Graphics class provides methods for drawing to the display device. Classes such as Rectangle and Point encapsulate GDI+ primitives. The Pen class is used to draw lines and curves, while classes derived from the abstract class Brush are used to fill the interiors of shapes.


1 Answers

Add a reference to the OpenTK library and you'll have System.Drawing.Color available. The doc you linked was indicating it:

doc screenshot

To add a reference: double click on Reference in your project, and under the **All* tab, select OpenTK,

like image 71
Stephane Delcroix Avatar answered Oct 01 '22 18:10

Stephane Delcroix