Creation of BitmapSource objects no longer possible in WinRT apps? - windows-runtime

BitmapSource does not have the Create method in the .NET API for Windows Store apps. I assume dynamically creating images is no longer possible (if so, why?). Or does anyone know how to create images programmatically in a Windows Store app?

See http://winrtxamltoolkit.codeplex.com/ and the Imaging extensions.

WriteableBitmap is the answer. It has a constructor that takes with and height and allows writing to it and updating.

Related

Communicating between the desktop Apps and Windows store app

I want to share an image file between Desktop application and the windows store application. What is the best way to do the communication between the desktop app and the windows store app.I have tried creating the shared memory between the apps, but i think this is not possible( Reference ).
It's not possible to communicate and share date directly, except launching via protocol handler. As Aniruddha already said sharing via Filesystem (e.g. pictures library) is a convenient way to do it.
If you are on Windows 8.1 and don't have the requirement to put your application in the public Windows Store there's another option:
Windows Runtime Brokered Components. This is quite awesome stuff. It allows you to freely communicate between a Windows Store App and any other application. It is documented here: https://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx
The setup isn't exactly easy but it is very powerful. Keep in mind that you won't get this app published into the public Windows store, if you're using brokered components.
I haven't tried Brokered Components on Windows 10 yet, I'm not sure if this is still supported.

trying to load page with WinJS controls into IE 10.0

From VS2012, I right click on default.html page and choose to run this page in IE (10.0). Problem is that any WinJS controls that I have on the page aren't been displayed. I get a warning about Allowing ActiveX script where I allow to run the ActiveX script. Can windows 8 store app build with javascript should be able to run in IE 10.0?
WinJS is not meant to be a browser based application.
Windows Store apps are meant solely to be run in the WinRT environment.
If you explore WinJS, you'll see it calls into the Windows namespace which are the actual WinRT JavaScript projections - ie the translations from the C++ COM based API into in this case JavaScript.
So then the next question is what are you trying to accomplish? If you have a common code base to run in the browser, then don't have dependencies on WinJS or the built in style sheets.
Remember though,Windows Store apps have specific design recommendations that may not be the best for a browser based application, although thats your call.
If you post separately what you are trying to accomplish though to run in the browser and in your Windows Store app, we can try to help you make the best design decision.
Since that is a separate question than what's provided here, I'd say sign up for App Builder http://aka.ms/stackbuilder and check out the free design guidance you get from there, plus check my profile, I'm available for free time each week (oHours) and would be happy to go over this with you via skype, phone, etc
Unfortunately you can't, firstly due to licence of winjs (details here: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/dbdabf29-206d-4d93-a491-b5e8fcd6a920/) and secondly because winjs is rather tightly coupled with winrt.
One alternative I found is http://www.bluesky.io/ which allows you to run winjs compatible code in browser. Not sure how it works in practice though.

How to integrate AIR with Windows superbar?

I'm making a sort of batch processing application with Flex and AIR and I want to illustrate the progress of the batch. I'm using mx:ProgressBar, but this is not enough for me, I want to see the progress in the Windows superbar, pretty much similar to when I'm copying files.
The only thing I found is this native extension, but i don't want to use native extensions.
Does AIR provide any API for this?
Since you're trying to access native functionality, you will have to use native extensions. There's no way around it. commented by RIAStar.

Capture screen of Windows store App

Is it possible to capture the contents of running Windows store app? I need to capture the entire screen or a user defined rectangular area.
The application will provide share option
When the application is running and share option is selected, I want to get the screen shot periodically say 4 times in a second
This screen shot image will be posted to server, which will store the same
It's now possible in Windows 8.1 to capture the screen of a Store App. You need to use the RenderTargetBitmap class.
You can find an example here:
http://mariusbancila.ro/blog/2013/11/05/render-the-screen-of-a-windows-store-app-to-a-bitmap-in-windows-8-1/
Hope it helps.
You can't capture screen programatically. See the below threads from MSDN.
Programmatically take snap shot Windows RT.
How to capture screen in Metro app?
There is no built-in mechanism to render Windows 8 XAML UI to a bitmap in Windows 8.0. Depending on how complicated your UI is you could implement your own composition engine to render your UI to a bitmap using Direct2D or use the WinRT XAML Toolkit WriteableBitmap.Render() method implementation which has a limited support for doing what you ask (it doesn't render all types of controls, doesn't support RenderTransform, etc.). You could update it though to add support for the missing features.
Windows 8.1 APIs include the new 'RenderTargetBitmap' class that allows to render to a bitmap with its RenderAsync methods.

How can I write my Windows Phone app to use wp 8 features but be backward compatible with wp 7

I'd like to use some wp8-specific apis but I don't want to drop support for wp7 in my app.
In particular, I'd like to do the following:
if(isWindowsPhone8OrNewer)
{
var sp = new SpeechSynthesizer();
sp.SpeakTextAsync("test");
}
What is the best way to access the wp8 api and not have to maintain two separate versions of the app?
For example, do I need to use reflection?
Can someone please provide an example?
Many thanks!
swine
The answer to the question is simple: Simply don't upgrade your app to using the WP8, and you'll be free to continue maintaining your WP7 app using the WP8 SDK in VS2012.
If you want to split up your application, and start utilizing the new UI features such as the native LongListSelector, you would want to separate your UI and view logic (ViewModels, etc.) into separate assemblies.
There is a nice project for accessing some WP8 API from your WP7 project, if you are running on WP8 device:
http://mangopollo.codeplex.com/
If you want to use other new WP8 features, you have to upgrade your project to WP8.