uwp

[UWP]使用PointLight并实现动画效果

拈花ヽ惹草 提交于 2019-12-30 23:36:16
1. Composition Lighting UWP中的Composition Light是一组可以创建3D光照的API,它明明十分好玩而且强大, 但博客园几乎没有相关文章(用 UWP 或 pointlight 做关键字只能找到我自己的文章),这篇文章就 来介绍Composition Lighting的入门知识。 Composition Light有四种类型: AmbientLight ,发出出现的非定向光源的光源反射场景中的所有内容。 DistantLight ,无限大远处的光源的发光的一个方向。 如 sun。 PointLight ,发出的所有方向光的光点源。 如灯泡。 SpotLight ,发出的光线的内部和外部圆锥光源。 如手电筒。 这四种类型的它们Composition Light分别使用Compositor的 CreateXXXXXLight() 函数创建,例如: var pointLight = compositor.CreatePointLight(); 上图分别是SpotLight和PointLight的效果(其它两个截图没什么好看的)。 2. 使用PointLight 使用PointLight最基础的例子是WindowsCompositionSamples中的 TextShimmer 例子,下面用这个例子的代码介绍如何使用PointLight。

Drag, drop and resize images on Canvas

走远了吗. 提交于 2019-12-30 14:12:27
问题 I want to create a drag and drop interface in my Universal Windows App. Users will be able to drag and drop images from a ListView (or similar) to a Canvas where they can resize and move the images. I have found how to move the images, but now I can't seem to find a way to accept multitouch, find the appropriate image to resize, and resize the image itself. Is there a simple way to do this? 回答1: This is what I eventually went with: using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using

bring uwp app in foreground

怎甘沉沦 提交于 2019-12-30 13:32:54
问题 I found posts about how to detect if the app runs in foreground. Is it possible to bring my UWP app to the foreground (when it runs in the background) somehow? Maybe it's possible with a background task? 回答1: This is how I got it to work for UWP running on Windows 10: In your manifest create a protocol declaration (insert Name and Display name meaningful to your app) In App settings for the protocol change the Desired view to Use Half Use the Launcher to call your registered protocol whenever

bring uwp app in foreground

北城以北 提交于 2019-12-30 13:32:14
问题 I found posts about how to detect if the app runs in foreground. Is it possible to bring my UWP app to the foreground (when it runs in the background) somehow? Maybe it's possible with a background task? 回答1: This is how I got it to work for UWP running on Windows 10: In your manifest create a protocol declaration (insert Name and Display name meaningful to your app) In App settings for the protocol change the Desired view to Use Half Use the Launcher to call your registered protocol whenever

Center aligning GridView items in last row

我是研究僧i 提交于 2019-12-30 11:31:33
问题 I want to implement a GridView which takes 3 items in a row, and if the number of items are 2 in last row, then the last row items should be aligned center instead of being left-aligned. Here are a couple of images to explain what I want to achieve. Currently my implementation looks like . And this is what I want to achieve. Any help would be appreciated. 回答1: There are many ways realizing the feature that you mentioned. To summarize it, you need to inherit GridView and override

Socket Communication on UWP (Universal Windows Platform)

試著忘記壹切 提交于 2019-12-30 07:43:09
问题 What I want to implement is UWP-based programs and other C# programs are trying to communicate with Socket on one PC (Windows 10 Pro). I have tried to make UDP communication module using DatagramSocket class and TCP communication module using StreamSocket class (https://msdn.microsoft.com/ko-kr/windows/uwp/networking/sockets) and it seems that module is not working properly. In the Windows UWP example program and some developer forums, I saw a statement that it is impossible that socket

Get text from txt file on the internet

半腔热情 提交于 2019-12-30 07:24:07
问题 I have a uwp and i need to get text from a txt file saved on the internet to string I have a problem with download the file and get the text to string Here's my code: var webRequest = WebRequest.Create(@"http://yourUrl"); using (var response = webRequest.GetResponse()) using (var content = response.GetResponseStream()) using (var reader = new StreamReader(content)) { var strContent = reader.ReadToEnd(); } can anyone help me? 回答1: var url = "http://example.com/abc.txt"; var textFromFile = (new

Use google credentials to login into UWP C# app

孤街浪徒 提交于 2019-12-30 06:37:09
问题 I'm trying to make a login for a UWP app that I'm developing for a client that has a @<theircompay>.com email that uses G Suite. It doesn't have to access any user data, they just want it as an authentication so that only people that have a company email can access the app. It would be great if they could login from within the app without having to use a web browser, and even better if it could remember them so they wouldn't have to login every single time. I've been looking at OAuth 2.0 and

SOS Debugging Extensions for Microsoft.NET.CoreRuntime

风格不统一 提交于 2019-12-30 05:23:28
问题 While trying to track down a fatal null pointer language exceptions (c000027b) in a UWP C#/XAML store project with WinDbg, I cannot get to the CLR Exception object because of a missing SOS debugging extention for Microsoft.NET.CoreRuntime. I was unable to locate a matching sos.dll. What am I missing? Note: The app crash is reproducible, but only happens when not debugging. So running the project under the Visual Studio debugger is unfortunately not a solutions in this case. [...] 0:009> dt

Moving Image in ScrollViewer (UWP)

别来无恙 提交于 2019-12-30 05:08:06
问题 I've got a Image in Scrollviewer ... <ScrollViewer x:Name="Scrollster" ZoomMode="Enabled" MinZoomFactor="1" MaxZoomFactor="4" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" ManipulationMode="All"> <Image x:Name="Img" Source="{x:Bind ImgSource}" Stretch="UniformToFill" PointerPressed="Img_PointerPressed"/> </ScrollViewer> I want to move Image when I drag image with Mouse Pointer! I tried: private void Img_PointerPressed(object sender,PointerRoutedEventArgs e) { var p =