A bitmap(BMP) is a raster graphics image file. It is also referred to as a Device Independent Bitmap (DIB).
Questions tagged [bitmapimage]
900 questions
7
votes
8 answers
pass a bitmap image from one activity to another
In my app i am displaying no.of images from gallery from where as soon as I select one image , the image should be sent to the new activity where the selected image will be set as background.However, I am able to get the images from gallery but as…

Shweta
- 807
- 3
- 11
- 24
7
votes
1 answer
BitmapImage decoding speed performance wpf
I have 5 images all the same pixel height and pixel width (2481 * 3508 for that matter). But, one is gif, one jpeg, one png and one bmp. Now I render them into a BitmapSource with (1) two thirds of the original pixel height for DecodePixelHeight and…

user1182735
- 764
- 9
- 21
7
votes
5 answers
Garbage collection fails to reclaim BitmapImage?
I have an application(WPF) which creates BitmapImages in huge numbers(like 25000). Seems like framework uses some internal logic so after creation there are approx 300 mb of memory consumed(150 virtual and 150 physical). These BitmapImages are added…

Blablablaster
- 3,238
- 3
- 31
- 33
6
votes
3 answers
Convert RenderTargetBitmap into System.Drawing.Image
I have 3D WPF visual that I want to pass into an Excel cell (via clipboard buffer).
With "normal" BMP images it works but I do not know how to convert a RenderTargetBitmap.
My code looks like this:
System.Windows.Media.Imaging.RenderTargetBitmap…

Stefan Olsson
- 617
- 3
- 16
- 32
6
votes
2 answers
c# Uri loading non deterministic?
I am trying to load some BitmapImages from files held on the file system. I have a dictionary of keys and relative filepaths. Unfortunately the Uri constructor seems non deterministic in the way that it will load the images.
Here is my…

Michael Watson
- 73
- 3
6
votes
1 answer
Why does BitmapImage RequestCachePolicy get ignored?
I'm finding that setting the RequestCachePolicy property on BitmapImage has no effect on how the bitmap is downloaded when an Image's Source is set to this instance of BitmapImage.
For example, if I set the RequestCachePolicy to CacheOnly, I would…

mackenir
- 10,801
- 16
- 68
- 100
6
votes
1 answer
UWP encode image to PNG
I get an image by URI (web or file system) and want to encode it into PNG and save to a temporary file:
var bin = new MemoryStream(raw).AsRandomAccessStream(); //raw is byte[]
var dec = await BitmapDecoder.CreateAsync(bin);
var pix = (await…

Mike Tsayper
- 1,686
- 1
- 17
- 25
6
votes
4 answers
Synchronously download an image from URL
I just want to get a BitmapImage from a internet URL, but my function doesn't seem to work properly, it only return me a small part of the image. I know WebResponse is working async and that's certainly why I have this problem, but how can I do it…

Karnalta
- 518
- 1
- 9
- 24
6
votes
5 answers
Scale image without losing image quality did not work
Does anyone know how to scale the bitmap image without losing the image quality ? Currently I facing this problem, where the size of selected image maybe too big caused the app return to another activity.
So now I tried using this method to scale…
user5256621
6
votes
3 answers
Android get image to Bitmap from filepath
I'm trying to set the image from a specific filepath ON THE PHONE. The filepath is to the photo on the phone. the filepath could look like this
/storage/emulated/0/Pictures/picture.jpg
Here is the code.
Bitmap image = null;
//trying to set the…

Edvard Åkerberg
- 2,181
- 1
- 26
- 47
6
votes
3 answers
How can I set the WPF BitmapImage UriSource property to a relative path?
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:

Val M
- 899
- 6
- 16
- 26
6
votes
3 answers
Android: Creating contact thumbnail from name initials
I've an Android ListView containing some emails. Some of them have contact thumbnails while some of them don't. For unknown contact thumbnails, I want to create a Bitmap, containing the initials of the corresponding email id. How can I achieve that?…

Vinit Shandilya
- 1,643
- 5
- 24
- 44
6
votes
3 answers
Can I get a byte[] from a BitmapImage in Silverlight?
I'm trying to pass some representation of an image back and forth between Silverlight and a WCF service. If possible I'd like to pass a System.Windows.Media.Imaging.BitmapImage, since that would mean the client doesn't have to do any…

goric
- 11,491
- 7
- 53
- 69
6
votes
1 answer
How to create a BitmapImage from a pixel byte array (live video display)
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…

Pedro77
- 5,176
- 7
- 61
- 91
6
votes
2 answers
Create a BitmapImage from a byte array
I am creating a byte array with arbitrary values in it and want to convert it into a BitmapImage.
bi = new BitmapImage();
using (MemoryStream stream = new MemoryStream(data))
{
try
{
bi.BeginInit();
…

tabina
- 1,095
- 1
- 14
- 37