How to put a Binding on a video - winrt-xaml

I've stored a video to a BitmapImage and want the user to be able to replay it. However, when I run my program it treats my BitmapImage like it's empty when it's not. I've tried doing the same thing with a picture saved to a BitmapImage and any picture will appear and fill the screen like I tell it to, but videos just don't show up. Why is this?

You cant store a video in a bitmapimage. Videos should be stored in StorageFile.

Use in your dictionary:
<MediaElement x:Key="Video1" Source="ms-appx:///Assets/Videos/Video.mp4"/
and then on page:
<MediaElement Source="{StaticResource Video1}"/>
remember to start width AutoPlay="True".

Related

How to prevent user from taking screenshot of MPMovieplayerController contents?

I've just used HBONow and found that when I want to take screenshot of the movie(just like GOT),the content of the HBONow player will become black. then I know that this is the method of prevent user from share contents.
The question is,I've used MPMoviePlayerController or AVPlayerViewController to play my own contents, how can I do the same thing as HBO and prevent user from taking screenshots?
After search, I've found what they use for content protecting
see thisreddit link
and
FPS official document

How can I capture an Image for post processing in OSG

I need to capture an Image from my viewer and need to do some post processing and display it back on it.
Right now am more interested in the first part of it. That is to capture Image from the viewer.
While going through the OSG I came across ScreenCaptureHandler.
But am not able to get an Image out of it.
I am still working to get it done but in case any of you have any other way of how it can be done or an Example for screencapturehandler that you can share.
To capture the rendered view into an image I use a custom osg::Camera::DrawCallback.
To capture the view at any point, set the drawCallback on the camera, force rendering, restore to a NULL callback.
Notice that the following code is part of a member function of a custom viewer (that's probably not your case):
osgViewer::View::getCamera()->setFinalDrawCallback(new ViewCaptureCallback(img));
osgViewer::Viewer::renderingTraversals();
osgViewer::View::getCamera()->setFinalDrawCallback(NULL);
The ViewCaptureCallback basically uses image->readPixels() to read from the backbuffer.
glReadBuffer( GL_BACK );
osg::GraphicsContext* gc = renderInfo.getState()->getGraphicsContext();
// Here you should process the backbuffer's size and format
image->readPixels(0, 0, gc->getTraits()->width, gc->getTraits()->height, pixelFormat, GL_UNSIGNED_BYTE);
Hope it helps

UIImagePickerController to set a background image, not working

I am writing an iPhone app, where the user should be able to choose, an in-app background picture from his own photo album.
I am trying to enable this feature using a UIImagePickerController.
At this point I get the the box asking me to choose a picture and I save the picture.
But after that, when I want to use the image chosen as background, with this kind of code (which is the same as how I set the default background at start):
UIColor *backGrndPict=[[UIColor alloc] initWithPatternImage:
[UIImage imageNamed:pngPath]];
self.view.backgroundColor=backGrndPict;
Nothing works. I just get a white background.
Thanks for any tip.
Michel,
Just for clarification, are you saving the picture that the user selects as a .png file or in an UIImage?
If you did use the UIImage method, try double checking the retain count of the UIImage. Again, it may not be as simple as this, but that is what I did with my app and was getting the exact same issue.
If you did save it as a .png file, did you do an error check? Also, I have the "Applications" folder for my iOS simulator loaded on the screen perchance I have to verify both the availability and the integrity of the file in question.
Also, I tend to slip on the path sometimes too. I have have messed up the path one too many times by forgetting to use the saved path (the file that my app saved, almost always under the documents folder) vs. the default bundle path for the app which is where the bundled images are saved.
Hope it helps.

Byte Array to Image then display in DialogBox C++

as the title says, ive got this packet which contains the whole JPEG image file, so i've put that into a byte array, now how do i convert this to an image and then display it.
I dont need to save it, just display it then once the user enters an answer, delete it.
If you're wondering, its a captcha image. Something like what JDownloader does with captchas.
edit: i meant how can i display images in dialog boxes
You can use the GDI+ Image class to do this, using an IStream of your JPEG in memory as the input, which can be done using ISequentialStream::Read.

Web image display in iPhone app

I am new to developing on the iPhone so am sorry if this is an easy question, but it has had me stumped for a little while.
Basically the app displays data retrieved from an XML feed. In that feed is an element that contains the path to an image. eg http://www.myserver.com/myimage.jpeg.
I want to be able to display that image in the list view of my iPhone app.
Most importantly, I don't want to stop the list drawing for each image, the rest of the data should be displayed immediately and then each image downloads and displays as quickly as data speed etc make it available.
What is the best way of downloading that image and displaying it?
Ideally can someone point to some working example code.
Thanks
Stephen
Displaying the image: you could create a UIWebView and just point it to the path - and then it's fully zoomable too.
Displaying in the list view:
//Somehow download your image...
cell.image = Your Image

Resources