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.
What did I do wrong?
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.
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.
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.
Add a reference to the OpenTK
library and you'll have System.Drawing.Color
available. The doc you linked was indicating it:
To add a reference: double click on Reference
in your project, and under the **All* tab, select OpenTK,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With