This commit is contained in:
Pekka Kauppila 2014-04-01 15:04:12 +03:00
Коммит 85615ea6c7
83 изменённых файлов: 2161 добавлений и 0 удалений

30
ImageSequencer.sln Normal file
Просмотреть файл

@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Phone
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageSequencer", "ImageSequencer\ImageSequencer.csproj", "{FA534E87-99D0-4F57-A83A-94675F98961C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|ARM.ActiveCfg = Debug|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|ARM.Build.0 = Debug|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|ARM.Deploy.0 = Debug|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|x86.ActiveCfg = Debug|x86
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|x86.Build.0 = Debug|x86
{FA534E87-99D0-4F57-A83A-94675F98961C}.Debug|x86.Deploy.0 = Debug|x86
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|ARM.ActiveCfg = Release|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|ARM.Build.0 = Release|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|ARM.Deploy.0 = Release|ARM
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|x86.ActiveCfg = Release|x86
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|x86.Build.0 = Release|x86
{FA534E87-99D0-4F57-A83A-94675F98961C}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

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

@ -0,0 +1,72 @@
<!--
Copyright (c) 2013 Nokia Corporation. All rights reserved.
Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation.
Other product and company names mentioned herein may be trademarks
or trade names of their respective owners.
See the license text file for license information.
-->
<phone:PhoneApplicationPage
x:Class="ImageSequencer.AboutPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Landscape"
mc:Ignorable="d"
shell:SystemTray.IsVisible="False">
<!--Toolkit page transititions-->
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}" />
<TextBlock Text="{Binding Path=LocalizedResources.AboutPage_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<RichTextBox VerticalAlignment="Top">
<Paragraph x:Name="VersionParagraph"/>
<Paragraph x:Name="AboutParagraph"/>
<Paragraph x:Name="ProjectParagraph"/>
</RichTextBox>
</Grid>
</Grid>
</phone:PhoneApplicationPage>

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

@ -0,0 +1,78 @@
/**
* Copyright (c) 2013 Nokia Corporation. All rights reserved.
*
* Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation.
* Other product and company names mentioned herein may be trademarks
* or trade names of their respective owners.
*
* See the license text file for license information.
*/
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using ImageSequencer.Resources;
using System;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using System.Xml.Linq;
namespace ImageSequencer
{
public partial class AboutPage : PhoneApplicationPage
{
public AboutPage()
{
InitializeComponent();
// Application version number
var version = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
var versionRun = new Run()
{
Text = String.Format(AppResources.AboutPage_VersionRun, version) + "\n"
};
VersionParagraph.Inlines.Add(versionRun);
// Application about text
var aboutRun = new Run()
{
Text = AppResources.AboutPage_AboutRun + "\n"
};
AboutParagraph.Inlines.Add(aboutRun);
// Link to project homepage
var projectRunText = AppResources.AboutPage_ProjectRun;
var projectRunTextSpans = projectRunText.Split(new string[] { "{0}" }, StringSplitOptions.None);
var projectRunSpan1 = new Run {Text = projectRunTextSpans[0]};
var projectsLink = new Hyperlink();
projectsLink.Inlines.Add(AppResources.AboutPage_Hyperlink_Project);
projectsLink.Click += ProjectsLink_Click;
projectsLink.Foreground = new SolidColorBrush((Color)Application.Current.Resources["PhoneForegroundColor"]);
projectsLink.MouseOverForeground = new SolidColorBrush((Color)Application.Current.Resources["PhoneAccentColor"]);
var projectRunSpan2 = new Run {Text = projectRunTextSpans[1] + "\n"};
ProjectParagraph.Inlines.Add(projectRunSpan1);
ProjectParagraph.Inlines.Add(projectsLink);
ProjectParagraph.Inlines.Add(projectRunSpan2);
}
private void ProjectsLink_Click(object sender, RoutedEventArgs e)
{
var webBrowserTask = new WebBrowserTask()
{
Uri = new Uri(AppResources.AboutPage_Hyperlink_Project, UriKind.Absolute)
};
webBrowserTask.Show();
}
}
}

20
ImageSequencer/App.xaml Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<Application
x:Class="ImageSequencer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
<!--Application Resources-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:ImageSequencer" x:Key="LocalizedStrings"/>
</Application.Resources>
<Application.ApplicationLifetimeObjects>
<!--Required object that handles lifetime events for the application-->
<shell:PhoneApplicationService
Launching="Application_Launching" Closing="Application_Closing"
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
</Application.ApplicationLifetimeObjects>
</Application>

223
ImageSequencer/App.xaml.cs Normal file
Просмотреть файл

@ -0,0 +1,223 @@
using System;
using System.Diagnostics;
using System.Resources;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using ImageSequencer.Resources;
namespace ImageSequencer
{
public partial class App : Application
{
/// <summary>
/// Provides easy access to the root frame of the Phone Application.
/// </summary>
/// <returns>The root frame of the Phone Application.</returns>
public static PhoneApplicationFrame RootFrame { get; private set; }
/// <summary>
/// Constructor for the Application object.
/// </summary>
public App()
{
// Global handler for uncaught exceptions.
UnhandledException += Application_UnhandledException;
// Standard XAML initialization
InitializeComponent();
// Phone-specific initialization
InitializePhoneApplication();
// Language display initialization
InitializeLanguage();
// Show graphics profiling information while debugging.
if (Debugger.IsAttached)
{
// Display the current frame rate counters.
Application.Current.Host.Settings.EnableFrameRateCounter = false;
// Show the areas of the app that are being redrawn in each frame.
//Application.Current.Host.Settings.EnableRedrawRegions = true;
// Enable non-production analysis visualization mode,
// which shows areas of a page that are handed off to GPU with a colored overlay.
//Application.Current.Host.Settings.EnableCacheVisualization = true;
// Prevent the screen from turning off while under the debugger by disabling
// the application's idle detection.
// Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
// and consume battery power when the user is not using the phone.
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
}
}
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
}
// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched
private void Application_Activated(object sender, ActivatedEventArgs e)
{
}
// Code to execute when the application is deactivated (sent to background)
// This code will not execute when the application is closing
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
{
}
// Code to execute when the application is closing (eg, user hit Back)
// This code will not execute when the application is deactivated
private void Application_Closing(object sender, ClosingEventArgs e)
{
}
// Code to execute if a navigation fails
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
if (Debugger.IsAttached)
{
// A navigation has failed; break into the debugger
Debugger.Break();
}
}
// Code to execute on Unhandled Exceptions
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
Debugger.Break();
}
}
#region Phone application initialization
// Avoid double-initialization
private bool phoneApplicationInitialized = false;
// Do not add any additional code to this method
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Create the frame but don't set it as RootVisual yet; this allows the splash
// screen to remain active until the application is ready to render.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handle navigation failures
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Handle reset requests for clearing the backstack
RootFrame.Navigated += CheckForResetNavigation;
// Ensure we don't initialize again
phoneApplicationInitialized = true;
}
// Do not add any additional code to this method
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
{
// Set the root visual to allow the application to render
if (RootVisual != RootFrame)
RootVisual = RootFrame;
// Remove this handler since it is no longer needed
RootFrame.Navigated -= CompleteInitializePhoneApplication;
}
private void CheckForResetNavigation(object sender, NavigationEventArgs e)
{
// If the app has received a 'reset' navigation, then we need to check
// on the next navigation to see if the page stack should be reset
if (e.NavigationMode == NavigationMode.Reset)
RootFrame.Navigated += ClearBackStackAfterReset;
}
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
{
// Unregister the event so it doesn't get called again
RootFrame.Navigated -= ClearBackStackAfterReset;
// Only clear the stack for 'new' (forward) and 'refresh' navigations
if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh)
return;
// For UI consistency, clear the entire page stack
while (RootFrame.RemoveBackEntry() != null)
{
; // do nothing
}
}
#endregion
// Initialize the app's font and flow direction as defined in its localized resource strings.
//
// To ensure that the font of your application is aligned with its supported languages and that the
// FlowDirection for each of those languages follows its traditional direction, ResourceLanguage
// and ResourceFlowDirection should be initialized in each resx file to match these values with that
// file's culture. For example:
//
// AppResources.es-ES.resx
// ResourceLanguage's value should be "es-ES"
// ResourceFlowDirection's value should be "LeftToRight"
//
// AppResources.ar-SA.resx
// ResourceLanguage's value should be "ar-SA"
// ResourceFlowDirection's value should be "RightToLeft"
//
// For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072.
//
private void InitializeLanguage()
{
try
{
// Set the font to match the display language defined by the
// ResourceLanguage resource string for each supported language.
//
// Fall back to the font of the neutral language if the Display
// language of the phone is not supported.
//
// If a compiler error is hit then ResourceLanguage is missing from
// the resource file.
RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage);
// Set the FlowDirection of all elements under the root frame based
// on the ResourceFlowDirection resource string for each
// supported language.
//
// If a compiler error is hit then ResourceFlowDirection is missing from
// the resource file.
FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection);
RootFrame.FlowDirection = flow;
}
catch
{
// If an exception is caught here it is most likely due to either
// ResourceLangauge not being correctly set to a supported language
// code or ResourceFlowDirection is set to a value other than LeftToRight
// or RightToLeft.
if (Debugger.IsAttached)
{
Debugger.Break();
}
throw;
}
}
}
}

Двоичные данные
ImageSequencer/Assets/AlignmentGrid.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.8 KiB

Двоичные данные
ImageSequencer/Assets/ApplicationIcon.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.1 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.0.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 117 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.1.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 116 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.10.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.11.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 121 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.12.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.13.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 111 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.14.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 116 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.15.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 116 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.16.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 119 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.17.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.18.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 117 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.19.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 115 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.2.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 121 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.20.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.21.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.22.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.3.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.4.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 107 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.5.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.6.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.7.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 116 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.8.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.1.9.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.0.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 108 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.1.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.10.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 129 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.11.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 114 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.12.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.13.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 132 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.14.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 113 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.15.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.16.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 124 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.17.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 125 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.18.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 117 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.2.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 125 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.3.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 105 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.4.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 121 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.5.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.6.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 124 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.7.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 110 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.8.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 126 KiB

Двоичные данные
ImageSequencer/Assets/Sequences/sequence.2.9.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 126 KiB

Двоичные данные
ImageSequencer/Assets/Tiles/FlipCycleTileLarge.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.7 KiB

Двоичные данные
ImageSequencer/Assets/Tiles/FlipCycleTileMedium.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.9 KiB

Двоичные данные
ImageSequencer/Assets/Tiles/FlipCycleTileSmall.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.6 KiB

Двоичные данные
ImageSequencer/Assets/Tiles/IconicTileMediumLarge.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Двоичные данные
ImageSequencer/Assets/Tiles/IconicTileSmall.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.6 KiB

Двоичные данные
ImageSequencer/Assets/appbar.align.disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 951 B

Двоичные данные
ImageSequencer/Assets/appbar.align.enabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
ImageSequencer/Assets/appbar.frame.disabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 239 B

Двоичные данные
ImageSequencer/Assets/appbar.frame.enabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
ImageSequencer/Assets/appbar.pause.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 682 B

Двоичные данные
ImageSequencer/Assets/appbar.play.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 874 B

Двоичные данные
ImageSequencer/Assets/appbar.save.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

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

@ -0,0 +1,110 @@
using Nokia.Graphics.Imaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Runtime.InteropServices.WindowsRuntime;
using System.IO.IsolatedStorage;
using System.IO;
using System.Windows.Shapes;
using System.Windows.Media;
using Nokia.InteropServices.WindowsRuntime;
namespace ImageSequencer
{
class GifExporter
{
public static async Task Export(IReadOnlyList<IImageProvider> images, Rect? animatedArea)
{
ImageProviderInfo info = await images[0].GetInfoAsync();
int w = (int)info.ImageSize.Width;
int h = (int)info.ImageSize.Height;
IReadOnlyList<IImageProvider> gifRendererSources;
if (animatedArea.HasValue)
{
gifRendererSources = await CreateFramedAnimation(images, animatedArea.Value, w, h);
}
else
{
gifRendererSources = images;
}
using (GifRenderer gifRenderer = new GifRenderer())
{
gifRenderer.Size = new Windows.Foundation.Size(w, h);
gifRenderer.Duration = 100;
gifRenderer.NumberOfAnimationLoops = 10000;
gifRenderer.Sources = gifRendererSources;
var buffer = await gifRenderer.RenderAsync();
using (IsolatedStorageFileStream file = IsolatedStorageFile.GetUserStoreForApplication().CreateFile("exported." + GetFileNameRunningNumber() + ".gif"))
{
Stream bufferStream = buffer.AsStream();
bufferStream.CopyTo(file);
bufferStream.Close();
bufferStream.Dispose();
file.Flush();
}
}
}
private static async Task<IReadOnlyList<IImageProvider>> CreateFramedAnimation(IReadOnlyList<IImageProvider> images, Rect animationBounds, int w, int h)
{
List<IImageProvider> framedAnimation = new List<IImageProvider>();
WriteableBitmap frameBitmap = new WriteableBitmap(w, h);
using (WriteableBitmapRenderer wbr = new WriteableBitmapRenderer())
{
foreach (IImageProvider frame in images)
{
// Render background
WriteableBitmap backgroundBitmap = new WriteableBitmap(w, h);
wbr.Source = images[0];
wbr.WriteableBitmap = backgroundBitmap;
await wbr.RenderAsync();
if (frame != images[0])
{
// Render foreground
wbr.Source = frame;
wbr.WriteableBitmap = frameBitmap;
await wbr.RenderAsync();
for (int y = (int)animationBounds.Y; y < ((int)animationBounds.Y + (int)animationBounds.Height); y++)
{
Array.Copy(frameBitmap.Pixels,
(int)animationBounds.X + (y * w),
backgroundBitmap.Pixels,
(int)animationBounds.X + (y * w),
(int)animationBounds.Width);
}
}
framedAnimation.Add(new BitmapImageSource(backgroundBitmap.AsBitmap()));
}
}
return framedAnimation;
}
private static int GetFileNameRunningNumber()
{
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
String[] filenames = store.GetFileNames();
int max = 0;
foreach (String filename in filenames)
{
max = Math.Max(max, Convert.ToInt32(filename.Split('.')[1]));
}
return max + 1;
}
}
}

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

@ -0,0 +1,85 @@
<phone:PhoneApplicationPage
x:Class="ImageSequencer.ImagePicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer x:Name="SequencesPanel">
<StackPanel>
<TextBlock Text="{Binding Path=LocalizedResources.ImagePickerPage_Heading_Sequences, Source={StaticResource LocalizedStrings}}" Margin="9,12,0,12" Style="{StaticResource PhoneTextTitle2Style}"/>
<ItemsControl ItemsSource="{Binding Sequences}" Visibility="Visible">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel ItemWidth="226" ItemHeight="140"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Image Source="{Binding}" Tap="Thumbnail_Tap" CacheMode="BitmapCache" Margin="12,12,12,12"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding Path=LocalizedResources.ImagePickerPage_Heading_Saved, Source={StaticResource LocalizedStrings}}" Margin="9,12,0,12" Style="{StaticResource PhoneTextTitle2Style}"/>
<ItemsControl ItemsSource="{Binding Gifs}" Visibility="Visible">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel ItemWidth="226" ItemHeight="180"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu>
<toolkit:MenuItem Click="Delete_Click" Header="{Binding Path=LocalizedResources.ImagePickerPage_MenuItem_Delete, Source={StaticResource LocalizedStrings}}" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
<Image Source="{Binding BitmapImage}" CacheMode="BitmapCache" Margin="12,12,12,6"/>
<TextBlock Text="{Binding FileName}" Margin="12,6,12,12"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock x:Name="ThereAreNoSavedGifsTextBlock" Text="{Binding Path=LocalizedResources.ImagePickerPage_No_Gifs_Message, Source={StaticResource LocalizedStrings}}" Margin="12,0,0,0" Visibility="Collapsed"/>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="about" Click="About_Click"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>

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

@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Collections.ObjectModel;
using System.IO.IsolatedStorage;
using System.Windows.Media.Imaging;
using System.IO;
namespace ImageSequencer
{
public partial class ImagePicker : PhoneApplicationPage
{
public ObservableCollection<Uri> Sequences { get; private set; }
public ObservableCollection<GifThumbnail> Gifs { get; private set; }
public ImagePicker()
{
InitializeComponent();
Gifs = new ObservableCollection<GifThumbnail>();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
PopulateSources();
PopulateGifs();
DataContext = this;
}
private void PopulateSources()
{
Sequences = new ObservableCollection<Uri>()
{
new Uri(@"Assets/Sequences/sequence.1.0.jpg", UriKind.Relative),
new Uri(@"Assets/Sequences/sequence.2.0.jpg", UriKind.Relative)
};
}
private void PopulateGifs()
{
Gifs.Clear();
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
String[] fileNames = store.GetFileNames();
foreach (String filename in fileNames)
{
using (var sourceFile = store.OpenFile(filename, FileMode.Open, FileAccess.Read))
{
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(sourceFile);
GifThumbnail gifThumbnail = new GifThumbnail();
gifThumbnail.BitmapImage = bitmapImage;
gifThumbnail.FileName = filename;
Gifs.Add(gifThumbnail);
}
}
if (Gifs.Count() == 0)
{
ThereAreNoSavedGifsTextBlock.Visibility = Visibility.Visible;
}
else
{
ThereAreNoSavedGifsTextBlock.Visibility = Visibility.Collapsed;
}
}
public void Thumbnail_Tap(object sender, EventArgs e)
{
Uri uri = (sender as Image).DataContext as Uri;
int sequenceId = Sequences.IndexOf(uri) + 1;
NavigationService.Navigate(new Uri("/MainPage.xaml?sequenceId=" + sequenceId, UriKind.Relative));
}
public void About_Click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/AboutPage.xaml", UriKind.Relative));
}
public void Delete_Click(object sender, EventArgs e)
{
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
store.DeleteFile(((sender as MenuItem).DataContext as GifThumbnail).FileName);
PopulateGifs();
}
public class GifThumbnail
{
public BitmapImage BitmapImage { get; set; }
public String FileName { get; set; }
}
}
}

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

@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FA534E87-99D0-4F57-A83A-94675F98961C}</ProjectGuid>
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageSequencer</RootNamespace>
<AssemblyName>ImageSequencer</AssemblyName>
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<SilverlightApplication>true</SilverlightApplication>
<SupportedCultures>
</SupportedCultures>
<XapOutputs>true</XapOutputs>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
<XapFilename>ImageSequencer_$(Configuration)_$(Platform).xap</XapFilename>
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
<SilverlightAppEntry>ImageSequencer.App</SilverlightAppEntry>
<ValidateXaml>true</ValidateXaml>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\x86\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\x86\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\ARM\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\ARM\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="AboutPage.xaml.cs">
<DependentUpon>AboutPage.xaml</DependentUpon>
</Compile>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="GifExporter.cs" />
<Compile Include="ImagePicker.xaml.cs">
<DependentUpon>ImagePicker.xaml</DependentUpon>
</Compile>
<Compile Include="LocalizedStrings.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\AppResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AppResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</ApplicationDefinition>
<Page Include="AboutPage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="ImagePicker.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Properties\AppManifest.xml" />
<None Include="Properties\WMAppManifest.xml">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\AlignmentGrid.png" />
<Content Include="Assets\appbar.align.disabled.png" />
<Content Include="Assets\appbar.align.enabled.png" />
<Content Include="Assets\appbar.frame.disabled.png" />
<Content Include="Assets\appbar.frame.enabled.png" />
<Content Include="Assets\appbar.save.png" />
<Content Include="Assets\ApplicationIcon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Sequences\sequence.1.0.jpg" />
<Content Include="Assets\Sequences\sequence.1.1.jpg" />
<Content Include="Assets\Sequences\sequence.1.10.jpg" />
<Content Include="Assets\Sequences\sequence.1.11.jpg" />
<Content Include="Assets\Sequences\sequence.1.12.jpg" />
<Content Include="Assets\Sequences\sequence.1.13.jpg" />
<Content Include="Assets\Sequences\sequence.1.14.jpg" />
<Content Include="Assets\Sequences\sequence.1.15.jpg" />
<Content Include="Assets\Sequences\sequence.1.16.jpg" />
<Content Include="Assets\Sequences\sequence.1.17.jpg" />
<Content Include="Assets\Sequences\sequence.1.18.jpg" />
<Content Include="Assets\Sequences\sequence.1.19.jpg" />
<Content Include="Assets\Sequences\sequence.1.2.jpg" />
<Content Include="Assets\Sequences\sequence.1.20.jpg" />
<Content Include="Assets\Sequences\sequence.1.21.jpg" />
<Content Include="Assets\Sequences\sequence.1.22.jpg" />
<Content Include="Assets\Sequences\sequence.1.3.jpg" />
<Content Include="Assets\Sequences\sequence.1.4.jpg" />
<Content Include="Assets\Sequences\sequence.1.5.jpg" />
<Content Include="Assets\Sequences\sequence.1.6.jpg" />
<Content Include="Assets\Sequences\sequence.1.7.jpg" />
<Content Include="Assets\Sequences\sequence.1.8.jpg" />
<Content Include="Assets\Sequences\sequence.1.9.jpg" />
<Content Include="Assets\Sequences\sequence.2.0.jpg" />
<Content Include="Assets\Sequences\sequence.2.1.jpg" />
<Content Include="Assets\Sequences\sequence.2.10.jpg" />
<Content Include="Assets\Sequences\sequence.2.11.jpg" />
<Content Include="Assets\Sequences\sequence.2.12.jpg" />
<Content Include="Assets\Sequences\sequence.2.13.jpg" />
<Content Include="Assets\Sequences\sequence.2.14.jpg" />
<Content Include="Assets\Sequences\sequence.2.15.jpg" />
<Content Include="Assets\Sequences\sequence.2.16.jpg" />
<Content Include="Assets\Sequences\sequence.2.17.jpg" />
<Content Include="Assets\Sequences\sequence.2.18.jpg" />
<Content Include="Assets\Sequences\sequence.2.2.jpg" />
<Content Include="Assets\Sequences\sequence.2.3.jpg" />
<Content Include="Assets\Sequences\sequence.2.4.jpg" />
<Content Include="Assets\Sequences\sequence.2.5.jpg" />
<Content Include="Assets\Sequences\sequence.2.6.jpg" />
<Content Include="Assets\Sequences\sequence.2.7.jpg" />
<Content Include="Assets\Sequences\sequence.2.8.jpg" />
<Content Include="Assets\Sequences\sequence.2.9.jpg" />
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Tiles\FlipCycleTileMedium.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Tiles\FlipCycleTileSmall.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Tiles\IconicTileMediumLarge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Tiles\IconicTileSmall.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\appbar.pause.png" />
<Content Include="Assets\appbar.play.png" />
<Content Include="README_FIRST.txt" />
<Content Include="Toolkit.Content\ApplicationBar.Add.png" />
<Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
<Content Include="Toolkit.Content\ApplicationBar.Check.png" />
<Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
<Content Include="Toolkit.Content\ApplicationBar.Select.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\AppResources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Reference Include="Microsoft.Phone.Controls.Toolkit">
<HintPath>..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nokia.Graphics.Imaging.Managed, Version=1.2.99.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NokiaImagingSDK.1.2.99\lib\wp8\Nokia.Graphics.Imaging.Managed.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions />
<Import Project="..\packages\NokiaImagingSDK.1.2.99\build\wp8\NokiaImagingSDK.targets" Condition="Exists('..\packages\NokiaImagingSDK.1.2.99\build\wp8\NokiaImagingSDK.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NokiaImagingSDK.1.2.99\build\wp8\NokiaImagingSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NokiaImagingSDK.1.2.99\build\wp8\NokiaImagingSDK.targets'))" />
</Target>
</Project>

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

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>30F105C9-681E-420b-A277-7C086EAD8A4E</CurrentDeployID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>30F105C9-681E-420b-A277-7C086EAD8A4E</CurrentDeployID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>30F105C9-681E-420b-A277-7C086EAD8A4E</CurrentDeployID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>30F105C9-681E-420b-A277-7C086EAD8A4E</CurrentDeployID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>1AAFB3E8-5202-4480-A5F0-8D44CD04FA32</CurrentDeployID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<CurrentDeployCmdId>256</CurrentDeployCmdId>
<CurrentDeployID>1AAFB3E8-5202-4480-A5F0-8D44CD04FA32</CurrentDeployID>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{C089C8C0-30E0-4E22-80C0-CE093F111A43}">
<SilverlightMobileCSProjectFlavor>
<FullDeploy>False</FullDeploy>
<DebuggerType>Managed</DebuggerType>
<DebuggerAgentType>Managed</DebuggerAgentType>
<Tombstone>False</Tombstone>
</SilverlightMobileCSProjectFlavor>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

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

@ -0,0 +1,14 @@
using ImageSequencer.Resources;
namespace ImageSequencer
{
/// <summary>
/// Provides access to string resources.
/// </summary>
public class LocalizedStrings
{
private static AppResources _localizedResources = new AppResources();
public AppResources LocalizedResources { get { return _localizedResources; } }
}
}

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

@ -0,0 +1,62 @@
<phone:PhoneApplicationPage
x:Class="ImageSequencer.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- LOCALIZATION NOTE:
To localize the displayed strings copy their values to appropriately named
keys in the app's neutral language resource file (AppResources.resx) then
replace the hard-coded text value between the attributes' quotation marks
with the binding clause whose path points to that string name.
For example:
Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"
This binding points to the template's string resource named "ApplicationTitle".
Adding supported languages in the Project Properties tab will create a
new resx file per language that can carry the translated values of your
UI strings. The binding in these examples will cause the value of the
attributes to be drawn from the .resx file that matches the
CurrentUICulture of the app at run time.
-->
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="{Binding Path=LocalizedResources.MainPage_Preview, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<Canvas x:Name="Canvas" Grid.Row="1" Width="Auto" Height="Auto" ManipulationDelta="ImageElement_ManipulationDelta" ManipulationStarted="ImageElement_ManipulationStarted">
<Image x:Name="ImageElementBackground"/>
<Image x:Name="ImageElement"/>
<Border x:Name="AnimatedAreaIndicator" BorderBrush="White" BorderThickness="2" Visibility="Collapsed"/>
</Canvas>
<!--Uncomment to see an alignment grid to help ensure your controls are
aligned on common boundaries. The image has a top margin of -32px to
account for the System Tray. Set this to 0 (or remove the margin altogether)
if the System Tray is hidden.
Before shipping remove this XAML and the image itself.-->
<!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
</Grid>
</phone:PhoneApplicationPage>

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

@ -0,0 +1,379 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Nokia.Graphics.Imaging;
using ImageSequencer.Resources;
using System.Windows.Threading;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace ImageSequencer
{
public partial class MainPage : PhoneApplicationPage
{
private ApplicationBarIconButton _playButton;
private ApplicationBarIconButton _alignButton;
private ApplicationBarIconButton _frameButton;
private ApplicationBarIconButton _saveButton;
private IReadOnlyList<IImageProvider> _unalignedImageProviders;
private IReadOnlyList<IImageProvider> _alignedImageProviders;
private IReadOnlyList<IImageProvider> _onScreenImageProviders;
private WriteableBitmap _onScreenImage;
private bool _alignEnabled;
private bool _frameEnabled;
private int _animationIndex = 0;
private DispatcherTimer _animationTimer;
private volatile bool _rendering;
private Point _dragStart;
private RectangleGeometry _animatedArea;
private Semaphore _semaphore = new Semaphore(1, 1);
// Constructor
public MainPage()
{
InitializeComponent();
InitializeApplicationBar();
_animationTimer = new DispatcherTimer();
_animationTimer.Tick += AnimationTimer_Tick;
_animationTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
base.OnNavigatingFrom(e);
Stop();
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
String sequenceIdParam;
int sequenceId = 1;
if (NavigationContext.QueryString.TryGetValue("sequenceId", out sequenceIdParam))
{
sequenceId = Convert.ToInt32(sequenceIdParam);
}
List<IImageProvider> imageSequence = CreateImageSequenceFromResources(sequenceId);
SetImageSequence(imageSequence);
}
private void InitializeApplicationBar()
{
ApplicationBar = new ApplicationBar();
_playButton = new ApplicationBarIconButton();
_playButton.IconUri = new Uri("/Assets/appbar.play.png", UriKind.Relative);
_playButton.Text = "play";
_playButton.Click += new EventHandler(PlayButton_Click);
ApplicationBar.Buttons.Add(_playButton);
_alignButton = new ApplicationBarIconButton();
_alignButton.IconUri = new Uri(@"Assets/appbar.align.disabled.png", UriKind.Relative);
_alignButton.Text = "align";
_alignButton.Click += new EventHandler(AlignButton_Click);
ApplicationBar.Buttons.Add(_alignButton);
_frameButton = new ApplicationBarIconButton();
_frameButton.IconUri = new Uri(@"Assets/appbar.frame.disabled.png", UriKind.Relative);
_frameButton.Text = "frame";
_frameButton.Click += new EventHandler(FrameButton_Click);
ApplicationBar.Buttons.Add(_frameButton);
_saveButton = new ApplicationBarIconButton();
_saveButton.IconUri = new Uri(@"Assets/appbar.save.png", UriKind.Relative);
_saveButton.Text = "save";
_saveButton.Click += new EventHandler(SaveButton_Click);
ApplicationBar.Buttons.Add(_saveButton);
ApplicationBarMenuItem aboutMenuItem = new ApplicationBarMenuItem();
aboutMenuItem.Text = "about";
aboutMenuItem.Click += (s, e) => NavigationService.Navigate(new Uri("/AboutPage.xaml", UriKind.Relative));
ApplicationBar.MenuItems.Add(aboutMenuItem);
}
private void SetControlsEnabled(bool enabled)
{
_playButton.IsEnabled = enabled;
_alignButton.IsEnabled = enabled;
_frameButton.IsEnabled = enabled;
_saveButton.IsEnabled = enabled;
}
public async void SetImageSequence(List<IImageProvider> imageProviders)
{
ShowProgressIndicator("Aligning frames");
SetControlsEnabled(false);
_unalignedImageProviders = imageProviders;
_onScreenImageProviders = _unalignedImageProviders;
// Create aligned images
using (ImageAligner imageAligner = new ImageAligner())
{
imageAligner.Sources = _unalignedImageProviders;
imageAligner.ReferenceSource = _unalignedImageProviders[0];
_alignedImageProviders = await imageAligner.AlignAsync();
}
// Create on-screen bitmap for rendering the image providers
IImageProvider imageProvider = _onScreenImageProviders[0];
ImageProviderInfo info = await imageProvider.GetInfoAsync();
int width = (int)info.ImageSize.Width;
int height = (int)info.ImageSize.Height;
_onScreenImage = new WriteableBitmap(width, height);
// Render the first frame of sequence
using (WriteableBitmapRenderer writeableBitmapRenderer = new WriteableBitmapRenderer(imageProvider, _onScreenImage))
{
ImageElement.Source = await writeableBitmapRenderer.RenderAsync();
writeableBitmapRenderer.Source = imageProvider;
writeableBitmapRenderer.WriteableBitmap = new WriteableBitmap(width, height);
ImageElementBackground.Source = await writeableBitmapRenderer.RenderAsync();
}
InitializeAnimatedAreaBasedOnImageDimensions(width, height);
SetControlsEnabled(true);
HideProgressIndicator();
}
private void InitializeAnimatedAreaBasedOnImageDimensions(int imageWidth, int imageHeight)
{
if (_animatedArea == null)
{
_animatedArea = new RectangleGeometry();
int offset = 5;
AnimatedAreaIndicator.Width = Application.Current.Host.Content.ActualWidth - 1 - (offset * 2);
AnimatedAreaIndicator.Height = imageHeight - (offset * 2);
Canvas.SetLeft(AnimatedAreaIndicator, offset);
Canvas.SetTop(AnimatedAreaIndicator, offset);
_animatedArea.Rect = new Rect(0, 0, imageWidth, imageHeight);
}
}
private List<IImageProvider> CreateImageSequenceFromResources(int sequenceId)
{
List<IImageProvider> imageProviders = new List<IImageProvider>();
try
{
int i = 0;
while (true)
{
Uri uri = new Uri(@"Assets/Sequences/sequence." + sequenceId + "." + i + ".jpg", UriKind.Relative);
Stream stream = Application.GetResourceStream(uri).Stream;
StreamImageSource sis = new StreamImageSource(stream);
imageProviders.Add(new StreamImageSource(stream));
i++;
}
}
catch (NullReferenceException ex)
{
// No more images available
}
return imageProviders;
}
private void AnimationTimer_Tick(object sender, EventArgs eventArgs)
{
RenderForeground(_onScreenImageProviders[_animationIndex]);
if (_animationIndex == (_onScreenImageProviders.Count() - 1))
{
_animationIndex = 0;
}
else
{
_animationIndex++;
}
}
private async void RenderForeground(IImageProvider imageProvider)
{
if (!_rendering && _semaphore.WaitOne(100))
{
_rendering = true;
using (WriteableBitmapRenderer writeableBitmapRenderer = new WriteableBitmapRenderer(imageProvider, _onScreenImage))
{
ImageElement.Source = await writeableBitmapRenderer.RenderAsync();
}
_rendering = false;
_semaphore.Release();
}
}
private void PlayButton_Click(object sender, EventArgs e)
{
if (_animationTimer.IsEnabled)
{
Stop();
}
else
{
Play();
}
}
private void Stop()
{
_animationTimer.Stop();
_playButton.IconUri = new Uri(@"Assets/appbar.play.png", UriKind.Relative);
}
private void Play()
{
_animationTimer.Start();
_playButton.IconUri = new Uri(@"Assets/appbar.pause.png", UriKind.Relative);
}
private void AlignButton_Click(object sender, EventArgs e)
{
_alignEnabled = !_alignEnabled;
if (_alignEnabled)
{
_onScreenImageProviders = _alignedImageProviders;
_alignButton.IconUri = new Uri(@"Assets/appbar.align.enabled.png", UriKind.Relative);
}
else
{
_onScreenImageProviders = _unalignedImageProviders;
_alignButton.IconUri = new Uri(@"Assets/appbar.align.disabled.png", UriKind.Relative);
}
RenderForeground(_onScreenImageProviders[_animationIndex]);
}
private void FrameButton_Click(object sender, EventArgs e)
{
_frameEnabled = !_frameEnabled;
AnimatedAreaIndicator.Visibility = _frameEnabled ? Visibility.Visible : Visibility.Collapsed;
if (!_frameEnabled)
{
ImageElement.Clip = null;
_frameButton.IconUri = new Uri(@"Assets/appbar.frame.disabled.png", UriKind.Relative);
}
else
{
ImageElement.Clip = _animatedArea;
_frameButton.IconUri = new Uri(@"Assets/appbar.frame.enabled.png", UriKind.Relative);
}
RenderForeground(_onScreenImageProviders[_animationIndex]);
}
private async void SaveButton_Click(object sender, EventArgs e)
{
_rendering = true;
Stop();
PhoneApplicationPage context = this;
SetControlsEnabled(false);
bool resumePlaybackAfterSave = _animationTimer.IsEnabled;
ShowProgressIndicator("Saving");
_semaphore.WaitOne();
if (_frameEnabled)
{
await GifExporter.Export(_onScreenImageProviders, _animatedArea.Rect);
}
else
{
await GifExporter.Export(_onScreenImageProviders, null);
}
_semaphore.Release();
HideProgressIndicator();
_rendering = false;
if (resumePlaybackAfterSave)
{
Play();
}
SetControlsEnabled(true);
}
private void ShowProgressIndicator(String text)
{
SystemTray.ProgressIndicator = new ProgressIndicator();
SystemTray.ProgressIndicator.Text = text;
SystemTray.ProgressIndicator.IsIndeterminate = true;
SystemTray.ProgressIndicator.IsVisible = true;
}
private void HideProgressIndicator()
{
if (SystemTray.ProgressIndicator != null)
{
SystemTray.ProgressIndicator.IsVisible = false;
}
}
private void ImageElement_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
if (_frameEnabled)
{
double x0 = Math.Min(e.ManipulationOrigin.X, _dragStart.X);
double x1 = Math.Max(e.ManipulationOrigin.X, _dragStart.X);
double y0 = Math.Min(e.ManipulationOrigin.Y, _dragStart.Y);
double y1 = Math.Max(e.ManipulationOrigin.Y, _dragStart.Y);
x0 = Math.Max(x0, 0);
x1 = Math.Min(x1, _onScreenImage.PixelWidth);
y0 = Math.Max(y0, 0);
y1 = Math.Min(y1, _onScreenImage.PixelHeight);
double width = x1 - x0;
double height = y1 - y0;
Rect rect = new Rect(x0, y0, width, height);
Canvas.SetLeft(AnimatedAreaIndicator, rect.X);
Canvas.SetTop(AnimatedAreaIndicator, rect.Y);
AnimatedAreaIndicator.Width = rect.Width;
AnimatedAreaIndicator.Height = rect.Height;
_animatedArea.Rect = rect;
}
}
private void ImageElement_ManipulationStarted(object sender, System.Windows.Input.ManipulationStartedEventArgs e)
{
_dragStart = new Point(e.ManipulationOrigin.X, e.ManipulationOrigin.Y);
}
}
}

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

@ -0,0 +1,6 @@
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Deployment.Parts>
</Deployment.Parts>
</Deployment>

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

@ -0,0 +1,37 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ImageSequencer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImageSequencer")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("35dd6065-db1e-45d6-a76e-b1d2cacc3aaa")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

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

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
<DefaultLanguage xmlns="" code="en-US" />
<App xmlns="" ProductID="{fa534e87-99d0-4f57-a83a-94675f98961c}" Title="Image Sequencer" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="ImageSequencer author" Description="Sample description" Publisher="ImageSequencer" PublisherID="{e1a93e7d-92f1-4ed6-abe6-722ecd93bfef}">
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>
<Tasks>
<DefaultTask Name="_default" NavigationPage="ImagePicker.xaml" />
</Tasks>
<Tokens>
<PrimaryToken TokenID="ImageSequencerToken" TaskName="_default">
<TemplateFlip>
<SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI>
<Count>0</Count>
<BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI>
<Title>ImageSequencer</Title>
<BackContent>
</BackContent>
<BackBackgroundImageURI>
</BackBackgroundImageURI>
<BackTitle>
</BackTitle>
<DeviceLockImageURI>
</DeviceLockImageURI>
<HasLarge>
</HasLarge>
</TemplateFlip>
</PrimaryToken>
</Tokens>
<ScreenResolutions>
<ScreenResolution Name="ID_RESOLUTION_WVGA" />
<ScreenResolution Name="ID_RESOLUTION_WXGA" />
<ScreenResolution Name="ID_RESOLUTION_HD720P" />
</ScreenResolutions>
</App>
</Deployment>

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

@ -0,0 +1,3 @@
For the Windows Phone toolkit make sure that you have
marked the icons in the "Toolkit.Content" folder as content. That way they
can be used as the icons for the ApplicationBar control.

234
ImageSequencer/Resources/AppResources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,234 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ImageSequencer.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class AppResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal AppResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ImageSequencer.Resources.AppResources", typeof(AppResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Image Sequencer is an example application demonstrating the use of Nokia Imaging SDKs Image Aligner and Gif Renderer APIs for creating cinemagraph-style animations in animated GIF format..
/// </summary>
public static string AboutPage_AboutRun {
get {
return ResourceManager.GetString("AboutPage_AboutRun", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to https://github.com/nokia-developer/image-sequencer.
/// </summary>
public static string AboutPage_Hyperlink_Project {
get {
return ResourceManager.GetString("AboutPage_Hyperlink_Project", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to For more information and application source code go to {0}..
/// </summary>
public static string AboutPage_ProjectRun {
get {
return ResourceManager.GetString("AboutPage_ProjectRun", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string AboutPage_Title {
get {
return ResourceManager.GetString("AboutPage_Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Image Sequencer version {0}.
/// </summary>
public static string AboutPage_VersionRun {
get {
return ResourceManager.GetString("AboutPage_VersionRun", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string AppBarAboutMenuItemText {
get {
return ResourceManager.GetString("AppBarAboutMenuItemText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to add.
/// </summary>
public static string AppBarButtonText {
get {
return ResourceManager.GetString("AppBarButtonText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Change example.
/// </summary>
public static string AppBarChangeExampleMenuItemText {
get {
return ResourceManager.GetString("AppBarChangeExampleMenuItemText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Help.
/// </summary>
public static string AppBarHelpMenuItemText {
get {
return ResourceManager.GetString("AppBarHelpMenuItemText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Menu Item.
/// </summary>
public static string AppBarMenuItemText {
get {
return ResourceManager.GetString("AppBarMenuItemText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to IMAGE SEQUENCER.
/// </summary>
public static string ApplicationTitle {
get {
return ResourceManager.GetString("ApplicationTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to saved animated gifs.
/// </summary>
public static string ImagePickerPage_Heading_Saved {
get {
return ResourceManager.GetString("ImagePickerPage_Heading_Saved", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to sequences.
/// </summary>
public static string ImagePickerPage_Heading_Sequences {
get {
return ResourceManager.GetString("ImagePickerPage_Heading_Sequences", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to delete.
/// </summary>
public static string ImagePickerPage_MenuItem_Delete {
get {
return ResourceManager.GetString("ImagePickerPage_MenuItem_Delete", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to no saved files.
/// </summary>
public static string ImagePickerPage_No_Gifs_Message {
get {
return ResourceManager.GetString("ImagePickerPage_No_Gifs_Message", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sequences.
/// </summary>
public static string ImagePickerTitle {
get {
return ResourceManager.GetString("ImagePickerTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to preview.
/// </summary>
public static string MainPage_Preview {
get {
return ResourceManager.GetString("MainPage_Preview", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to LeftToRight.
/// </summary>
public static string ResourceFlowDirection {
get {
return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to en-US.
/// </summary>
public static string ResourceLanguage {
get {
return ResourceManager.GetString("ResourceLanguage", resourceCulture);
}
}
}
}

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

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ResourceFlowDirection" xml:space="preserve">
<value>LeftToRight</value>
<comment>Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language</comment>
</data>
<data name="ResourceLanguage" xml:space="preserve">
<value>en-US</value>
<comment>Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.</comment>
</data>
<data name="ApplicationTitle" xml:space="preserve">
<value>IMAGE SEQUENCER</value>
</data>
<data name="AppBarButtonText" xml:space="preserve">
<value>add</value>
</data>
<data name="AppBarMenuItemText" xml:space="preserve">
<value>Menu Item</value>
</data>
<data name="AppBarAboutMenuItemText" xml:space="preserve">
<value>About</value>
</data>
<data name="AppBarChangeExampleMenuItemText" xml:space="preserve">
<value>Change example</value>
</data>
<data name="AppBarHelpMenuItemText" xml:space="preserve">
<value>Help</value>
</data>
<data name="ImagePickerTitle" xml:space="preserve">
<value>Sequences</value>
</data>
<data name="AboutPage_AboutRun" xml:space="preserve">
<value>Image Sequencer is an example application demonstrating the use of Nokia Imaging SDKs Image Aligner and Gif Renderer APIs for creating cinemagraph-style animations in animated GIF format.</value>
</data>
<data name="AboutPage_Hyperlink_Project" xml:space="preserve">
<value>https://github.com/nokia-developer/image-sequencer</value>
</data>
<data name="AboutPage_ProjectRun" xml:space="preserve">
<value>For more information and application source code go to {0}.</value>
</data>
<data name="AboutPage_Title" xml:space="preserve">
<value>About</value>
</data>
<data name="AboutPage_VersionRun" xml:space="preserve">
<value>Image Sequencer version {0}</value>
</data>
<data name="ImagePickerPage_Heading_Saved" xml:space="preserve">
<value>saved animated gifs</value>
</data>
<data name="ImagePickerPage_Heading_Sequences" xml:space="preserve">
<value>sequences</value>
</data>
<data name="ImagePickerPage_MenuItem_Delete" xml:space="preserve">
<value>delete</value>
</data>
<data name="ImagePickerPage_No_Gifs_Message" xml:space="preserve">
<value>no saved files</value>
</data>
<data name="MainPage_Preview" xml:space="preserve">
<value>preview</value>
</data>
</root>

Двоичные данные
ImageSequencer/Toolkit.Content/ApplicationBar.Add.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 339 B

Двоичные данные
ImageSequencer/Toolkit.Content/ApplicationBar.Cancel.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 350 B

Двоичные данные
ImageSequencer/Toolkit.Content/ApplicationBar.Check.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 414 B

Двоичные данные
ImageSequencer/Toolkit.Content/ApplicationBar.Delete.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 445 B

Двоичные данные
ImageSequencer/Toolkit.Content/ApplicationBar.Select.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 863 B

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NokiaImagingSDK" version="1.2.99" targetFramework="wp80" />
<package id="WPtoolkit" version="4.2013.08.16" targetFramework="wp80" />
</packages>

95
Licence.txt Normal file
Просмотреть файл

@ -0,0 +1,95 @@
Copyright © 2013-2014 Nokia Corporation. All rights reserved.
Nokia, Nokia Developer, and HERE are trademarks and/or registered trademarks of
Nokia Corporation. Other product and company names mentioned herein may be
trademarks or trade names of their respective owners.
License
Subject to the conditions below, you may use, copy, modify and/or merge copies
of this software and associated content and documentation files (the “Software”)
to test, develop, publish, distribute, sub-license and/or sell new software
derived from or incorporating the Software, solely in connection with Nokia
devices. Some of the documentation, content and/or software maybe licensed under
open source software or other licenses. To the extent such documentation,
content and/or software are included, licenses and/or other terms and conditions
shall apply in addition and/or instead of this notice. The exact terms of the
licenses, disclaimers, acknowledgements and notices are reproduced in the
materials provided, or in other obvious locations. No other license to any other
intellectual property rights is granted herein.
This file, unmodified, shall be included with all copies or substantial portions
of the Software that are distributed in source code form.
The Software cannot constitute the primary value of any new software derived
from or incorporating the Software.
Any person dealing with the Software shall not misrepresent the source of the
Software.
Disclaimer
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, QUALITY AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES (INCLUDING,
WITHOUT LIMITATION, DIRECT, SPECIAL, INDIRECT, PUNITIVE, CONSEQUENTIAL,
EXEMPLARY AND/ OR INCIDENTAL DAMAGES) OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Nokia Corporation retains the right to make changes to this document at any
time, without notice.
----
Copyright (c) 1992-2008 The University of Tennessee. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer listed
in this license in the documentation and/or other materials
provided with the distribution.
- Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----
Copyright 1990 - 1998, 2000 by AT&T, Lucent Technologies and Bellcore.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the names of AT&T, Bell Laboratories,
Lucent or Bellcore or any of their entities not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
AT&T, Lucent and Bellcore disclaim all warranties with regard to
this software, including all implied warranties of
merchantability and fitness. In no event shall AT&T, Lucent or
Bellcore be liable for any special, indirect or consequential
damages or any damages whatsoever resulting from loss of use,
data or profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection with the
use or performance of this software.

96
Readme.md Normal file
Просмотреть файл

@ -0,0 +1,96 @@
Image Sequencer
=========
Image Sequencer is an example application demonstrating the use of Nokia Imaging SDKs Image Aligner and Gif Renderer APIs for creating cinemagraph-style animations in animated GIF format. The application has a set of hard coded image sequences to be used for basis of the alignment and animation. User can manipulate the animation by limiting the animated area to a small rectangular section, and by stabilizing the images in order to eliminate camera shake. Animations with still backgrounds and minor repeated movement are commonly called cinemagraphs.
This example application is hosted in GitHub:
https://github.com/nokia-developer/image-sequencer/
For more information on implementation visit Nokia Lumia Developer's Library: http://developer.nokia.com/resources/library/Lumia/nokia-imaging-sdk/sample-projects/image-sequencer.html
Developed with Microsoft Visual Studio Express 2012 for Windows Phone.
Compatible with:
* Windows Phone 8
Tested to work on:
* Nokia Lumia 520
* Nokia Lumia 1020
* Nokia Lumia 1520
Instructions
------------
Make sure you have the following installed:
* Windows 8
* Visual Studio Express 2012 for Windows Phone
* Nuget 2.7 or later
To build and run the sample in emulator
1. Open the SLN file:
File > Open Project, select the solution (.sln postfix) file
2. Select the target 'Emulator' and platform 'x86'.
3. Press F5 to build the project and run it.
If the project does not compile on the first attempt it's possible that you
did not have the required packages yet. With Nuget 2.7 or later the missing
packages are fetched automatically when build process is invoked, so try
building again. If some packages cannot be found there should be an
error stating this in the Output panel in Visual Studio Express.
For more information on deploying and testing applications see:
http://msdn.microsoft.com/library/windowsphone/develop/ff402565(v=vs.105).aspx
About the implementation
------------------------
| Folder | Description |
| ------ | ----------- |
| / | Contains the project file, the license information and this file (README.md) |
| ImageSequencer | Root folder for the implementation files. |
| ImageSequencer/Assets | Graphic assets like icons and tiles. |
| ImageSequencer/Resources | Localized resources. |
| ImageSequencer/Properties | Application property files. |
| ImageSequencer/Toolkit.Content | Graphics assets for Windows Phone toolkit. |
Important classes:
| Class | Description |
| ----- | ----------- |
| MainPage | Page for displaying the preview animation. |
| ImagePicker | Page for displaying hard coded image sequences and saved GIF files in a grid. |
| GifExporter | Utility class for exporting GIF animations. |
Known issues
------------
* Application tombstoning is not supported.
License
-------
See the license text file delivered with this project:
https://github.com/nokia-developer/image-sequencer/blob/master/License.txt
Downloads
---------
| Project | Release | Download |
| ------- | --------| -------- |
| Image Sequencer | v1.0 | [image-sequencer-1.0.zip](https://github.com/nokia-developer/image-sequencer/archive/v1.0.zip) |
Version history
---------------
* 1.0.0.0: First public release of Image Sequencer