windows-runtime

Go to visual states inside a Grid in code behind in Windows Store apps

吃可爱长大的小学妹 提交于 2019-12-18 09:16:34
问题 So my xaml code looks like this - <Grid x:Name="LayoutRoot"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> I can't use the GoToVisualState behavior because I need to do some checks before running this animation. So I guess I will have to call something like GoToState or GoToElementState in code behind. However, ExtendedVisualStateManager doesn't seem to exist in WinRT . I tried using VisualStateManager.GetCustomVisualStateManager(this.LayoutRoot) but it

Can I develop software for Microsoft Surface on Windows 7 machine

我是研究僧i 提交于 2019-12-18 09:02:53
问题 I want to develop a WinRT app for Surface. There is one detail I cannot find anywhere. Will I be able to compile and run on the device using Windows 7 or I need to upgrade to Windows 8? 回答1: No, you can't develop an RT "Modern" style app on Windows 7. You'll need Windows 8 either installed as your main OS or hosted in a VM. 回答2: It is possible to develop with virtual machine(Win8) in windows 7 unfortunately if you want to develop without virtual machine you have to upgrade it 回答3: Not

How save BitmapImage WinRT

早过忘川 提交于 2019-12-18 08:57:52
问题 I have BitmapImage: BitmapImage image = new BitmapImage(); image.SetSource(memStream); I want to save the image to the disk to see in the future. I can not find a work example of how to do this? The second question. I need to get the color of a pixel (like: Color cl=image.GetColorPixel(X,Y) ), how can I do that? Thank you! 回答1: Here's a code I found sometime ago in the web. I'm not sure, but if I rember right it was from the sdk samples or a winrt blog It all comes down to the WritabelBitmap

Perform live video stream processing from CaptureElement & MediaCapture

独自空忆成欢 提交于 2019-12-18 07:15:23
问题 In my Windows 8 Store Application, I tend to perform live video stream processing (Face detection for example). Technique 1 In my previous Windows 7 application, I was able to use the following technique (Camera Face Detection in C# Using Emgu CV (OpenCV in .NET) and WPF) to perform live video processing. The technique was, having a fixed period timer callback, to actively query image buffer from camera object . void timer_Tick(object sender, EventArgs e) { Image<Bgr,Byte> currentFrame =

URI schemes supported in Windows 8 apps

烂漫一生 提交于 2019-12-18 06:54:51
问题 What are the URI schemes supported in Windows 8 apps? I have seen references to ms-appx: and ms-appdata: and some rare mentions of ms-resource: but I could not find any document that would be a list of the schemes (although I thought I have seen one in the past). I am wondering if URL.createObjectURL returns some other schemes, but I can't see a version of it for XAML apps. http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx. Are there any other URI schemes supported in WinRT?

How to create WriteableBitmap from BitmapImage?

十年热恋 提交于 2019-12-18 06:13:38
问题 I could create WriteableBitmap from pictures in Assets. Uri imageUri1 = new Uri("ms-appx:///Assets/sample1.jpg"); WriteableBitmap writeableBmp = await new WriteableBitmap(1, 1).FromContent(imageUri1); but, I can't create WriteableBitmap from Pictures Directory,(I'm using WinRT XAML Toolkit) //open image StorageFolder picturesFolder = KnownFolders.PicturesLibrary; StorageFile file = await picturesFolder.GetFileAsync("sample2.jpg"); var stream = await file.OpenReadAsync(); //create bitmap

Binding the Content property of a ContentControl in WinRT

好久不见. 提交于 2019-12-18 06:06:36
问题 Let's say I have a Windows Store app (targeting Windows 8.1), and on a page there's a ContentControl that looks like this: <ContentControl> <ContentControl.Content> <TextBlock>Hello world</TextBlock> </ContentControl.Content> </ContentControl> This works absolutely fine, but if I try to set the content up as a resource, like this: <Page.Resources> <TextBlock x:Key="TestContent">Hello world</TextBlock> </Page.Resources> <ContentControl Content="{StaticResource TestContent}" /> Everything looks

How to get StackTrace without Exception in Windows Universal 10 App

你说的曾经没有我的故事 提交于 2019-12-18 05:59:31
问题 I know it was possible to use: System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace(); but that seems to not work anymore, as it needs an Exception-Object. 回答1: Try Environment.StackTrace. Just remember to be careful with what your logic afterwards is as stacks can change in unpredictable ways. Some discussion here: https://github.com/dotnet/corefx/issues/1420 回答2: Check out this discussion on .NET Core's github: Where have StackTrace and StackFrame gone?. This class isn't

Creating Bitmap Image from xaml control using WritableBitmapEx

自闭症网瘾萝莉.ら 提交于 2019-12-18 04:21:33
问题 How I can create bitmap image from xaml control using WritableBitmapEx. In my winRT application I need to create a snapshot of my window for implementing Pin to Tile(pinning secondary tile). I found WritableBitmap.render() is missing in winRT. How can I achieve this functionality by using WritableBitmapEx. 回答1: Somehow they missed implementing WriteableBitmap.Render() and while from what I have been hearing it might come in a later version of the SDK, for now your options are to either use

Creating Bitmap Image from xaml control using WritableBitmapEx

守給你的承諾、 提交于 2019-12-18 04:21:33
问题 How I can create bitmap image from xaml control using WritableBitmapEx. In my winRT application I need to create a snapshot of my window for implementing Pin to Tile(pinning secondary tile). I found WritableBitmap.render() is missing in winRT. How can I achieve this functionality by using WritableBitmapEx. 回答1: Somehow they missed implementing WriteableBitmap.Render() and while from what I have been hearing it might come in a later version of the SDK, for now your options are to either use