windows-runtime

WP8.1 HttpClient Stream got only 65536 bytes data

十年热恋 提交于 2019-12-23 16:32:35
问题 I am trying write a real-time flv stream demuxer on windows-runtime, for win8.1 and wp8.1's MediaElement. I've already finish the demux code, flv files can be correctly demuxed into h264 and aac tag-datas. When I was trying to play network files and streams, I got a very strange network problem: The same code, run under win8.1, all good, whatever files or network streams (proves demux code is ok); run under wp8.1 (real phone or emulator), files are good, network streams are bad - no matter

How to declare interface that inherits from IClosable/IDisposable

两盒软妹~` 提交于 2019-12-23 15:42:23
问题 After being told in this question that my preferred solution was impossible, I'm now trying to implement a workaround. Instead of declaring my interface that inherits from IClosable in C++/CX, I'm declaring it in raw IDL. But that doesn't seem to work either. I've created an IDL file FooSpace.idl containing import "inspectable.idl"; import "Windows.Foundation.idl"; namespace FooSpace { [uuid(01234567-89AB-CDEF-FEDC-BA9876543210)] [version(42)] interface Foo : IInspectable requires Windows

Setting Image source programatically in Metro app, Image doesn't appear

☆樱花仙子☆ 提交于 2019-12-23 15:42:13
问题 I have a main page and a camera page in my application. The main page has an image that does not have its source set and a button. If you click the button, it will take you to the camera page. On the camera page, I capture an image and save it in the pictures library on the tablet and then navigate back to the main page where I would like to set the source of the image to the image I just captured and saved in my pictures library. Here is my relevant code. MainPage.xaml <Image x:Name=

How can I disable the arrows on a FlipView?

大城市里の小女人 提交于 2019-12-23 13:32:20
问题 I have a FlipView, which is working great, but I'd like to disable the < and > arrows that fade in while scrolling. 回答1: I think that would break the scenario for keyboard/mouse users, no? You could remove the buttons from the control template if you really need to. 回答2: Here are 2 options. Option 1. In FlipView.Loaded event dynamically remove the arrow buttons. private void flipView_Loaded(object sender, RoutedEventArgs e) { Grid grid = (Grid)VisualTreeHelper.GetChild(flipView, 0); for (int

How can I disable the arrows on a FlipView?

不羁的心 提交于 2019-12-23 13:32:11
问题 I have a FlipView, which is working great, but I'd like to disable the < and > arrows that fade in while scrolling. 回答1: I think that would break the scenario for keyboard/mouse users, no? You could remove the buttons from the control template if you really need to. 回答2: Here are 2 options. Option 1. In FlipView.Loaded event dynamically remove the arrow buttons. private void flipView_Loaded(object sender, RoutedEventArgs e) { Grid grid = (Grid)VisualTreeHelper.GetChild(flipView, 0); for (int

CoreWindow::GetCurrentForThread() always NULL

≡放荡痞女 提交于 2019-12-23 13:13:28
问题 I'm trying to get the CoreDispatcher in C++ on Windows Phone 8 so that I can submit work items to the UI thread Dispatcher so I can update UI elements on the UI thread. However, when I call CoreWindow::GetCurrentForThread() , I get NULL back. In the documentation it states that this is supported on WP8. As long as I'm getting NULL for the current Window, I can't get the current Dispatcher from it; does anyone know how to get the current Dispatcher on WP8? 回答1: CoreWindow::GetForCurrentThread(

Windows 8 app (html & Javascript) : alternate way to show image from picture library (other that file picker)

感情迁移 提交于 2019-12-23 13:03:46
问题 I have been trying to create an alternate method to get and show images in listview (I mean other than file picker) as the app is already taking too much time to load and process. It turns out I've been missing one single point all this time..that img doesn't take absolute paths as source (src). Code I've used is : var pictureLibrary = Windows.Storage.KnownFolders.picturesLibrary; pictureLibrary.getFilesAsync(query).then(function (items) {....}; Well, the data binding is correct and the

Can't create dependency property in a UserControl in a Windows Runtime Component library

依然范特西╮ 提交于 2019-12-23 12:13:09
问题 I wanted to created data bindable property inside a user control. And this user control contains inside a "Windows Runtime Component" project. I used below code to create property. public MyItem CurrentItem { get { return (MyItem)GetValue(CurrentItemProperty); } set { SetValue(CurrentItemProperty, value); } } // Using a DependencyProperty as the backing store for CurrentItem. // This enables animation, styling, binding, etc... public static readonly DependencyProperty CurrentItemProperty =

How do I find out if a file is already created in a StorageFolder

北城余情 提交于 2019-12-23 09:49:05
问题 If I have a metro StorageFolder, I can get a file using GetFileAsync(fileName). However, how do I know if the file exists in the first place? Right now, I catch an exception but it does not seem like the right thing to do. 回答1: According to Microsoft, they want us to catch the exception. The reasoning they gave me is that them providing a File.Exists API would open you up to race conditions where the file's existance might change between when you check and when you try to use the file.

BitmapImage returns 0 for PixelWidth and PixelHeight

时间秒杀一切 提交于 2019-12-23 08:13:25
问题 I'm trying to do a super simple thing : get the size of an image. So I create my BitmapImage but I'm getting 0 when I try to access the PixelWidth and PixelHeight . How can I accomplish that please? EDIT: (added sample code) I'm just doing: var baseUri = new Uri("ms-appx:///"); var bitmapImage = new BitmapImage(new Uri(baseUri, "Assets/Logo.png")); MyImage.Source = bitmapImage; Debug.WriteLine("Width: " + bitmapImage.PixelWidth + " Height: " + bitmapImage.PixelHeight); In the console, I get: