CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.MaxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.HighestAvailable;
StorageFile file = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
This shows up the camera, and I am able to preview and click to capture the image. The captured image is shown in another window over the original camera image windows. I am able to crop and click to save this captured image.
However, right after I click save, the image is getting stretched, and after it is saved, it remains stretched as well. In essence, the image I capture and save is being stretched,
I tried removing the crop and it works fine, but I need the crop feature as well.
What am I doing wrong? Should I be using any other values for these settings?
This was working fine till December if I remember correctly.
Any help here is appreciated. Screenshots added below
, ,
Related
This is for developing a Windows 10 application.
I am trying to capture an image using the camera, edit the captured image,
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.AllowCropping = true;
captureUI.PhotoSettings.CroppedAspectRatio = new Windows.Foundation.Size(4, 3);
//captureUI.PhotoSettings.CroppedSizeInPixels = new Windows.Foundation.Size(0,0);
captureUI.PhotoSettings.MaxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.HighestAvailable;
StorageFile file = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
This shows up the camera, and I am able to preview and click to capture the image. The captured image is shown in another window over the original camera image windows. I am able to crop and click to save this captured image.
However, right after I click save, the image is getting stretched, and after it is saved, it remains stretched as well. In essence, the image I capture and save is being stretched,
I tried changing the CroppedSizeInPixels with size from (0,0) to (200,200). And also various CroppedAspectRatios.
What am I doing wrong? Should I be using any other values for these settings?
Any help here is appreciated.
Many topics about his, but still haven't found my solution:
I'm working with Xamarin Studio: Within my launch screen I have one view with two ImageViews. The first image .jpg is being set to fill parent vertically and horizontally. The image that should go on top of the background image is a .png (transparent background with white lettering).
I have my BuildAction set to BundleResource and the image source of .png does not show the extension, just the image name. The problem is that the .png image is not showing up. Tried deleting the bin and obj folders and rebuilding, but without succes.
In your Info.plist make sure the value for Launch Screen is set to your LanchScreen.storyboard (might be different name for yours). Open that storyboard and place your UIImageViews in the desired order.
If you work with LaunchImages instead you need to compose your image beforehand in a picture editor.
I am new to C#, I am using Visual Studo 2010, I have an image that needs to be displayed on a picturebox.
I tried many different methods. All the methods results in some unwanted pixels to appear along with image.
I have tried
picturebox.Image = Image.FromFile("bird.png");
result->
the image is displayed but with the stray white/black pixels at random places.
I also tried creating a bitmap of same size and drawing the image onto the bitmap and then assigning the bitmap to the picture box.Image. Still those unwanted pixels are visible.
I have tried clearing the picture box image (filling it with white or transparent) and then assigning the image, still same error occurs.
PS: this doesn't happen for all the images only certain images show this behaviour.
any help would be great
Code:
Image org = Bitmap.FromFile("bird.png");
Bitmap final = new Bitmap(org.Width,org.Height);
using (Graphics g = Graphics.FromImage(final))
{
g.DrawImage(org,0,0,GraphicsUnit.Pixel);
}
picturebox.Image = final;
if i use final.save("picture.png"). The "picuture.png" does not have that wrong pixels, it happens only when i use picture box to display it.
Please find the images attached defect orginal
PS: its not because of different fileformat (orginal and defect)
It was an TransperancyKey issue resolved by setting it to Default.
I am creating app that allow user to use pictures from photo hub & take new photo to edit
I know that I can take picture from PhotoChoserTask but I want 2 seperate things.
Now I need to crop taken picture right after capture (like what I can do with PhotoChoserTask)
How can I achieve it?
Unfortunately CameraCaptureTask doesn't have Height and Width properties, so you cannot crop the image right after it is taken.
You can do two things:
1 - (I don't prefer this one!) Allow the user to take a picture using the CamerCaptureTask and then after it is completed, call the PhotoChoserTask so that the user again chooses the clicked image. Using this option you can crop the image using the Height and Width properties of the PhotoChoserTask
2 - Use Nokia Imaging SDK to crop the image. This SDK has many filters including the Crop filter which can be used to crop images. It is not as easy the PhotoChoserTask crop but you can still crop the image. There is sample code to crop an image on this page. Check it out!
Hope this helps!
Same as PhotoChoserTask, CameraCapturTask also has 'completed' event. Both are same so you can apply the same code of PhotoChoserTask 'completed' event to CameraCaptureTask 'completed' event. Use 'e.ChosenPhoto' argument property to get the stream of captured image.
in my winform application i am trying to take screenshot of a image, and assign it to picturebox using DarwToBitmap() method.
it works fine for me, but when i zoom the image and then take screen shot, in picturebox only part of image that was visible on screen is being shown.
how can i capture screenshot of entire image, even if it is zoomed. ??
this is very much similar to what i am trying to do.
It was much more simple than i had expected.
just make zoom to 100% before calling 'DrawToBitmap' and save the image.
after that re assign the prev zoom value.
thats it. works like a charm.