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
0
votes
1 answer

Android Pictures links from Db using base adapter

So em, first time here asking questions, I am developing an android app, where I have one fragment with gridview of images. I am using a database to hold the image URL's and converting them to bitmaps using a picture adapter. How do I either extact…
0
votes
1 answer

Faster way to convert BitmapSource to BitmapImage

We have some video software that converts BitmapSource into a BitmapImage which is then drawn to screen later using the following code. The problem is on slower machines this process seems to be a little slow, running the MS profiler it turns out…
Chris
  • 26,744
  • 48
  • 193
  • 345
0
votes
1 answer

WPF - Generate BitmapSource from Over state of a button

I can generate a BitmapSource from a button fine, however it always is just the image of the normal state of the button. I want to be able to generate a BitmapSource of the over state of a button. I tried…
Kyle
  • 21,377
  • 37
  • 113
  • 200
0
votes
1 answer

BitmapSource.Create switches RGB values

I am loading pixels from a file onto an array of bytes using this code: Bitmap bmp = new Bitmap(filename); var rect = new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height); BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadWrite,…
phil
  • 1,416
  • 2
  • 13
  • 22
0
votes
0 answers

Create and displaying RGBA image from a native buffer in C++/CLI

I have a native char* buffer containing an RGBA image. The problem seems to be that it is a real RGBA format, and not the windows style ARGB. (which stands for BGRA, backwards) The object must be created from the buffer without copying it. So far,…
Yochai Timmer
  • 48,127
  • 24
  • 147
  • 185
0
votes
2 answers

Get file Thumbnail image with transparency

I want to get file's thumbnail with transparency. I have the following code to achieve it: BitmapImage GetThumbnail(string filePath) { ShellFile shellFile = ShellFile.FromFilePath(filePath); BitmapSource shellThumb =…
Ron
  • 3,975
  • 17
  • 80
  • 130
0
votes
0 answers

Userdefined BitmapSource with WriteableBitmap

I'm having a DICOM image data, which holds 16bit gray values. To visualize the data I need to apply a windowing method that cuts out pieces of the 16bits values. Therefore I have two properties, like WindowCenter and WindowWidth. Since I want to use…
msedi
  • 1,437
  • 15
  • 25
0
votes
1 answer

C# Get image source from project resources creates memory leak

Ok, in my project resources i have some images (.png). Whenever the user clicks on a Button a new image will be shown in an ImageBox. Because all of my images are stored in my project resources i have to get the Image.Source by code. I managed to do…
oimitro
  • 1,466
  • 4
  • 14
  • 22
0
votes
1 answer

BitmapImage from BitmapSource always Bgr32

I'm loading a BitmapImage from a BitmapSource and i always find the BitmapImage's format is Bgr32 instead of Bgra32 which the BitmapSource is. There is a similar thread on this here: BitmapImage from file PixelFormat is always bgr32 but using…
user1200340
  • 157
  • 1
  • 3
  • 10
0
votes
0 answers

Reduce application memory for cropped image in C# WPF

We're displaying cropped images in our WPF application by creating a new CroppedImage from the original bitmap. but when we look at application memory it's the same for displaying cropped images as it is for displaying the original image. This is…
exkoria
  • 1,176
  • 2
  • 13
  • 27
0
votes
1 answer

BitmapSource copyPixels correct arguments

Used stride by me generates exception. I don't know what stride is correct. The input image is 32 bit JPG. Please tell me what values(I tried many things but they where generating exceptions or corrupted JPG) i should put…
user1825608
0
votes
1 answer

CopyPixels method in Bgr32 format

i'm just doing a simple job: Converting a bitmap into an array, then using that array, recreating the bitmap with BitmapSource.Create method. However, i'm getting the error: "Value does not fall within the expected range". Here's my code. …
Burak Yavuzalp
  • 199
  • 1
  • 2
  • 10
0
votes
1 answer

Drawing a subregion of a BitmapSource

I'm creating a level editor in WPF for a 2D tile-based game. I'm trying to figure out the best way to load the tileset Image file and render each tile in the appropriate location to reconstruct the map. Currently, I'm loading the Image as a…
user316
0
votes
1 answer

Clean up a collection of BitmapSource

i have a collection of BitmapSource that are created by setting its StreamSource property to a MemoryStream of byte array. How do i remove them from memory after using them? thanks!
icube
  • 2,578
  • 1
  • 30
  • 63
0
votes
1 answer

error with partial declaration of 'BitmapSource.main page'must not specify different base classes

i got an error with partial declaration of 'BitmapSource.main page'must not specify different base classes. In my XAML, I have x:Class="BitmapSource.MainPage", xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone",…
1 2 3
9
10