Home
> Uncategorized > Print an Image using #Xamarin.mac
Print an Image using #Xamarin.mac
Printing an image using Xamarin turned out to be much easier than I thought, I loaded the image from a URL into an NSImageCell using;
string strUrl = “http;// Some Url with an image“; // ?
NSUrl url = new NSUrl (strUrl);
this.imgCell.Image = new NSImage (url);
Then to print it, I used the command;
partial void printButton (Foundation.NSObject sender) {
NSPrintOperation p = NSPrintOperation.FromView(this.imgCell.ControlView);
p.RunOperation();
}
Really surprised how easy that turned out to be!
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback