public void DrawRectangle(Rect frame, Size corner, Pen pen = null, Brush brush = null) { if (pen == null && brush == null) { return; } DrawElement(() => { if (corner.Width > 0 || corner.Height > 0) { AddRoundedRect(Conversions.GetCGRect(frame), Conversions.GetCGSize(corner)); } else { context.AddRect(Conversions.GetCGRect(frame)); } return(frame); }, pen, brush); }
public static AppKit.NSImage GetNSImage(this IImage image) { var c = (CGImageImage)image; return(new AppKit.NSImage(c.Image, Conversions.GetCGSize(c.Size))); }