bitmapimage

Load bitmapImage from base64String

天涯浪子 提交于 2019-12-19 09:27:27
问题 How can I load a bitmapImage from base64String in windows 8 ? I tried this but I am not successful. It used to work on windows phone. What is different? Looks like I have to use the function setsourceasync. When I use that, then I am required to pass the parameter as IRandomMemory which I am unable to do. How to do this? public static BitmapImage Base64ToImage(string base64String) { var bitmapImage = new BitmapImage(); try { if (!String.IsNullOrEmpty(base64String)) { var imageBytes = Convert

BitmapImage DecodePixelWidth odd behavior

久未见 提交于 2019-12-19 09:24:58
问题 I was experiencing some performance issues when displaying a large number of images, I discovered the issue was that the full resolution image was being used when I really only needed an image less than 1/4 of the size. So I added a line in between BeginInit and EndInit to set the DecodePixelWidth to 200 which is the max width I will need in my layout. My performance was no longer an issue but some of the images are really small, definitely nowhere close to 200 pixels wide. Most of the images

How to upload a bitmap image to server using android volley library?

六月ゝ 毕业季﹏ 提交于 2019-12-18 17:56:40
问题 How to upload a bitmap image to server using android volley library ?I am trying to use android volley to upload images to server . If there is no such option in android volley ,can you please suggest me the best way to make networking actions faster. You are welcome to message me the links to any available tutorials online pertaining to this subject 回答1: As far as I know, Volley isn't the right choice to send a large amount of data (like an image) to a remote server. Anyway, if you want to

How to serialize a Class contains BitmapImage?

ⅰ亾dé卋堺 提交于 2019-12-18 09:34:30
问题 I have a DeepCopy method, which serializes the object passed in parameter and returns back the deserialized object to make deep copy. My method is: public static class GenericCopier<T> { public static T DeepCopy(object objectToCopy) { using (MemoryStream memoryStream = new MemoryStream()) { BinaryFormatter binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(memoryStream, objectToCopy); memoryStream.Seek(0, SeekOrigin.Begin); return (T)binaryFormatter.Deserialize(memoryStream);

How to save BitmapImage / WriteableBitmap using SaveFileDialog in Silverlight 3.0?

孤人 提交于 2019-12-18 05:21:44
问题 How can a WriteableBitmap from Silverlight be Saved onto the File System, I am unsure what to do with the FileStream to make this work, it can be in Bitmap, PNG, Jpeg format etc, as long as a commercial library is not required. Is it possible to do this? Here is my call to SaveDialog, below: Dim SaveDialog As New SaveFileDialog If SaveDialog.ShowDialog Then Try Using FileStream As Stream = SaveDialog.OpenFile ' Save Image File Code Here End Using Catch ex As Exception End Try End If Edit

Convert RenderTargetBitmap to BitmapImage

荒凉一梦 提交于 2019-12-17 18:41:12
问题 I have a RenderTargetBitmap , I need to convert it to BitmapImage . Please check the code below. RenderTargetBitmap bitMap = getRenderTargetBitmap(); Image image = new Image();// This is a Image image.Source = bitMap; In the above code I have used Image.Now I need to use a BitmapImage. How can I do this? RenderTargetBitmap bitMap = getRenderTargetBitmap(); BitmapImage image = new BitmapImage();// This is a BitmapImage // how to set bitMap as source of BitmapImage ? 回答1: Although it doesn't

How to render bitmap into canvas in WPF?

醉酒当歌 提交于 2019-12-17 18:29:23
问题 I've subclassed Canvas so that I can override its Render function. I need to know how I can load a bitmap in WPF and render that to the canvas. I'm completely new to WPF and I haven't found any tutorials that show you how to do something so seemingly trivial. Step-by-step instructions with examples would be great. 回答1: This should get you started: class MyCanvas : Canvas { protected override void OnRender (DrawingContext dc) { BitmapImage img = new BitmapImage (new Uri ("c:\\demo.jpg")); dc

How to create a BitmapImage from a pixel byte array (live video display)

北战南征 提交于 2019-12-17 17:46:26
问题 I need to display live images on a WPF control. I'm looking for the fastest way to do this using WPF. I'm capturing images from a camera using its dll API (AVT). The image is writen by the dll and the camera rises a callback with an IntPtr to a Image struct called tFrame (described below). The pixel data is stored at the ImageBuffer propertie with is an InPtr to a byte array. I know how to create a Bitmap from the pixel byte array, but not a BitmapImage. So it is possible to create a Bitmap

Passing bitmap to other activity getting message on logcat FAILED BINDER TRANSACTION

匆匆过客 提交于 2019-12-17 07:54:25
问题 when i'm passing bitmap image to other activity i'm getting mag on logcat as- 03-20 12:06:56.553: E/JavaBinder(280): !!! FAILED BINDER TRANSACTION !!! it's happening for large size image.small size image is working well. what should i do?please help me.thanks in advance. here i'm passing data as- Drawable drbl=_imageView.getDrawable(); int imageh=_imageView.getHeight(); int imagew=_imageView.getWidth(); Bitmap bit = ((BitmapDrawable)drbl).getBitmap(); intent.putExtra("Image_Height", imageh);

Windows Phone - byte array to BitmapImage converter throws exception

时光总嘲笑我的痴心妄想 提交于 2019-12-14 03:56:27
问题 I have a byte array to a BitmapImage converter and it works fine. For tile support within my app, I create a tile from an image (resize and crop it) and save it into my database as byte array. Now, if I want to display this tile with my converter, it throws an exception: The component cannot be found. (Exception from HRESULT: 0x88982F50) My method for creating the tile: WriteableBitmap bmp = new WriteableBitmap(img); int height = bmp.PixelHeight; int newHeight = 0; int width = bmp.PixelWidth;