This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tobiichiamane
committed
Apr 21, 2019
1 parent
db18d9e
commit a483ee3
Showing
10 changed files
with
208 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Page | ||
x:Class="PixivFSUWP.BigImage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:PixivFSUWP" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" Loaded="Page_Loaded" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid x:Name="layoutRoot"> | ||
<ScrollViewer ZoomMode="Enabled" | ||
HorizontalContentAlignment="Center" | ||
VerticalContentAlignment="Center" | ||
HorizontalScrollBarVisibility="Auto" | ||
VerticalScrollBarVisibility="Auto" | ||
HorizontalScrollMode="Enabled" | ||
VerticalScrollMode="Enabled"> | ||
<Grid> | ||
<Image x:Name="mainImg"/> | ||
<InkCanvas x:Name="mainCanvas"/> | ||
</Grid> | ||
</ScrollViewer> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.ApplicationModel.Core; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI; | ||
using Windows.UI.ViewManagement; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板 | ||
|
||
namespace PixivFSUWP | ||
{ | ||
/// <summary> | ||
/// 可用于自身或导航至 Frame 内部的空白页。 | ||
/// </summary> | ||
public sealed partial class BigImage : Page | ||
{ | ||
Data.BigImageDetail parameter; | ||
public BigImage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
protected override async void OnNavigatedTo(NavigationEventArgs e) | ||
{ | ||
parameter = e.Parameter as Data.BigImageDetail; | ||
//CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; | ||
var view = ApplicationView.GetForCurrentView(); | ||
view.TitleBar.ButtonBackgroundColor = Colors.Transparent; | ||
view.TitleBar.ButtonForegroundColor = Colors.White; | ||
view.TitleBar.ButtonForegroundColor = Colors.Black; | ||
view.TitleBar.ButtonInactiveForegroundColor = Colors.Gray; | ||
view.Title = string.Format("{0} by {1} - {2}x{3}", | ||
parameter.Title, parameter.Author, | ||
parameter.Width, parameter.Height); | ||
mainImg.Source = await Data.OverAll.BytesToImage(parameter.Image, parameter.Width, parameter.Height); | ||
base.OnNavigatedTo(e); | ||
} | ||
|
||
private void Page_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
mainImg.MaxHeight = Frame.ActualHeight; | ||
mainImg.MaxWidth = Frame.ActualWidth; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.UI.Xaml.Media.Imaging; | ||
|
||
namespace PixivFSUWP.Data | ||
{ | ||
public class BigImageDetail | ||
{ | ||
public string Title { get; set; } | ||
public string Author { get; set; } | ||
public int Width { get; set; } | ||
public int Height { get; set; } | ||
public byte[] Image { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters