赞助广告

 

年份

最新评论

评论 RSS

解决MonoGame 3.6 Relase VS2017无法新建项目的BUG

clock 三月 20, 2017 21:58 by author alex
可能MonoGame团队发布3.6的时候比较仓促,安装好官方下载的安装包:http://www.monogame.net/releases/v3.6/MonoGameSetup.exe 最新版的VS2017新建UWP版项目会报错. 解决办法:找到C:\Users\【当前用户】\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C#\MonoGame 下载:WindowsUniversal10.zip (43.45 kb) 替换掉  

UWP开发必备Demo

clock 二月 4, 2017 01:26 by author alex
https://www.microsoft.com/zh-cn/store/p/xaml-ui-controls/9nblggh31bxt https://www.microsoft.com/zh-cn/store/p/uwp-community-toolkit-sample-app/9nblggh4tlcq https://www.microsoft.com/zh-cn/store/p/windows-app-studio-uwp-samples/9nblggh4r0w1 https://github.com/telerik/UI-FOR-UWP

UWP项目提示项目证书过期解决办法

clock 八月 22, 2016 20:58 by author alex
一个UWP项目半年没更新了,今天打开突然提示证书过期无法生成Package。 解决办法:续订证书 在“解决方案资源管理器”中,打开 .appxmanifest 文件的快捷菜单,选择“打开方式”,然后选择“应用程序清单设计器”。 在“应用程序清单设计器”中,选择“打包”选项卡,然后选择“选择证书”按钮。 在“选择证书”对话框中,展开“配置证书”列表,然后选择“创建测试证书”。 在“创建测试证书”对话框中,单击“确定”按钮。

UWP判断设备类型

clock 八月 11, 2016 15:33 by author alex
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Mobile") if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Desktop")

UWP固定窗口尺寸的解决办法

clock 八月 9, 2016 14:21 by author alex
第一步:App.xaml.cs的OnLaunched方法中加入 Window.Current.Activate();执行之前 Size desiredSize = new Size { Width = 800, Height = 480 };            ApplicationView.PreferredLaunchViewSize = desiredSize;            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; ApplicationView.GetForCurrentView().SetPreferredMinSize(desiredSize); 第二部:在Page.xaml.cs的SizeChanged事件中加入 private void GamePage_SizeChanged(object sender, SizeChangedEventArgs e)        {            Size desiredSize = new Size { Width = 800, Height = 480 };            ApplicationView.GetForCurrentView().TryResizeView(desiredSize);           }

UWP WebView加ApplicationData.Current.LocalFolder中的图片

clock 十二月 16, 2015 19:27 by author alex
网络加载的图片通常需要缓存在某个特定存储区内如:ApplicationData.Current.LocalFolder。为了能够缩放显示图片最简单的八方就是用WebView。WebView要显示ApplicationData.Current.LocalFolder中图片需要做转换降图片转换成base64字符串。代码如下: private async Task<string> ConvertImageToBase64()         {             StorageFolder storageFolder = ApplicationData.Current.LocalFolder;             StorageFile pngFile = await storageFolder.GetFileAsync("1.png");             var readStream = await pngFile.OpenAsync(FileAccessMode.Read);             var inputStream = readStream.GetInputStreamAt(0);             var dataReader = new DataReader(inputStream);             var numBytesLoaded = await dataReader.LoadAsync((uint)readStream.Size);             var byteString = new byte[numBytesLoaded];             dataReader.ReadBytes(byteString);             return Convert.ToBase64String(byteString);         } var base64 = await this.ConvertImageToBase64();            string html = "<html><body bgcolor='#000'><img src='data:image/png;base64,"+ base64 + "'/></body></html>";           this.wv.NavigateToString(html);

UWP默认显示一张初始图片,图片下载完成后替换初始图片

clock 十二月 14, 2015 19:04 by author alex
public class DateFormatter : Windows.UI.Xaml.Data.IValueConverter { public async object Convert(object value, Type targetType, object parameter, string language) { string path = value as string; Uri uri = new Uri(path); //try do download Windows.Web.Http.HttpClient httpClient = new Windows.Web.Http.HttpClient(); try { var image = await httpClient.GetAsync(uri); } catch (Exception ex) { return "defaultImage.png"; } return path; } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } <Border Background="#B2262626" Width="315" Height="300" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="2,2,0,0" CornerRadius="15" > <StackPanel Orientation="Vertical" Background="#00262626" > <StackPanel.Resources> <local:ImageConverter x:Key="conv"/> </StackPanel.Resources> <Image Source="{Binding Path=ImagePath, Converter={StaticResource conv}}" Height="220" x:Name="image12" Stretch="Uniform" Margin="0,18,0,0" /> <TextBlock Text="{Binding Title}" Height="38" FontSize="20" Foreground="White" HorizontalAlignment="Center" FontWeight="Bold" Margin="0,10,0,0" TextAlignment="Center" TextWrapping="Wrap"/> </StackPanel> </Border>

《漫画云》UWP——windows 10 通用版正式发布

clock 八月 25, 2015 22:09 by author alex
《漫画云》是一款时下最为流行的云存储漫画阅读器。基于阿里云的开放存储服务OSS开发。支持在线阅读,边下载边阅读,离线阅读。现推出UWP版。支持Windows 10以Windows 10 mobile Windows 10 用户可直接点击下载安装:https://www.microsoft.com/zh-cn/store/apps/%E6%BC%AB%E7%94%BB%E4%BA%91UWP/9NBLGGH1ZBVH

友情链接赞助