bitmapimage

Get supported image formats from BitmapImage

左心房为你撑大大i 提交于 2019-12-10 09:27:31
问题 How can I get a list of image formats supported by System.Windows.Media.Imaging.BitmapImage? I am writing a simple image processing tool in C# WPF. The BitmapImage class is one of the more useful bitmap classes as it is able to decode from a wide variety of formats. In particular, it is able to open NEF (Nikon's RAW format) on my computer. It is likely that BitmapImage can open a wide variety of RAW formats from other manufacturers, a function I am keen to make use of. As I don't know every

How do I set a WPF Image's Source to a bytearray in C# code behind?

青春壹個敷衍的年華 提交于 2019-12-08 04:26:25
I'm building a small app using C#/WPF. The application receives (from an unmanaged C++ library) a byte array (byte[]) from a bitmap source In my WPF window, I have an (System.windows.Controls.Image) image which I will use to display the bitmap. In the code behind (C#) I need to able to take that byte array, create BitmapSource /ImageSource and assign the source for my image control. // byte array source from unmanaged librariy byte[] imageData; // Image Control Definition System.Windows.Controls.Image image = new Image() {width = 100, height = 100 }; // Assign the Image Source image.Source =

how to draw image frame for camera view and overlapping the image frame on captured image

我们两清 提交于 2019-12-08 03:41:52
问题 I am new in android and working on the camera application. In this app I have one transparent image (Image Frame) in assets folder and I want to show this file as my camera view unlike the native camera view. I am getting the camera view screen with the Image Frame using imageview over surface but unable to merge them as output image file on sdcard. Please help thanks in advance... 回答1: Drawable drbl=null; Bitmap topImage = null ; Bitmap b=Bitmap.createBitmap(ref_capturedBitmap.getWidth(),

Android BitmapFactory.Options.inSampleSize casuse application crash

与世无争的帅哥 提交于 2019-12-08 02:05:57
问题 We are working on a Android app that captures images and converts the same to Bitmap to be posted to a Rest service. While creating the Bitmap we have BitmapFactory.Options.isSample Size configured to value of 4 and this works fine on all device except for HTC One. The image in HTC one is distorted. When we change the value to 1 it shows a good image on HTC one but the application crashes on all other devices because of Memory issues. The issue is related to Heap size available. What is the

Create thumbnail image directly from header-less image byte array

青春壹個敷衍的年華 提交于 2019-12-08 02:03:47
问题 My application shows a large number of image thumbnails at once. Currently, I am keeping all full size images in memory, and simply scaling the image in the UI to create the thumbnail. However, I'd rather just keep small thumbnails in memory, and only load the fullsize images when necessary. I thought this would be easy enough, but the thumbnails I'm generating are terribly blurry compared to just scaling the fullsize image in the UI. The images are byte arrays with no header information. I

Image memory clean after i call GC.Collect() many time

旧巷老猫 提交于 2019-12-06 10:05:01
问题 I am using the image to preview. after my work, I just set ImageSource to null and call GC.Collect() but after call GC.Collect() 50% memory is still on hold and its hold up to when I call again GC.Collect() .. why it takes my call to clean?. After Click Destroy private void ImgDistry_Click(object sender, RoutedEventArgs e) { image.Source = null; GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } After Destroy Image set image

Android BitmapFactory.Options.inSampleSize casuse application crash

泪湿孤枕 提交于 2019-12-06 05:34:04
We are working on a Android app that captures images and converts the same to Bitmap to be posted to a Rest service. While creating the Bitmap we have BitmapFactory.Options.isSample Size configured to value of 4 and this works fine on all device except for HTC One. The image in HTC one is distorted. When we change the value to 1 it shows a good image on HTC one but the application crashes on all other devices because of Memory issues. The issue is related to Heap size available. What is the reason that HTC one shows a distorted image on HTC one. Why is application crashing on S3 which also has

How to store save Thumbnail image in device in windows 8 metro apps c#

泄露秘密 提交于 2019-12-06 04:21:40
问题 I am creating Thumbnail and showing in frame by using this code Platform -> windows 8 metro apps using c# http://code.msdn.microsoft.com/windowsapps/File-and-folder-thumbnail-1d530e5d in windows 8 metro apps using c#. i need to save or Store ( in device )the thumbnail image which i am creating at run time. in DisplayResult() of constants.cs class file i need to save that image in device how to achieve this . please give me some idea or example i am very new in mobile and never worked on Image

How can I merge 2 images on Windows Phone

大憨熊 提交于 2019-12-06 03:02:32
问题 I have 2 images and I want to merge them into one on my apps in Windows Phone. The first image captured by my WP's camera, the second image is a frame (borders, filter, etc.) which user can choose among our templates. So how can I merge them into one. Thanks and best regards. 回答1: I don't quite understand what you ask. But I guess you want to overlay 1 image on top of another. If so, there is already an answer here. Inside the <grid> , you can provide both the image, and customize the opacity

How can I set the WPF BitmapImage UriSource property to a relative path?

北城以北 提交于 2019-12-06 02:46:29
问题 I'm loading an image in WPF by using the BitmapImage class. My code works perfectly when I give an absolute path for the UriSource but not when I try and use a relative path. My XAML is: <Image Width="50" Name="MemberImage" HorizontalAlignment="Left"> <Image.Source> <BitmapImage DecodePixelWidth="50" UriSource="questionmark.jpg" /> </Image.Source> </Image> The questionmark.jpg is added to the project with a Build Action of Resource and Copy to Output Directory set to Copy always. The error I