Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Rectangle Duplicate Reference #63

Description

@KevinAble

Hello I am trying to use the Aforge library (also same problem in Accord ) to crop an image in xamarin that I took with the device camera, here is my code snippet
using Rectangle = System.Drawing.Rectangle;
using Image = System.Drawing.Image;

var mediaFile = await CrossMedia.Current.TakePhotoAsync(options);
Bitmap image = (Bitmap)Image.FromStream(mediaFile.GetStream());
Crop cropFilter = new Crop(Rectangle(170, 411, 1162, 723));
return cropFilter.Apply(image);

The problem is I am getting an ambiguous reference, I have no reference to system.drawing in my project

Severity Code Description Project File Line Suppression State
Error CS0433 The type 'Rectangle' exists in both
'Shim.Drawing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d03c0bc8d64dbc'
and
'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions