I m developing an application in WP7,C#. When I launch the photochooser task from my application it shows me all the images from cameraroll, sample pictures and media library. Actually I would like to show every part seperately. For example when I click a button it should show me only images stored in camera roll. When I click another button it should show images only from media library. So please let me know if there is any way to do it.
There is no way to customize the behaviour of the chooser.
If you want different behaviour you'll need to create the UI yourself and get the images via MediaLibrary.Pictures
See an example at http://andy-teamg.blogspot.com/2010/07/windows-phone-7-selecting-device-photos.html
Related
I am trying to make an app on xamarin forms in C# where the user can click on an image and then click on one of seven places and the image will move to the place that was clicked on. I've tried using the TranslateTo functionality of images but that does not seem to work. I also tried using Skia Sharp to create bitmaps becuase they have an intuitive coordinate system but I don't know how to make the SKBitmaps clickable. Is there a way, using skia sharp or not, to make clickable images that can be moved according to an intuitive coordinate system?
It is possible to do it in SkiaSharp, but you have to handle your touch input/gestures on your SKCanvasView - translate them into touch input/gestures to your primitives within SKCanvasView, then change position of your primitives according to your logic and finally refresh your SKCanvasView.
I have a QrCodeCode with used the libary "Zxing". Now i want to Take a picture of the complete screen inside the QrCodeScanner. The Problem is i dont want to open the Camera. I want to create a Button that just takes a picture.
I Tried to use the Media.Plugin but this one leav's my App and that is not my goal.
EDIT
as best zxing just should capture my actual screen.
I am using the Camera code base from
https://github.com/rasmuschristensen/XamarinFormsImageGallery
to open camera, take picture and show in the gallery. In the droid project, after taking the picture, the dialog asks either to keep the photo or discard it using OK and Retry button. Is there anyway, I can avoid this step and go to next step.
Regards
Using the Media plugin you won't be able to do it. This plugin use the standard way of capturing photos in Android which rely on the device actual camera app. The save/retry functionality is part of the Camera App and we don't have access to it as this will be different between Android "providers" (Samsung, LG, Sony, etc)
One way to avoid this is capturing the photo within your own app using the SurfaceView and not using the camera app. I found this example but unfortunately is written in Java but I think it's not too hard to translate into Xamarin/C#.
I am new to Xamarin, and am setting up a Xamarin Forms app, and triggering the device's camera after creating the intent and starting an activity for it.
Pretty much what Xamarin's recipe looks like, but I am using Forms.Context as the Activity object (in order to place all the hookings inside my content page, as opposed to having everything within MainActivity.cs, as in Xamarin's recipe).
It works, the camera is opened.
Intent intent = new Intent(MediaStore.ActionImageCapture);
_file = new File(_dir, String.Format("myPhoto_{0}.jpg", Guid.NewGuid()));
intent.PutExtra(MediaStore.ExtraOutput, Uri.FromFile(_file));
Forms.Context.StartActivity(intent, Bundle.Empty);
The thing is I want the same as the recipe's feature of putting the picture just taken into an ImageView.
The recipe's code generates the UI (and everything else) within MainActivity.cs. I wanted to keep the view declared separately, in its XAML file.
As far as I understand, I need to be able to embed a axml android resource file into the xaml, because code in MainActivity is already Android-ported, and Android can reference views/controls only by their resource id (which are automatically generated after creating the view/ui container as an axml file under Resources/layout folder.
How do I complete this last step in order to have the Take a Picture sample working - coded outside the MainActivity?
Screenshots:
Here's how the Xamarin recipe puts the picture taken into the image viewer.
if you are working with Xamarin Forms and want to take a picture and then display it with an Image - I suggest you use https://github.com/jamesmontemagno/MediaPlugin which allows to let the user take a photo (or pick one from the phone). The result can be set as the ImageSource of an Image.
About the original question, whether you can embedd a native android element into xamarin Forms - you can check out https://developer.xamarin.com/guides/xamarin-forms/user-interface/layouts/add-platform-controls/
I think the right way to deal this is to use DependencyService to access Android native feature, to be specific here, to call the native method of taking a picture and save the picture. If you just want take a picture and display it with Image, you can use DependencyService to implement this platform specific feature and design your layout in xaml, there is no need to embed axml in XAML.
If you want to embed the camera preview in Xaml, the suggested way is to use Custom Renderers to render the interface using the native controls of target platform. It means, you don't need to create a axml in Android project to display camera preview, you can create a custom renderer (control/ view) in PCL, and implement this control in your Android project. There is official doc and demo which guides us to implement a view to display the camera preview.
I am still very new to C# and I'm developing an application that holds all of my textures which are in a png format.
I am at a stage where I need to be able to show multiple textures within 1 picture box, could I ask how this is achieved?
you can do it by making array of images you want to show.
Consider this example and tutorial here to learn about it.