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
0 answers

create a bitmap image where array has more than 2GB pixels

I need to create a bitmap where the size of the image can go beyond 2GB. I use: var myPalette = new BitmapPalette(colors); var buffer = new byte[image.ImageHeight * image.ImageWidth]; The above lines throws an exception Array dimensions exceeded…
0
votes
0 answers

C# Type to handle images

I have a system that captures screenshots from different systems and on different ways. These images are used by different clients, e.g. image comparison, OCR, displaying in GUI, logging etc. Currently I designed my interfaces to use BitmapSource.…
Creepin
  • 482
  • 4
  • 20
0
votes
1 answer

handler is invalid in a BitmapEncoder.Frames.Add call

I'm using this custom method to convert a Bitmapsource to a Bitmap: public Bitmap BitmapFromSource(BitmapSource bitmapsource) { using (MemoryStream outStream = new MemoryStream()) { BitmapEncoder enc = new…
0
votes
3 answers

Android GridView - How to change a bitmap dynamically?

Hello I have a gridView which I use to show some pictures on (small thumb of diffrent levels). When the user finishes one level, I would like to change the thumb for that level. (Somehow show that it has been completed). I created two thumbs for…
theAlse
  • 5,577
  • 11
  • 68
  • 110
0
votes
1 answer

When using System.IO.Stream, how can I avoid OutOfMemoryException?

I am making a scanning component, but when I set a high resolution for the document (600 dpi), I tend to get System.OutOfMemoryException after just 1 or 2 scans. My code is as follows public ScannedImage SaveScannedImage(DataTransferredEventArgs…
0
votes
2 answers

Get bitmapsource from a picturebox in C#

I have a picturebox called picture I want to get the image of this picturebox and save it as bitmapsource BitmapSource myPic; myPic = picture.Image; But i get this error : Severity Code Description Project File Line Suppression…
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
0
votes
1 answer

OutOfMemory exception with BitmapSource in WPF app

Task: I got 2 monitors. And I need to show on #1 what is going on #2. In another words, first monitor is nothing but a reflector of second. Current solution: Just making screenshot every ~100ms and re-render. Following method is responsible for…
Zazaeil
  • 3,900
  • 2
  • 14
  • 31
0
votes
0 answers

WPF Apply image MatrixTransform to source

Suppose I have WPF Image control, with underlying BitmapSource. Several transformations are applied to image, using MatrixTransform (scale and translate). Is there any way I could apply those transformations to original image and then save it as it…
archil
  • 39,013
  • 7
  • 65
  • 82
0
votes
1 answer

Displaying image and sharing to other apps in Android

In my app, i have to download one image from the url. I have to preview that image in my app and i have to share the image using explicit intent. I have faced two issues as follows: I don't want to store the image in external storage. So what are…
AtHul Antony
  • 77
  • 1
  • 11
0
votes
2 answers

C# Bitmap BitmapImage bitmapsource

I have some code I found somewhere on the Net. unsafe static Bitmap SaveFrame(IntPtr pFrame, int width, int height) { try { int x, y; int linesize = width * 3; byte* scan0 =…
TheWommies
  • 4,922
  • 11
  • 61
  • 79
0
votes
1 answer

WPF C# - Loading 16bit (8bit multi-channel) RAW Heightmap into BitmapSource

I'm trying to display a preview of a 16bit RAW image in my WPF application but it's not working as I was hoping it would. I've had a look at countless of examples, questions/answers here on SA and even on CodeProject but that didn't take me far,…
Giuseppe P.
  • 48
  • 2
  • 6
0
votes
2 answers

ICanvasBitmap from BitmapSource

Is there a way to convert a Windows.UI.Xaml.Media.Imaging.BitmapSource object into a member of a class that implements Microsoft.Graphics.Canvas.ICanvasImage? The interface itself consists of just two rectangle-getting methods. However, I assume…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
0
votes
2 answers

I want to know better approaches on how to pass bitmaps in different activities

I have the following case: Activity1 public class Activity1 extends Activity{ ImageUtils.setArt(bitmap); } Activity2 public class Activity2 extends Activity{ Bitmap b= ImageUtils.getArt(); } ImageUtils public class ImageUtils{ …
0
votes
3 answers

How to show images efficiently in a list?

So currently i have a list that shows images and text beside it but having a problem showing pictures. I thought that the best approach is to parse using JSOUP then download image and decode it using bitmapsFactory but failed because it takes too…
STOPIMACODER
  • 822
  • 2
  • 7
  • 19
0
votes
1 answer

How can I access pixels from 1,2,4 bpp images?

I have a working code that can access a determined pixel value if the given image has 8, 24 or 32bpp. Here's is the code: Using a BitmapSource: // Get width and height of bitmap Width = _source.PixelWidth; Height = _source.PixelHeight; // Get total…
Nicke Manarin
  • 3,026
  • 4
  • 37
  • 79