How to use System.Drawing.Color?

Yesterday I ran into a problem. I want to use the System.Drawing.Color structure in Android and iOS projects. The Xamarin documentation claims that the MonoTouch structure has a System.Drawing.Color structure (link - http://iosapi.xamarin.com/?link=T:System.Drawing.Color ). But in the monotouch.dll namespace, System.Drawing does not have a structure named Color. enter image description here

What have I done wrong?

+6
source share
2 answers

Add a link to the OpenTK library and you will have System.Drawing.Color . The document you specified indicated:

doc screenshot

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

+9
source

It clearly states "System.Drawing.Color Structure", i.e. no namespace. This means that you cannot do something like "using System.Drawing.Color;" in C #.

For all your color needs in iOS, you need to use MonoTouch.UIKit.UIColor , the type that MonoTouch uses in most cases (for example, all UIKit APIs).

I'm not sure about Android, but I think you need to use Android.Graphics.Color

0
source

Source: https://habr.com/ru/post/956534/


All Articles