本文整理汇总了C#中CGRect.GetMinY方法的典型用法代码示例。如果您正苦于以下问题:C# CGRect.GetMinY方法的具体用法?C# CGRect.GetMinY怎么用?C# CGRect.GetMinY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGRect
的用法示例。
在下文中一共展示了CGRect.GetMinY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawTimer
//// Drawing Methods
public static void DrawTimer(CGRect frame, float percentage)
{
var context = UIGraphics.GetCurrentContext();
var expression = 360.0f - percentage;
var coverViewPath = UIBezierPath.FromOval(new CGRect(frame.GetMinX() + 5.0f, frame.GetMinY() + 4.0f, 230.0f, 230.0f));
DemoStyleKit.Purple.SetFill();
coverViewPath.Fill();
context.SaveState();
context.TranslateCTM(frame.GetMinX() + 120.0f, frame.GetMinY() + 119.0f);
context.RotateCTM(-90.0f * NMath.PI / 180.0f);
var completedViewRect = new CGRect(-115.0f, -115.0f, 230.0f, 230.0f);
var completedViewPath = new UIBezierPath();
completedViewPath.AddArc(new CGPoint(completedViewRect.GetMidX(), completedViewRect.GetMidY()), completedViewRect.Width / 2.0f, (nfloat)(-360.0f * NMath.PI/180), (nfloat)(-expression * NMath.PI/180.0f), true);
completedViewPath.AddLineTo(new CGPoint(completedViewRect.GetMidX(), completedViewRect.GetMidY()));
completedViewPath.ClosePath();
DemoStyleKit.Green.SetFill();
completedViewPath.Fill();
context.RestoreState();
var backgroundViewPath = UIBezierPath.FromOval(new CGRect(frame.GetMinX() + 10.0f, frame.GetMinY() + 9.0f, 220.0f, 220.0f));
DemoStyleKit.Purple.SetFill();
backgroundViewPath.Fill();
}
示例2: Draw
public override void Draw(CGRect frame)
{
//// General Declarations
var context = UIGraphics.GetCurrentContext();
//// Rectangle Drawing
var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX() + 14.0f, frame.GetMinY() + 2.0f, NMath.Floor((frame.Width - 14.0f) * 0.20776f + 0.5f), 21.0f), UIRectCorner.TopLeft | UIRectCorner.TopRight, new SizeF(4.0f, 4.0f));
rectanglePath.ClosePath();
Helpers.Colours.Green.SetFill();
rectanglePath.Fill();
//// Rectangle 2 Drawing
var rectangle2Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX(), frame.GetMinY() + 23.0f, 375.0f, 1.0f));
Helpers.Colours.Green.SetFill();
rectangle2Path.Fill();
//// Text Drawing
CGRect textRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.03733f + 0.5f), frame.GetMinY() + 3.0f, NMath.Floor(frame.Width * 0.23733f + 0.5f) - NMath.Floor(frame.Width * 0.03733f + 0.5f), 21.0f);
UIColor.White.SetFill();
var textStyle = new NSMutableParagraphStyle();
textStyle.Alignment = UITextAlignment.Center;
var textFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Medium", UIFont.SmallSystemFontSize), ForegroundColor = UIColor.White, ParagraphStyle = textStyle };
var textTextHeight = new NSString(header).GetBoundingRect(new CGSize(textRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, textFontAttributes, null).Height;
context.SaveState();
context.ClipToRect(textRect);
new NSString(header).DrawString(new CGRect(textRect.GetMinX(), textRect.GetMinY() + (textRect.Height - textTextHeight) / 2.0f, textRect.Width, textTextHeight), UIFont.FromName("Avenir-Medium", UIFont.SmallSystemFontSize), UILineBreakMode.WordWrap, UITextAlignment.Center);
context.RestoreState();
}
示例3: Draw
public override void Draw(CGRect rect)
{
base.Draw(rect);
if (BorderWidthAll > 0)
{
BorderWidth = new UIEdgeInsets(BorderWidthAll, BorderWidthAll, BorderWidthAll, BorderWidthAll);
}
if (BorderColorAll != null)
{
BorderColorTop = BorderColorBottom = BorderColorLeft = BorderColorRight = BorderColorAll;
}
var xMin = rect.GetMinX();
var xMax = rect.GetMaxX();
var yMin = rect.GetMinY();
var yMax = rect.GetMaxY();
var fWidth = this.Frame.Size.Width;
var fHeight = this.Frame.Size.Height;
var context = UIGraphics.GetCurrentContext();
if (context != null)
DrawBorders(context, xMin, xMax, yMin, yMax, fWidth, fHeight);
}
示例4: Draw
//Generated with PaintCode 2.2
public override void Draw(CGRect rect)
{
base.Draw(rect);
// General Declarations
var colorSpace = CGColorSpace.CreateDeviceRGB();
var context = UIGraphics.GetCurrentContext();
// Color Declarations
var darkBlue = UIColor.FromRGBA(0.053f, 0.123f, 0.198f, 1.000f);
var lightBlue = UIColor.FromRGBA(0.191f, 0.619f, 0.845f, 1.000f);
// Gradient Declarations
var backgroundGradientColors = new CGColor [] {lightBlue.CGColor, darkBlue.CGColor};
var backgroundGradientLocations = new nfloat [] {0.0f, 1.0f};
var backgroundGradient = new CGGradient(colorSpace, backgroundGradientColors, backgroundGradientLocations);
// Rectangle Drawing
var rectangleRect = new CGRect(rect.GetMinX() + (float)Math.Floor(rect.Width * -0.12917f + 0.5f), rect.GetMinY() + (float)Math.Floor(rect.Height * 0.00000f + 0.5f), (float)Math.Floor(rect.Width * 1.00000f + 0.5f) - (float)Math.Floor(rect.Width * -0.12917f + 0.5f), (float)Math.Floor(rect.Height * 1.00000f + 0.5f) - (float)Math.Floor(rect.Height * 0.00000f + 0.5f));
var rectanglePath = UIBezierPath.FromRect(rectangleRect);
context.SaveState();
rectanglePath.AddClip();
context.DrawLinearGradient(backgroundGradient,
new PointF((float)rectangleRect.GetMidX(), (float)rectangleRect.GetMinY()),
new PointF((float)rectangleRect.GetMidX(), (float)rectangleRect.GetMaxY()),
0);
context.RestoreState();
}
示例5: Draw
public override void Draw(CGRect frame)
{
// General Declarations
var context = UIGraphics.GetCurrentContext();
// Color Declarations
var color4 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f);
var color5 = UIColor.FromRGBA(0.793f, 0.793f, 0.793f, 1.000f);
// Shadow Declarations
var shadow = new NSShadow();
shadow.ShadowColor = UIColor.Black.ColorWithAlpha(0.28f);
shadow.ShadowOffset = new CGSize(3.1f, 3.1f);
shadow.ShadowBlurRadius = 5.0f;
// Rectangle Drawing
var rectanglePath =
UIBezierPath.FromRoundedRect(
new CGRect(frame.GetMinX() + 10.5f, frame.GetMinY() + 7.5f, frame.Width - 20.0f, 76.0f), 4.0f);
context.SaveState();
context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, shadow.ShadowColor.CGColor);
color4.SetFill();
rectanglePath.Fill();
context.RestoreState();
color5.SetStroke();
rectanglePath.LineWidth = 1.0f;
rectanglePath.Stroke();
// Bezier 2 Drawing
var bezier2Path = new UIBezierPath();
bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 0.02386f*frame.Width,
frame.GetMinY() + 0.50543f*frame.Height));
bezier2Path.AddLineTo(new CGPoint(frame.GetMinX() + 0.97841f*frame.Width,
frame.GetMinY() + 0.50543f*frame.Height));
context.SaveState();
context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, shadow.ShadowColor.CGColor);
color4.SetFill();
bezier2Path.Fill();
context.RestoreState();
color5.SetStroke();
bezier2Path.LineWidth = 1.0f;
bezier2Path.Stroke();
}
示例6: Draw
public override void Draw(CGRect frame)
{
//base.Draw(frame);
Initialize();
var rectanglePath = UIBezierPath.FromRect(new CGRect(frame.GetMinX() + (float)Math.Floor(frame.Width * 0.00000f + 0.5f), frame.GetMinY() + (float)Math.Floor(frame.Height * 0.00000f + 0.5f), (float)Math.Floor(frame.Width * 1.00000f + 0.5f) - (float)Math.Floor(frame.Width * 0.00000f + 0.5f), (float)Math.Floor(frame.Height * 1.00000f + 0.5f) - (float)Math.Floor(frame.Height * 0.00000f + 0.5f)));
_tmpCol.SetFill();
rectanglePath.Fill();
}
示例7: Draw
public override void Draw(CGRect frame)
{
var context = UIGraphics.GetCurrentContext();
var expression = 377.0f - percentage;
// coverView Drawing
var coverViewPath =
UIBezierPath.FromOval(new CGRect(frame.GetMinX() + 5.0f, frame.GetMinY() + 4.0f, frame.Width - 10.0f,
frame.Height - 10.0f));
UIColor.FromRGB(21, 169, 254).SetFill();
coverViewPath.Fill();
// completedView Drawing
context.SaveState();
context.SaveState();
context.TranslateCTM(frame.GetMaxX() - 65.0f, frame.GetMinY() + 64.0f);
context.RotateCTM(-90.0f*NMath.PI/180.0f);
var completedViewRect = new CGRect(-60.0f, -60.0f, 120.0f, 120.0f);
var completedViewPath = new UIBezierPath();
completedViewPath.AddArc(new CGPoint(completedViewRect.GetMidX(), completedViewRect.GetMidY()),
completedViewRect.Width/2.0f, -360.0f*NMath.PI/180,
-(expression - 17.0f)*NMath.PI/180.0f, true);
completedViewPath.AddLineTo(new CGPoint(completedViewRect.GetMidX(), completedViewRect.GetMidY()));
completedViewPath.ClosePath();
UIColor.FromRGB(247, 247, 247).SetFill();
completedViewPath.Fill();
context.RestoreState();
// backgroundView Drawing
var backgroundViewPath =
UIBezierPath.FromOval(new CGRect(frame.GetMinX() + 12.0f, frame.GetMinY() + 11.0f, frame.Width - 24.0f,
frame.Height - 24.0f));
UIColor.FromRGB(21, 169, 254).SetFill();
backgroundViewPath.Fill();
}
示例8: Draw
public override void Draw(CGRect rect)
{
using (var context = UIGraphics.GetCurrentContext ()) {
// get the scale from the context by getting the current transform matrix, then asking for
// its "a" component, which is one of the two scale components. We could also ask for "d".
// This assumes (safely) that the view is being scaled equally in both dimensions.
var scale = context.GetCTM ().xx;
CATiledLayer tiledLayer = (CATiledLayer)this.Layer;
var tileSize = tiledLayer.TileSize;
// Even at scales lower than 100%, we are drawing into a rect in the coordinate system of the full
// image. One tile at 50% covers the width (in original image coordinates) of two tiles at 100%.
// So at 50% we need to stretch our tiles to double the width and height; at 25% we need to stretch
// them to quadruple the width and height; and so on.
// (Note that this means that we are drawing very blurry images as the scale gets low. At 12.5%,
// our lowest scale, we are stretching about 6 small tiles to fill the entire original image area.
// But this is okay, because the big blurry image we're drawing here will be scaled way down before
// it is displayed.)
tileSize.Width /= scale;
tileSize.Height /= scale;
// calculate the rows and columns of tiles that intersect the rect we have been asked to draw
int firstCol = (int)Math.Floor (rect.GetMinX () / tileSize.Width);
int lastCol = (int)Math.Floor ((rect.GetMaxX () - 1) / tileSize.Width);
int firstRow = (int)Math.Floor (rect.GetMinY () / tileSize.Height);
int lastRow = (int)Math.Floor ((rect.GetMaxY () - 1) / tileSize.Height);
for (int row = firstRow; row <= lastRow; row++) {
for (int col = firstCol; col <= lastCol; col++) {
UIImage tile = TileForScale ((float)scale, row, col);
var tileRect = new CGRect (tileSize.Width * col, tileSize.Height * row, tileSize.Width, tileSize.Height);
// if the tile would stick outside of our bounds, we need to truncate it so as to avoid
// stretching out the partial tiles at the right and bottom edges
tileRect.Intersect (this.Bounds);
tile.Draw (tileRect);
}
}
}
}
示例9: DrawUISwitch
//// Drawing Methods
public static void DrawUISwitch(bool inFocus, bool switchOn)
{
//// General Declarations
var context = UIGraphics.GetCurrentContext();
//// Shadow Declarations
var shadow = new NSShadow();
shadow.ShadowColor = CustomControlsStyleKit.ShadowColor;
shadow.ShadowOffset = new CGSize(0.1f, 5.1f);
shadow.ShadowBlurRadius = 5.0f;
//// Variable Declarations
var thumbHeight = inFocus ? 85.0f : 65.0f;
var thumbY = inFocus ? 6.0f : 16.0f;
var thumbColor = inFocus ? CustomControlsStyleKit.InFocusThumbColor : CustomControlsStyleKit.UnFocusedThumbColor;
var textColor = inFocus ? CustomControlsStyleKit.InFocusTextColor : CustomControlsStyleKit.UnFocusedTextColor;
var gutterColor = switchOn ? (inFocus ? CustomControlsStyleKit.OnColor : CustomControlsStyleKit.OnColorUnFocused) : (inFocus ? CustomControlsStyleKit.OffColor : CustomControlsStyleKit.OffColorUnFocused);
var thumbX = switchOn ? 147.0f : 11.0f;
var switchOff = !switchOn;
//// Gutter Drawing
var gutterPath = UIBezierPath.FromRoundedRect(new CGRect(11.0f, 16.0f, 227.0f, 67.0f), 4.0f);
gutterColor.SetFill();
gutterPath.Fill();
////// Gutter Inner Shadow
context.SaveState();
context.ClipToRect(gutterPath.Bounds);
context.SetShadow(new CGSize(0, 0), 0);
context.SetAlpha(shadow.ShadowColor.CGColor.Alpha);
context.BeginTransparencyLayer();
{
var opaqueShadow = new CGColor(shadow.ShadowColor.CGColor, 1.0f);
context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, opaqueShadow);
context.SetBlendMode(CGBlendMode.SourceOut);
context.BeginTransparencyLayer();
context.SetFillColor(opaqueShadow);
gutterPath.Fill();
context.EndTransparencyLayer();
}
context.EndTransparencyLayer();
context.RestoreState();
CustomControlsStyleKit.BorderColor.SetStroke();
gutterPath.LineWidth = 2.0f;
gutterPath.Stroke();
//// Rectangle Drawing
var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(thumbX, thumbY, 91.0f, thumbHeight), 4.0f);
context.SaveState();
context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, shadow.ShadowColor.CGColor);
thumbColor.SetFill();
rectanglePath.Fill();
context.RestoreState();
CustomControlsStyleKit.BorderColor.SetStroke();
rectanglePath.LineWidth = 2.0f;
rectanglePath.Stroke();
if (switchOn)
{
//// OnText Drawing
CGRect onTextRect = new CGRect(26.0f, 27.0f, 99.0f, 49.0f);
{
var textContent = "ON";
textColor.SetFill();
var onTextStyle = new NSMutableParagraphStyle ();
onTextStyle.Alignment = UITextAlignment.Center;
var onTextFontAttributes = new UIStringAttributes () {Font = UIFont.BoldSystemFontOfSize(27.0f), ForegroundColor = textColor, ParagraphStyle = onTextStyle};
var onTextTextHeight = new NSString(textContent).GetBoundingRect(new CGSize(onTextRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, onTextFontAttributes, null).Height+10;
context.SaveState();
context.ClipToRect(onTextRect);
new NSString(textContent).DrawString(new CGRect(onTextRect.GetMinX(), onTextRect.GetMinY() + (onTextRect.Height - onTextTextHeight) / 2.0f, onTextRect.Width, onTextTextHeight), UIFont.BoldSystemFontOfSize(27.0f), UILineBreakMode.WordWrap, UITextAlignment.Center);
context.RestoreState();
}
}
if (switchOff)
{
//// OffText Drawing
CGRect offTextRect = new CGRect(123.0f, 27.0f, 99.0f, 49.0f);
{
var textContent = "OFF";
textColor.SetFill();
var offTextStyle = new NSMutableParagraphStyle ();
offTextStyle.Alignment = UITextAlignment.Center;
var offTextFontAttributes = new UIStringAttributes () {Font = UIFont.BoldSystemFontOfSize(27.0f), ForegroundColor = textColor, ParagraphStyle = offTextStyle};
var offTextTextHeight = new NSString(textContent).GetBoundingRect(new CGSize(offTextRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, offTextFontAttributes, null).Height+10;
context.SaveState();
context.ClipToRect(offTextRect);
//.........这里部分代码省略.........
示例10: DrawUIControlWell
public static void DrawUIControlWell(CGRect frame, bool inFocus, string title)
{
//// General Declarations
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var wellColor = UIColor.FromRGBA(0.029f, 0.029f, 0.029f, 0.189f);
//// Variable Declarations
var textColor = inFocus ? CustomControlsStyleKit.InFocusTextColor : CustomControlsStyleKit.UnFocusedTextColor;
//// Background Drawing
var backgroundPath = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX() + 1.0f, frame.GetMinY() + 1.0f, NMath.Floor((frame.Width - 1.0f) * 0.99749f + 0.5f), NMath.Floor((frame.Height - 1.0f) * 0.98990f + 0.5f)), 4.0f);
wellColor.SetFill();
backgroundPath.Fill();
//// Text Drawing
CGRect textRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.03250f + 0.5f), frame.GetMinY() + NMath.Floor(frame.Height * 0.19000f + 0.5f), NMath.Floor(frame.Width * 0.97250f + 0.5f) - NMath.Floor(frame.Width * 0.03250f + 0.5f), NMath.Floor(frame.Height * 0.80000f + 0.5f) - NMath.Floor(frame.Height * 0.19000f + 0.5f));
textColor.SetFill();
var textStyle = new NSMutableParagraphStyle ();
textStyle.Alignment = UITextAlignment.Center;
var textFontAttributes = new UIStringAttributes () {Font = UIFont.BoldSystemFontOfSize(27.0f), ForegroundColor = textColor, ParagraphStyle = textStyle};
var textTextHeight = new NSString(title).GetBoundingRect(new CGSize(textRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, textFontAttributes, null).Height;
context.SaveState();
context.ClipToRect(textRect);
new NSString(title).DrawString(new CGRect(textRect.GetMinX(), textRect.GetMinY() + (textRect.Height - textTextHeight) / 2.0f, textRect.Width, textTextHeight), UIFont.BoldSystemFontOfSize(27.0f), UILineBreakMode.WordWrap, UITextAlignment.Center);
context.RestoreState();
}
示例11: Draw
public override void Draw(CGRect frame)
{
// General Declarations
var context = UIGraphics.GetCurrentContext();
// Color Declarations
var minimumTrackColor = UIColor.FromRGBA(0.502f, 0.812f, 0.769f, 1.000f);
var maximumTrackColor = UIColor.FromRGBA(0.314f, 0.314f, 0.314f, 1.000f);
var color = UIColor.FromRGBA(0.376f, 0.490f, 0.722f, 1.000f);
// Variable Declarations
var expression2 = percentage*2.0f;
var expression = new CGPoint(25.0f + expression2, 61.0f);
var expression3 = 200.0f - percentage*2.0f;
// Minimum Track Drawing
var minimumTrackPath =
UIBezierPath.FromRoundedRect(
new CGRect(frame.GetMinX(), frame.GetMinY() + 24.0f, frame.Width, frame.Height - 29.0f), 2.0f);
minimumTrackColor.SetFill();
minimumTrackPath.Fill();
// Maximum Track Drawing
context.SaveState();
context.TranslateCTM(frame.GetMinX() + 1.00000f*frame.Width, frame.GetMinY() + 0.85714f*frame.Height);
context.RotateCTM(-180.0f*NMath.PI/180.0f);
var maximumTrackPath = UIBezierPath.FromRoundedRect(new CGRect(0.0f, 0.0f, expression3, 6.0f),
UIRectCorner.TopLeft | UIRectCorner.BottomLeft, new CGSize(2.0f, 2.0f));
maximumTrackPath.ClosePath();
maximumTrackColor.SetFill();
maximumTrackPath.Fill();
context.RestoreState();
// Bezier Drawing
context.SaveState();
context.TranslateCTM(expression.X, expression.Y);
UIBezierPath bezierPath = new UIBezierPath();
bezierPath.MoveTo(new CGPoint(0.0f, 2.01f));
bezierPath.AddCurveToPoint(new CGPoint(2.6f, 0.0f), new CGPoint(0.0f, 0.9f), new CGPoint(1.17f, 0.0f));
bezierPath.AddLineTo(new CGPoint(10.4f, 0.0f));
bezierPath.AddCurveToPoint(new CGPoint(13.0f, 2.01f), new CGPoint(11.84f, 0.0f), new CGPoint(13.0f, 0.9f));
bezierPath.AddLineTo(new CGPoint(13.0f, 13.04f));
bezierPath.AddCurveToPoint(new CGPoint(11.29f, 16.56f), new CGPoint(13.0f, 14.15f),
new CGPoint(12.23f, 15.73f));
bezierPath.AddLineTo(new CGPoint(6.5f, 20.81f));
bezierPath.AddLineTo(new CGPoint(6.5f, 23.65f));
bezierPath.AddLineTo(new CGPoint(6.5f, 20.81f));
bezierPath.AddLineTo(new CGPoint(1.71f, 16.56f));
bezierPath.AddCurveToPoint(new CGPoint(0.0f, 13.04f), new CGPoint(0.76f, 15.73f), new CGPoint(0.0f, 14.15f));
bezierPath.AddLineTo(new CGPoint(0.0f, 2.01f));
bezierPath.ClosePath();
bezierPath.UsesEvenOddFillRule = true;
color.SetFill();
bezierPath.Fill();
UIColor.White.SetStroke();
bezierPath.LineWidth = 1.5f;
bezierPath.Stroke();
context.RestoreState();
}
示例12: DrawCanvas
void DrawCanvas(CGRect frame2)
{
//// General Declarations
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f);
var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f);
var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f);
//// Frames
CGRect frame = new CGRect(1.0f, 0.0f, 771.0f, 356.0f);
//// Subframes
CGRect group3 = new CGRect(frame.GetMinX(), frame.GetMinY(), frame.Width, frame.Height);
CGRect group5 = new CGRect(frame.GetMinX() + 3.0f, frame.GetMinY() + 3.0f, frame.Width - 7.0f, frame.Height - 7.0f);
//// Group 2
{
//// Group 3
{
context.SaveState();
context.BeginTransparencyLayer();
//// Clip Clip 2
UIBezierPath clip2Path = new UIBezierPath();
clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 1.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 1.00130f * group3.Width, group3.GetMinY() + 1.00000f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 1.00000f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height));
clip2Path.ClosePath();
clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height), new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06356f * group3.Height), new CGPoint(group3.GetMinX() + 0.03056f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height), new CGPoint(group3.GetMinX() + 0.97203f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height), new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.06356f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height), new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.93644f * group3.Height), new CGPoint(group3.GetMinX() + 0.97204f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height), new CGPoint(group3.GetMinX() + 0.03056f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height), new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.93644f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height));
clip2Path.ClosePath();
clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height), new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.93800f * group3.Height), new CGPoint(group3.GetMinX() + 0.02984f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height), new CGPoint(group3.GetMinX() + 0.97275f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height), new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.93799f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height), new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.06200f * group3.Height), new CGPoint(group3.GetMinX() + 0.97275f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height));
clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height));
clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height), new CGPoint(group3.GetMinX() + 0.02984f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height), new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06201f * group3.Height));
clip2Path.ClosePath();
clip2Path.UsesEvenOddFillRule = true;
clip2Path.AddClip();
//// Group 4
{
context.SaveState();
context.BeginTransparencyLayer();
//// Clip Clip
UIBezierPath clipPath = new UIBezierPath();
clipPath.MoveTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height));
clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + -0.00198f * group3.Height), new CGPoint(group3.GetMinX() + 0.00296f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height));
clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height));
clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height), new CGPoint(group3.GetMinX() + 0.94515f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + -0.00199f * group3.Height));
clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height));
clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.87276f * group3.Height), new CGPoint(group3.GetMinX() + 0.94516f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height));
clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height));
clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height), new CGPoint(group3.GetMinX() + 0.00297f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.87278f * group3.Height));
clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height));
clipPath.ClosePath();
clipPath.UsesEvenOddFillRule = true;
clipPath.AddClip();
//// Bezier Drawing
UIBezierPath bezierPath = new UIBezierPath();
bezierPath.MoveTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height));
bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + -0.00198f * group3.Height), new CGPoint(group3.GetMinX() + 0.00296f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height));
bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height));
bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height), new CGPoint(group3.GetMinX() + 0.94515f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + -0.00199f * group3.Height));
bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height));
bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.87276f * group3.Height), new CGPoint(group3.GetMinX() + 0.94516f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height));
bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height));
bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height), new CGPoint(group3.GetMinX() + 0.00297f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.87278f * group3.Height));
bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height));
bezierPath.ClosePath();
fillColor.SetFill();
bezierPath.Fill();
context.EndTransparencyLayer();
context.RestoreState();
}
//.........这里部分代码省略.........
示例13: DisplayPixelBuffer
public void DisplayPixelBuffer (CVPixelBuffer pixelBuffer)
{
DrawTextInCorner (pixelBuffer);
CVReturn error;
if (pixelBuffer != null) {
int frameWidth = (int)pixelBuffer.Width;
int frameHeight = (int)pixelBuffer.Height;
if (videoTextureCache == null) {
Console.WriteLine ("No video texture cache");
return;
}
CleanUpTextures ();
CVAttachmentMode attachmentMode;
var colorAttachments = pixelBuffer.GetAttachment <NSString> (CVImageBuffer.YCbCrMatrixKey, out attachmentMode);
if (colorAttachments == CVImageBuffer.YCbCrMatrix_ITU_R_601_4)
preferredConversion = colorConversion601;
else
preferredConversion = colorConversion709;
GL.ActiveTexture (TextureUnit.Texture0);
lumaTexture = videoTextureCache.TextureFromImage (pixelBuffer, true, All.RedExt, frameWidth, frameHeight,
All.RedExt, DataType.UnsignedByte, 0, out error);
if (lumaTexture == null)
Console.WriteLine ("Error at CVOpenGLESTextureCach.TextureFromImage");
GL.BindTexture (lumaTexture.Target, lumaTexture.Name);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)All.Linear);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)All.Linear);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)All.ClampToEdge);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)All.ClampToEdge);
GL.ActiveTexture (TextureUnit.Texture1);
chromaTexture = videoTextureCache.TextureFromImage (pixelBuffer, true, All.RgExt, frameWidth / 2, frameHeight / 2,
All.RgExt, DataType.UnsignedByte, 1, out error);
if (chromaTexture == null)
Console.WriteLine ("Error at CVOpenGLESTextureCach.TextureFromImage");
GL.BindTexture (chromaTexture.Target, chromaTexture.Name);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)All.Linear);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)All.Linear);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)All.ClampToEdge);
GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)All.ClampToEdge);
GL.BindFramebuffer (FramebufferTarget.Framebuffer, frameBufferHandle);
GL.Viewport (0, 0, backingWidth, backingHeight);
}
GL.ClearColor (0f, 0f, 0f, 1f);
GL.Clear (ClearBufferMask.ColorBufferBit);
GL.UseProgram (Program);
GL.Uniform1 (uniforms [(int)UniformIndex.RotationAngle], 0f);
GL.UniformMatrix3 (uniforms [(int)UniformIndex.ColorConversionMatrix], 1, false, preferredConversion);
CGRect vertexSamplingRect = AVUtilities.WithAspectRatio (Bounds, PresentationRect);
var normalizedSamplingSize = new CGSize (0f, 0f);
var cropScaleAmount = new CGSize (vertexSamplingRect.Width / Bounds.Width, vertexSamplingRect.Height / Bounds.Height);
if (cropScaleAmount.Width > cropScaleAmount.Height) {
normalizedSamplingSize.Width = 1f;
normalizedSamplingSize.Height = cropScaleAmount.Height / cropScaleAmount.Width;
} else {
normalizedSamplingSize.Width = 1f;
normalizedSamplingSize.Height = cropScaleAmount.Width / cropScaleAmount.Height;
}
float[] quadVertexData = {
-1f * (float)normalizedSamplingSize.Width, -1f * (float)normalizedSamplingSize.Height,
(float)normalizedSamplingSize.Width, -1f * (float)normalizedSamplingSize.Height,
-1f * (float)normalizedSamplingSize.Width, (float)normalizedSamplingSize.Height,
(float)normalizedSamplingSize.Width, (float)normalizedSamplingSize.Height,
};
GL.VertexAttribPointer ((int)AttributeIndex.Vertex, 2, VertexAttribPointerType.Float, false, 0, quadVertexData);
GL.EnableVertexAttribArray ((int)AttributeIndex.Vertex);
var textureSamplingRect = new CGRect (0, 0, 1, 1);
float[] quadTextureData = {
(float)textureSamplingRect.GetMinX (), (float)textureSamplingRect.GetMaxY (),
(float)textureSamplingRect.GetMaxX (), (float)textureSamplingRect.GetMaxY (),
(float)textureSamplingRect.GetMinX (), (float)textureSamplingRect.GetMinY (),
(float)textureSamplingRect.GetMaxX (), (float)textureSamplingRect.GetMinY ()
};
GL.VertexAttribPointer ((int)AttributeIndex.TextureCoordinates, 2, VertexAttribPointerType.Float, false, 0, quadTextureData);
GL.EnableVertexAttribArray ((int)AttributeIndex.TextureCoordinates);
GL.DrawArrays (BeginMode.TriangleStrip, 0, 4);
GL.BindRenderbuffer (RenderbufferTarget.Renderbuffer, colorBufferHandle);
context.PresentRenderBuffer ((int)RenderbufferTarget.Renderbuffer);
}
示例14: Draw
public override void Draw(CGRect rect)
{
//// General Declarations
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f);
var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f);
var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f);
//// Frames
CGRect frame = new CGRect(0.0f, 0.0f, 772.0f, 356.0f);
//// Group 2
{
//// Group 3
{
context.SaveState();
context.BeginTransparencyLayer();
//// Clip Clip 2
UIBezierPath clip2Path = new UIBezierPath();
clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() - 45.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() + 310.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() + 310.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f));
clip2Path.ClosePath();
clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 22.44f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() - 24.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.0f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 22.44f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 285.5f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 287.44f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() + 289.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.0f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 287.44f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f));
clip2Path.ClosePath();
clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 285.5f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 287.99f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() + 290.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 290.0f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 287.99f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 20.5f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 22.99f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() - 25.0f));
clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 25.0f));
clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 22.99f));
clip2Path.ClosePath();
clip2Path.UsesEvenOddFillRule = true;
clip2Path.AddClip();
//// Group 4
{
context.SaveState();
context.BeginTransparencyLayer();
//// Clip Clip
UIBezierPath clipPath = new UIBezierPath();
clipPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f));
clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f));
clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f));
clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f));
clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f));
clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f));
clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f));
clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f));
clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f));
clipPath.ClosePath();
clipPath.UsesEvenOddFillRule = true;
clipPath.AddClip();
//// Bezier Drawing
UIBezierPath bezierPath = new UIBezierPath();
bezierPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f));
bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f));
bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f));
bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f));
bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f));
bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f));
bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f));
bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f));
bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f));
bezierPath.ClosePath();
fillColor.SetFill();
bezierPath.Fill();
context.EndTransparencyLayer();
context.RestoreState();
}
context.EndTransparencyLayer();
context.RestoreState();
}
//.........这里部分代码省略.........
示例15: drawArc
private void drawArc(CGContext context, CGRect rect)
{
var radius = rect.GetMaxY() * badgeCornerRoundness;
var puffer = new nfloat(Padding(rect));
var maxX = rect.GetMaxX() - puffer;
var maxY = rect.GetMaxY() - puffer;
var minX = rect.GetMinX() + puffer;
var minY = rect.GetMinY() + puffer;
double pi = Math.PI;
context.AddArc(new nfloat(maxX - radius), new nfloat(minY + radius), new nfloat(radius), new nfloat(pi + (pi / 2)), 0, false);
context.AddArc(new nfloat(maxX - radius), new nfloat(minY - radius), new nfloat(radius), 0, new nfloat(pi / 2), false);
}