Questions tagged [bitmapsource]

Bitmapsource represents a single, constant set of pixels at a certain size and resolution.

What questions should have this tag:
.Net Framework questions utilizing the BitmapSource class under the System.Windows.Media.Imaging namespace.

Basic Definitions:
Maximum height and width of an image: 2^16 pixels at 32 bits per channel * 4 channels
Maximum size of a BitmapSource: 2^32 bytes (64 gigabytes)
Maximum image size: 4 (four) gigapixels
Minimum image size: 1x1

Brief Introduction:
Part of the Windows Presentation Foundation (WPF) imaging pipeline, BitmapSource represents a single, constant set of pixels at a certain size and resolution. Multi-frame images and animations are not represented by BitmapSource.

Important Links:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.aspx

136 questions
1
vote
1 answer

How to avoid an explicit call to GC.Collect() for this case that uses BitmapSource to continuously update a camera image

I need to include a camera image in my UI. The solution that I came up with for the View and ViewModel is given below. In the ViewModel I am using a BitmapSource which hold the camera image and that is continuously update, whenever the camera…
packoman
  • 1,230
  • 1
  • 16
  • 36
1
vote
1 answer

Value out of range with BitmapSource.Create

Working in WPF and trying to create a BitmapSource from scratch. The following code gives an Argument Exception " Value does not fall within the expected range." I can't figure out why. I'm still new to WPF and maybe I'm not using the pixel format…
1
vote
1 answer

All images in XPS look identical when loaded from a byte array

I have a window:
torvin
  • 6,515
  • 1
  • 37
  • 52
1
vote
1 answer

Display Image from Byte Array in WPF - Memory Issues

I've developed an application to capture and save images to a database, but I'm having an issue with memory usage. On my domain object I have 3 properties: Image - Byte array, contents are a jpg RealImageThumb - The byte array converted to a…
ChrisFletcher
  • 1,010
  • 2
  • 14
  • 31
1
vote
0 answers

Convert from BitmapSource to Visual?

Is there any way to convert from a System.Windows.Media.Imaging.BitmapSource to a System.Windows.Media.Visual? I have an instance of a BitmapSource but I'd like to convert it to a Visual so I can take advantage of WPF vector graphics. I've seen lots…
Robin
  • 2,278
  • 3
  • 26
  • 46
1
vote
0 answers

Decode H264 stream and convert to BitmapSource?

I'm using FFMPEG to decode H264 stream. The result in the output frame is AVFrame* pFrame, its format may be YUV420P. I want to convert pFrame to RGB and then construct BimapSource from thatRGB. I have searched on the internet, there are many ways…
TTGroup
  • 3,575
  • 10
  • 47
  • 79
1
vote
1 answer

Custom List Adapter unbind views

I have developed a custom list adapter where i have attach views using holder. also i have checked if the views are already crated and reusing them again and again. The listview is inside the fragment and when I am navigating to another fragment I…
1
vote
1 answer

C# Creating PixelFormat.Format32bppArgb skewing image

I am trying to combine 3 grayscale bitmaps into one color bitmap. All three grayscale images are the same size (this is based off of data from the Hubble). My logic is: Load "blue" image and convert to PixelFormat.Format24bppRgb. Based off of…
JamesL
  • 319
  • 2
  • 4
  • 11
1
vote
0 answers

BitmapSource.Create creates two copies of image data

Have an application which processes a number of images. The memory footprint is approx twice the expected size. I have pruned my code down to what is shown below, the _source is an instance variable which stays in scope: int width = 924; int height…
1
vote
1 answer

BitmapSource access with pointers

Is there a way to access the underlying memory of a BitmapImage object with c# pointers? I know that there's a CopyPixels method but it makes a copy of the pixels array into a new array (duplicating memory requirements). If you open a large image…
LoxLox
  • 977
  • 9
  • 16
1
vote
0 answers

Displaying RGBA images using Image class w/o pre-multiplied alpha

I'm trying to display the separate R, G, B and A channels of a texture based on user input. I'm using an Image class to display textures that have alpha channels. These textures are loaded in to BitmapSource objects and have a Format of Bgra32. The…
user1200340
  • 157
  • 1
  • 3
  • 10
1
vote
1 answer

How to properly use Image as ToolTip?

I have a BitmapSource 1690x214 (taken from an EMF file using this code), and I want to use this image as ToolTip. This is the image displayed using Paint: So i wrote this code: BitmapSource bmp = myBitmapSource; // "Dk01Light.EMF" Image img = new…
Nick
  • 10,309
  • 21
  • 97
  • 201
1
vote
2 answers

Can't deserialize BitmapSource from WCF service

I'm trying to send a BitmapSource from my WCF service to my client app. Both are .NET 3.5 applications. I'm seemingly able to serialze the object without an issue (no exceptions occur), but my callback on my client never gets called. After adding a…
Thelonias
  • 2,918
  • 3
  • 29
  • 63
0
votes
1 answer

Manipulate photo to sepia

How can I manipulate my photo to sepia after I click the button. Below is my code: private void button1_Click(object sender, RoutedEventArgs e) { BitmapSource image = (BitmapSource)video.Source; image.Save(DateTime.Now.ToString("ddMMyyyy…
0
votes
3 answers

WPF frozen BitmapImage not showing

I am using a viewmodel bound to an image property on the UI and the viewmodel contains an ImageSource property. I set that property using the following function private BitmapImage GetImageFromUri(Uri urisource) { if (urisource ==…
ak3nat0n
  • 6,060
  • 6
  • 36
  • 59