EvolveGraphicsAndAnimation sample ported to 64-bits

This commit is contained in:
Paola Villarreal 2014-05-26 22:20:59 -05:00
Родитель 778c6b44cc
Коммит d4000294aa
27 изменённых файлов: 113 добавлений и 104 удалений

Просмотреть файл

@ -17,12 +17,13 @@
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<DefineConstants>DEBUG;XAMCORE_2_0;ARCH_64</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchLink>None</MtouchLink>
<MtouchDebug>True</MtouchDebug>
<MtouchExtraArgs>--registrar:static --nofastsim --override-abi x86_64</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
@ -79,7 +80,9 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS">
<HintPath>\Developer\MonoTouch\usr\lib\mono\Xamarin.iOS\Xamarin.iOS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
@ -130,4 +133,4 @@
<BundleResource Include="monkey2.png" />
<BundleResource Include="monkey3.png" />
</ItemGroup>
</Project>
</Project>

Просмотреть файл

@ -1,8 +1,8 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace AnimationSamples
{

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{
@ -12,7 +12,7 @@ namespace AnimationSamples
partial class AnimationSamplesViewController
{
[Outlet]
MonoTouch.UIKit.UIButton TransitionButton { get; set; }
UIKit.UIButton TransitionButton { get; set; }
void ReleaseDesignerOutlets ()
{

Просмотреть файл

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace AnimationSamples
{

Просмотреть файл

@ -1,9 +1,9 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace AnimationSamples
{

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{

Просмотреть файл

@ -1,11 +1,11 @@
using System;
using System.Drawing;
using CoreGraphics;
using Foundation;
using UIKit;
using CoreAnimation;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreAnimation;
using MonoTouch.CoreGraphics;
namespace AnimationSamples
{
@ -23,8 +23,8 @@ namespace AnimationSamples
base.ViewDidLoad ();
layer = new CALayer ();
layer.Bounds = new RectangleF (0, 0, 50, 50);
layer.Position = new PointF (50, 50);
layer.Bounds = new CGRect (0, 0, 50, 50);
layer.Position = new CGPoint (50, 50);
layer.Contents = UIImage.FromFile ("monkey2.png").CGImage;
layer.ContentsGravity = CALayer.GravityResize;
layer.BorderWidth = 1.5f;
@ -38,16 +38,16 @@ namespace AnimationSamples
base.ViewDidAppear (animated);
// get the initial value to start the animation from
PointF fromPt = layer.Position;
CGPoint fromPt = layer.Position;
// set the position to coincide with the final animation value
// to prevent it from snapping back to the starting position
// after the animation completes
layer.Position = new PointF (200, 300);
layer.Position = new CGPoint (200, 300);
// create a path for the animation to follow
CGPath path = new CGPath ();
path.AddLines (new PointF[] { fromPt, new PointF (50, 300), new PointF (200, 50), new PointF (200, 300) });
path.AddLines (new CGPoint[] { fromPt, new CGPoint (50, 300), new CGPoint (200, 50), new CGPoint (200, 300) });
// create a keyframe animation for the position using the path
CAKeyFrameAnimation animPosition = (CAKeyFrameAnimation)CAKeyFrameAnimation.FromKeyPath ("position");

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{

Просмотреть файл

@ -1,10 +1,10 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreAnimation;
using Foundation;
using UIKit;
using CoreAnimation;
namespace AnimationSamples
{
@ -21,8 +21,8 @@ namespace AnimationSamples
base.ViewDidLoad ();
layer = new CALayer ();
layer.Bounds = new RectangleF (0, 0, 50, 50);
layer.Position = new PointF (50, 50);
layer.Bounds = new CGRect (0, 0, 50, 50);
layer.Position = new CGPoint (50, 50);
layer.Contents = UIImage.FromFile ("monkey2.png").CGImage;
layer.ContentsGravity = CALayer.GravityResize;
layer.BorderWidth = 1.5f;
@ -37,7 +37,7 @@ namespace AnimationSamples
CATransaction.Begin ();
CATransaction.AnimationDuration = 10;
layer.Position = new PointF (50, 400);
layer.Position = new CGPoint (50, 400);
layer.BorderWidth = 5.0f;
layer.BorderColor = UIColor.Red.CGColor;
CATransaction.Commit ();

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{

Просмотреть файл

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace AnimationSamples
{

Просмотреть файл

@ -1,9 +1,9 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace AnimationSamples
{

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{

Просмотреть файл

@ -1,17 +1,17 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using MonoTouch.CoreAnimation;
using Foundation;
using UIKit;
using CoreAnimation;
namespace AnimationSamples
{
public partial class ViewAnimation : UIViewController
{
PointF pt;
CGPoint pt;
UIImageView imgView;
UIImage img;
@ -23,7 +23,7 @@ namespace AnimationSamples
{
base.ViewDidLoad ();
imgView = new UIImageView (new RectangleF (0, 0, 100, 100));
imgView = new UIImageView (new CGRect (0, 0, 100, 100));
imgView.ContentMode = UIViewContentMode.ScaleAspectFit;
img = UIImage.FromFile ("monkey3.png");
imgView.Image = img;
@ -36,7 +36,7 @@ namespace AnimationSamples
delay: 0,
options: UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.Autoreverse,
animation: () => {
imgView.Center = new PointF (View.Bounds.GetMaxX () - imgView.Frame.Width / 2, pt.Y);},
imgView.Center = new CGPoint (View.Bounds.GetMaxX () - imgView.Frame.Width / 2, pt.Y);},
completion: () => {
imgView.Center = pt; }
);

Просмотреть файл

@ -4,7 +4,7 @@
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using Foundation;
namespace AnimationSamples
{

Просмотреть файл

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace CoreGraphicsSamples
{

Просмотреть файл

@ -16,7 +16,7 @@
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<DefineConstants>DEBUG;XAMCORE_2_0;ARCH_64</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
@ -25,6 +25,7 @@
<MtouchI18n>
</MtouchI18n>
<MtouchArch>ARMv7</MtouchArch>
<MtouchExtraArgs>--registrar:static --nofastsim --override-abi x86_64</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
@ -65,7 +66,9 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS">
<HintPath>\Developer\MonoTouch\usr\lib\mono\Xamarin.iOS\Xamarin.iOS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
@ -86,4 +89,4 @@
<ItemGroup>
<Content Include="file.pdf" />
</ItemGroup>
</Project>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
using MonoTouch.UIKit;
using System.Drawing;
using UIKit;
using CoreGraphics;
using System;
using MonoTouch.Foundation;
using Foundation;
namespace CoreGraphicsSamples
{

Просмотреть файл

@ -1,7 +1,7 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
using UIKit;
using CoreGraphics;
namespace CoreGraphicsSamples
{
@ -12,7 +12,7 @@ namespace CoreGraphicsSamples
BackgroundColor = UIColor.White;
}
public override void Draw (RectangleF rect)
public override void Draw (CGRect rect)
{
base.Draw (rect);
@ -27,7 +27,7 @@ namespace CoreGraphicsSamples
g.SetLineWidth (2.0f);
g.SetStrokeColor (UIColor.Green.CGColor);
g.SetFillColor (UIColor.Purple.CGColor);
g.SetShadowWithColor (new SizeF (5, 5), 0, UIColor.Blue.CGColor);
g.SetShadow (new CGSize (5, 5), 0, UIColor.Blue.CGColor);
g.SetTextDrawingMode (CGTextDrawingMode.FillStroke);
g.SelectFont ("Helvetica", fontSize, CGTextEncoding.MacRoman);

Просмотреть файл

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace CoreGraphicsSamples
{

Просмотреть файл

@ -1,8 +1,8 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.Foundation;
using UIKit;
using CoreGraphics;
using Foundation;
namespace CoreGraphicsSamples
{
@ -18,7 +18,7 @@ namespace CoreGraphicsSamples
pdfDoc = CGPDFDocument.FromFile ("file.pdf");
}
public override void Draw (RectangleF rect)
public override void Draw (CGRect rect)
{
base.Draw (rect);
@ -45,7 +45,7 @@ namespace CoreGraphicsSamples
//data buffer to hold the PDF
NSMutableData data = new NSMutableData ();
//create a PDF with empty rectangle, which will configure it for 8.5x11 inches
UIGraphics.BeginPDFContext (data, RectangleF.Empty, null);
UIGraphics.BeginPDFContext (data, CGRect.Empty, null);
//start a PDF page
UIGraphics.BeginPDFPage ();
using (CGContext g = UIGraphics.GetCurrentContext ()) {

Просмотреть файл

@ -1,7 +1,7 @@
using System;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.UIKit;
using CoreGraphics;
using UIKit;
namespace CoreGraphicsSamples
{
@ -12,7 +12,7 @@ namespace CoreGraphicsSamples
BackgroundColor = UIColor.White;
}
public override void Draw (RectangleF rect)
public override void Draw (CGRect rect)
{
base.Draw (rect);
@ -27,15 +27,15 @@ namespace CoreGraphicsSamples
//create geometry
var path = new CGPath ();
path.AddLines (new PointF[]{
new PointF (100, 200),
new PointF (160, 100),
new PointF (220, 200)});
path.AddLines (new CGPoint[]{
new CGPoint (100, 200),
new CGPoint (160, 100),
new CGPoint (220, 200)});
path.CloseSubpath ();
//use a dashed line
g.SetLineDash (0, new float[]{10, 4});
g.SetLineDash (0, new nfloat[]{10, 4});
//add geometry to graphics context and draw it
g.AddPath (path);
@ -56,8 +56,8 @@ namespace CoreGraphicsSamples
// draw a linear gradient
g.DrawLinearGradient (
gradient,
new PointF (path.BoundingBox.Left, path.BoundingBox.Top),
new PointF (path.BoundingBox.Right, path.BoundingBox.Bottom),
new CGPoint (path.BoundingBox.Left, path.BoundingBox.Top),
new CGPoint (path.BoundingBox.Right, path.BoundingBox.Bottom),
CGGradientDrawingOptions.DrawsBeforeStartLocation);
}
}

Просмотреть файл

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace GraphicsDemo
{

Просмотреть файл

@ -1,16 +1,16 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.CoreAnimation;
using UIKit;
using CoreGraphics;
using CoreAnimation;
namespace GraphicsDemo
{
public class DemoView : UIView
{
CGPath path;
PointF initialPoint;
PointF latestPoint;
CGPoint initialPoint;
CGPoint latestPoint;
CALayer layer;
@ -22,8 +22,8 @@ namespace GraphicsDemo
//create layer
layer = new CALayer ();
layer.Bounds = new RectangleF (0, 0, 50, 50);
layer.Position = new PointF (50, 50);
layer.Bounds = new CGRect (0, 0, 50, 50);
layer.Position = new CGPoint (50, 50);
layer.Contents = UIImage.FromFile ("monkey.png").CGImage;
layer.ContentsGravity = CALayer.GravityResizeAspect;
layer.BorderWidth = 1.5f;
@ -32,7 +32,7 @@ namespace GraphicsDemo
layer.BackgroundColor = UIColor.Purple.CGColor;
}
public override void TouchesBegan (MonoTouch.Foundation.NSSet touches, UIEvent evt)
public override void TouchesBegan (Foundation.NSSet touches, UIEvent evt)
{
base.TouchesBegan (touches, evt);
@ -43,7 +43,7 @@ namespace GraphicsDemo
}
}
public override void TouchesMoved (MonoTouch.Foundation.NSSet touches, UIEvent evt)
public override void TouchesMoved (Foundation.NSSet touches, UIEvent evt)
{
base.TouchesMoved (touches, evt);
@ -55,7 +55,7 @@ namespace GraphicsDemo
}
}
public override void TouchesEnded (MonoTouch.Foundation.NSSet touches, UIEvent evt)
public override void TouchesEnded (Foundation.NSSet touches, UIEvent evt)
{
base.TouchesEnded (touches, evt);
@ -72,7 +72,7 @@ namespace GraphicsDemo
layer.AddAnimation (animPosition, "position");
}
public override void Draw (RectangleF rect)
public override void Draw (CGRect rect)
{
base.Draw (rect);
@ -87,13 +87,13 @@ namespace GraphicsDemo
//add lines to the touch points
if (path.IsEmpty) {
path.AddLines (new PointF[]{initialPoint, latestPoint});
path.AddLines (new CGPoint[]{initialPoint, latestPoint});
} else {
path.AddLineToPoint (latestPoint);
}
//use a dashed line
g.SetLineDash (0, new float[]{5, 2});
g.SetLineDash (0, new nfloat[]{5, 2});
//add geometry to graphics context and draw it
g.AddPath (path);

Просмотреть файл

@ -17,12 +17,13 @@
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<DefineConstants>DEBUG;XAMCORE_2_0;ARCH_64</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchLink>None</MtouchLink>
<MtouchDebug>True</MtouchDebug>
<MtouchExtraArgs>--registrar:static --nofastsim --override-abi x86_64</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
@ -84,7 +85,9 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS">
<HintPath>\Developer\MonoTouch\usr\lib\mono\Xamarin.iOS\Xamarin.iOS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
@ -111,4 +114,4 @@
<BundleResource Include="Resources\Default%402x.png" />
<BundleResource Include="Resources\Default.png" />
</ItemGroup>
</Project>
</Project>

Просмотреть файл

@ -1,8 +1,8 @@
using System;
using System.Drawing;
using CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace GraphicsDemo
{

Просмотреть файл

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;
namespace GraphicsDemo
{