uwp

Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 14: 'unable to open database file'.'

给你一囗甜甜゛ 提交于 2020-04-16 05:49:12
问题 I get this error Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 14: 'unable to open database file'.' when I try to run this code, it is a UWP application and I am using sqlite private void btnContinue_Click(object sender, RoutedEventArgs e) { string datasource = @"F:\Curtis\Documents\Capstone\Capstone\Database\BobDB.db"; ; using (SqliteConnection conn = new SqliteConnection(@"Data Source = " + datasource)) { conn.Open(); SqliteCommand command = conn.CreateCommand(); command.CommandText

Rotate image and crop only inside the image: UWP

六月ゝ 毕业季﹏ 提交于 2020-04-16 03:00:30
问题 I have a question. I need to crop a rotated image but the crop rectangle must feet in the image. I'm using Microsoft toolkit for cropping the image but it does not support cropping rotated image, so I added rotation to image and now my problem is to fit the cropping rectangle into the rotated image and not let it get outside of the image. In the images below I'm showing cases. If there is something you need to know to answer this question write it I will add. Not rotated image Rotated image..

如何使用C#创建Windows Webcam应用

本秂侑毒 提交于 2020-04-12 16:31:28
最近想用C#写一个camera的应用。搜索了Google和StackOverflow,发现大部分的sample用了WIA或者DirectShow。WIA和DirectShow都没有直接提供C#接口,所以实现起来也比较复杂。试着运行了几个WIA的工程,在Windows10上还不起作用。发现微软提供了一个MediaCapture类,包含了丰富的C#接口,可用于音频,视频。要用这个类,就需要创建一个UWP工程。这里分享下如何使用MediaCapture的C#接口来获取camera的每一帧数据。 微软示例 微软在GitHub上放了大量的 UWP示例 ,里面包含了各种camera的接口使用方法。 在Android中要获取camera的每一帧数据,可以通过onPreviewCallback的回调函数实现。参考 CameraFrames 这个示例,也可以实现类似的功能。 如何创建Windows Webcam应用 1. 在 package.appxmanifest 中获取webcam权限: 2. 创建image element用于绘制webcam的预览界面: 3. 通过Image Element初始化 FrameRenderer : _frameRenderer = new FrameRenderer(PreviewImage); 4. 初始化MediaCapture对象: // Create a

This submission failed with error code(s) 2003,1201

前提是你 提交于 2020-04-11 06:09:10
问题 We have created a Windows Store app and are running into error code(s) 2003 and 1201 while trying to submit the app to the store. Apparently these errors are not documented in the documentation and there is pretty much absolutely nothing that we can find about these online. Hoping somebody have a knowledge about their resolution and is willing to share it here. 回答1: It looks like error 1201 is a long-standing issue (bug) with the store. From the link above, it looks like some people have been

How to build the Electron application for the Window Store?

狂风中的少年 提交于 2020-04-10 14:55:46
问题 Help build the Electron application for Window Stor. I compiled a simple application for electron. I try according to instructions from the official site. I run the command: electron-windows-store --input-directory C:\Brain ++ --output-directory C:\output\Brain ++ --flatten true --package-version 1.0.0.0 --package-name Brain ++ When assembling it asks the following questions: ? Did you download and install the Desktop App Converter? - I answer yes ? You need to install a development

Detect “suspended” Windows 8/10 process

妖精的绣舞 提交于 2020-04-10 05:41:12
问题 UWP (or "Metro") apps in Windows 8/10 can be suspended when they are not in the foreground. Apps in this state continue to exist but no longer consume CPU time. It looks like this change was introduced to improve performance on low-power/storage devices like tablets and phones. What is the most elegant and simple method to detect a process in this state? I can see 2 possible solutions at the moment: Call NtQuerySystemInformation() and the enumerate each process and each thread. A process is

[UWP]新控件ColorPicker

一个人想着一个人 提交于 2020-04-07 17:57:41
1. 前言 Fall Creators Update中提供了一个新得ColorPicker控件,解决了以前选择颜色只能用Combo Box的窘境。 2. 一个简单的例子 <ColorPicker x:Name="ColorPicker" Margin="5" /> <Grid Margin="5"> <Grid.Background> <SolidColorBrush Color="{x:Bind ColorPicker.Color, Mode=OneWay}" /> </Grid.Background> <TextBlock Text="{x:Bind ColorPicker.Color}" /> </Grid> 如上所示,ColorPiker可以通过在光谱或色轮上拖动滑块,或者在RGB/HSV及十六进制的TextBox中直接输入颜色的数值改变Color属性。 3. 定制ColorPicker ColorPicker提供了很多属性以设置它的外观,下面介绍一些常用的属性。 3.1 ColorSpectrumShape ColorSpectrumShape是定义ColorPicker外观的主要属性。当设置为 ColorSpectrumShape.Box 时显示正方形的光谱,设置为 ColorSpectrumShape.Ring 时显示为圆型的HSV色轮。 3.2 最简化显示

UWP 拖拽文件

时光怂恿深爱的人放手 提交于 2020-04-07 17:57:24
原文: UWP 拖拽文件 桌面环境下的UWP,加入拖拽模式还是会增加用户好感度的。 好了,先看一下我最新研发的【小微识花】吧,演示一下 炫酷,有没有,😂😂😂 而且这识别速度,也是杠杠的~~~ 关于拖拽的实现,一般有两个方法。但是不论哪一个,首先相同的是,要对要对目标设置属性Alldrop=true; 就拿Grid作比方 <Grid AllowDrop="True"> </Grid> 1、原生实现 前台加点东西 <Grid AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop"> 在后台写代码: private async void Grid_Drop(object sender, DragEventArgs e) { var defer = e.GetDeferral(); try { DataPackageView dpv = e.DataView; if (dpv.Contains(StandardDataFormats.StorageItems)) { List<StorageFile> files1 = new List<StorageFile>(); var files = await dpv.GetStorageItemsAsync(); foreach (var item in files) { /

IPC: UWP C# pipe client fails on connect C++ server

ε祈祈猫儿з 提交于 2020-04-07 08:33:06
问题 I am trying to use NamedPipe to communicate between app and service in Win10. APP is developed with C#(UWP),running foreground as Pipe Client. And service is C++ running background as Pipe Server. Now the problem is that the APP couldn't connect the service. I know that MSFT doc said Pipes are only supported within an app-container. But I have tried the following cases: my uwp app VS C#(nonUWP) Server(not in an app-container); C++ Client VS C++ server(same code with service except running in

[UWP]实现Picker控件

本秂侑毒 提交于 2020-04-01 08:45:11
1. 前言 在WPF中,很多打开下拉框(Popup或Flyout)选择一个结果值的控件,除了ComboBox等少数例外,这种控件都以-Picker做名称后缀。因为要打开关闭下拉框和计算下拉框的弹出位置, 这类控件实现起来还挺麻烦的。Silverlight Toolkit中贴心地提供了一个Picker控件,可以作为这类控件的基类,省略了大量代码。 2. 现在的问题 由于UWP中有Flyout,-Picker控件的实现其实算是相当轻松的。如 ColorPicker 的官方文档就介绍了使用Flyout承载ColorPicker的实现代码。但是做起来还是有一些问题: 在有“确定/取消”按钮的Flyout中,即使选择了值,如果没有点击“确定”按钮也不更新结果值。 在Flyout打开的状态,还是希望它所属的按钮有某种已被按下的状态显示,典型的如ComboBox、Extended WPF Toolkit的ColorPicker、WinForm的DateTimePicker,或其它大部分Windows的控件那样: 上面第一点是硬性要求,所有-Picker类控件都会实现这点(偶尔也见到没做好的)。第二点就比较麻烦了,UWP几乎完全没有理会这点。其实WPF/Silverlight时代即已经开始忽略这点UI需求了,但我还是希望可以注意这些UI的细节,毕竟UWP就经常被诟病UI细节缺失。 3.