windows-runtime

How do I grab frames from a video stream on Windows 8 modern apps?

自作多情 提交于 2019-12-31 12:08:28
问题 I am trying to extract images out of a mp4 video stream. After looking stuff up, it seems like the proper way of doing that is using Media Foundations in C++ and open the frame/read stuff out of it. There's very little by way of documentation and samples, but after some digging, it seems like some people have had success in doing this by reading frames into a texture and copying the content of that texture to a memory-readable texture (I am not even sure if I am using the correct terms here).

Windows 8, C++ and Metro GUI samples?

给你一囗甜甜゛ 提交于 2019-12-31 08:29:07
问题 So I look at this (Windows build keynote 1:42:56) And I just do not get it - what I can use to create GUI from C++ and/or GUI language that will be capable to call functions from my C++ code? HTML, XAML or what? And where to see code sample of doing markup call code and code create GUI sample with C++ for Windows 8 Metro apps? 回答1: Sample code in C++ and other languages is at http://code.msdn.microsoft.com/windowsapps. You can take a look at how it's done. 回答2: If you want to call C++ code

Setting a wallpaper in background task

你说的曾经没有我的故事 提交于 2019-12-31 06:42:27
问题 I want to get all images from a storage folder in background task. Firstly registered a background task in app_entering background method. I am also able to debug Run method,but none of the await methods are working- public void Run(IBackgroundTaskInstance taskInstance) { var differal = taskInstance.GetDeferral(); UpdateUI(); differal.Complete(); } public async void UpdateUI() { StorageFolder folder = await KnownFolders.PicturesLibrary.GetFolderAsync("Wall_e_photos")//here execution stops and

Serializing a BitmapImage in WinRT

淺唱寂寞╮ 提交于 2019-12-31 05:30:05
问题 public static async Task SaveFileAsync(string FileName, T data) { MemoryStream memStream = new MemoryStream(); DataContractSerializer serializer = new DataContractSerializer(typeof(T)); serializer.WriteObject(memStream, data); StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(FileName, CreationCollisionOption.ReplaceExisting); using (Stream stream = await file.OpenStreamForWriteAsync()) { memStream.Seek(0, SeekOrigin.Begin); await memStream.CopyToAsync(stream);

Rendering not working with MediaElement windows RT

会有一股神秘感。 提交于 2019-12-31 05:17:12
问题 I need to take thumbnail from Video playing with MediaElement For this i learn there is RenderTargetBitmap in windows 8.1 API RenderTargetBitmap a = new RenderTargetBitmap(); await a.RenderAsync(myMedia); thumb.Source = a; and second way i got with help of WinRTXamlToolkit.Composition toolkit which do rendring with WriteableBitmapRenderExtensions class WriteableBitmap w = await WriteableBitmapRenderExtensions.Render(myMedia); thumb.Source = w; Both these methods are working with all UIElement

Marshalling “EGLRenderResolutionScaleProperty” to ANGLE from C# using P/Invoke

夙愿已清 提交于 2019-12-31 04:37:07
问题 I am trying to get ANGLE working in C# using P/Invoke. Basically, I am creating a simple 2D surface, and then passing that off to skia (using SkiaSharp). Everything is working and all that, but I am having a problem marshalling PropertySet to the unmanaged code. This bit works fine: // the properties var props = new PropertySet(); props.Add("EGLNativeWindowTypeProperty", swapChainPanel); // the surface attributes int[] surfaceAttrs = { EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE, EGL

Windows Runtime: How to set image in a ellipse shape button?

徘徊边缘 提交于 2019-12-31 04:27:07
问题 <Button x:Name="btnProfilePicture" HorizontalAlignment="Center" Click="btnProfilePicture_Click"> <Button.Template> <ControlTemplate> <Ellipse x:Name="ellipsePicture" Fill="Turquoise" Width="150" Height="150" Stroke="White" StrokeThickness="10"> </Ellipse> </ControlTemplate> </Button.Template> </Button > I have a button in ellipse shape, with color fill by default. I want to change the fill to an image in code-behind in runtime. How can I do this? More info: I tried to set the ellipse fill by

Sending an email in metro application?

泪湿孤枕 提交于 2019-12-31 03:52:47
问题 I want to send an email with some content as a body in my metro app :- 1)since system.net.mail is not supported in metro application i have decided to use this :- using Windows.System; //starts the default mail app with a subject, cc, bcc, and body Launcher.LaunchUriAsync(new Uri("mailto:windows8devs@almostbeta.com?subject=Code Request&cc=kevin@almostbeta.com&bcc=admin@almostbeta.com&body=Hi!")); but my doubt is that i want to generate a content as a body to this email , but this content is

Inter application communication in WinRT

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 03:41:31
问题 There are two WinRT applications (C#/Xaml if it matters) on Windows 8. The first app should receive and send some data into the second one. What the best way to do that? Can WCF be used? EDIT: The first app knows about the second one. Actually the second app is an authentication server, it provides only one method to get a token. 回答1: Not possible, this requires loopback support. Something you can only turn on for testing , you cannot rely on it on your user's machine. The CheckNetIsolation

Convert BitmapImage to byte[] array in Windows Phone 8.1 Runtime

天涯浪子 提交于 2019-12-31 02:53:14
问题 There are a few samples to do this but they are for Windows Phone 8.0 or 8.1 Silverlight. But how can you do this for Windows Phone 8.1 Runtime? 回答1: You cannot extract the pixels from a Windows.UI.Xaml.Media.Imaging.BitmapImage. The most general solution is to use a WriteableBitmap instead of a BitmapImage. These classes are both BitmapSources and can be used almost interchangeably. The WriteableBitmap provides access to its pixel data via its PixelBuffer property: byte[] pixelArray =