Questions tagged [bitmapimage]

A bitmap(BMP) is a raster graphics image file. It is also referred to as a Device Independent Bitmap (DIB).

900 questions
3
votes
1 answer

still memory-leaks in .net4 - binding memory BitmapImage to Image-Source

I know very similar questions were asked here in the past - but neither had a solution for my problem: I load a image from memory into a BitmapImage: private static BitmapImage LoadImage(byte[] imageData) { if (imageData == null ||…
Random Dev
  • 51,810
  • 9
  • 92
  • 119
3
votes
2 answers

How to Copy Bitmap.Image in c#

I have some troubles with saving a image from memorystream. Here is my code: MemoryStream ms = new MemoryStream(onimg); if (ms.Length > 0) { Bitmap bm = new Bitmap(ms); returnImage =…
Aldos
  • 193
  • 2
  • 12
3
votes
2 answers

Silverlight 4 BitmapImage bug : ImageOpened not invoked after SetSource()

This seems like a serious bug : private void LayoutRoot_Drop(object sender, DragEventArgs e) { if ((e.Data != null) && (e.Data.GetDataPresent(DataFormats.FileDrop))) { FileInfo[] files =…
Yaron Levi
  • 12,535
  • 16
  • 69
  • 118
3
votes
2 answers

Rotate a BitmapImage

I want to rotate a bitmap image I wrote some code and it work TransformedBitmap TempImage = new TransformedBitmap(); TempImage.BeginInit(); TempImage.Source = MyImageSource; // MyImageSource of type BitmapImage RotateTransform transform = new…
Akrem
  • 5,033
  • 8
  • 37
  • 64
3
votes
2 answers

BitmapImage and Bitmap

Sorry to ask a question like that but I can't found a good answer :/ What is the difference between BitmapImage and Bitmap? I want to work with TIFF image with any one of them I have to work. I found some tutorial that works with BitmapImage and…
Akrem
  • 5,033
  • 8
  • 37
  • 64
3
votes
2 answers

Convert WPF Control to BitmapSource

This is kind of a two part question- First, why doesn't this code work? Canvas canvas = new Canvas { Width = 640, Height = 480 }; System.Windows.Size size = new System.Windows.Size( canvas.Width, canvas.Height); //Measure and arrange the…
Nicros
  • 5,031
  • 12
  • 57
  • 101
3
votes
3 answers

Why does WPF make working with images so much more difficult?

I used to be able to do so very much with just the Bitmap and Graphics objects. Now that I've been using WPF the only thing I seem to be able to do is load an image and show it and make it dance around the stupid screen. Why did they get rid of…
Jordan
  • 9,642
  • 10
  • 71
  • 141
3
votes
1 answer

display a System.Drawing.Bitmap object in a System.Windows.Controls.Image control

I have an image control as: in a wpf application. I imported a library that converts a video to bitmap images and…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
3
votes
1 answer

How to check BitmapImage instance is initialized or not? WPF

I try to use instances of BitmapImage class in circle but sometimes I receive error messages that BitmapImage is not initialized. How to check that BitmapImage is initialized before use it?
3
votes
0 answers

How to remove the watermark from the background in a pdf using python?

1.) The pdf data can't be read directly. Why is it so? 2.) I have taken each page and stored it as an image and then used the tesseract to recognize the text. 3.) The text can't be recognized properly because of the watermark in the background. 4.)…
Aparajit Garg
  • 41
  • 1
  • 3
3
votes
1 answer

Creating a BitmapImage WPF

I have a ushort[] containing image data I need to display on screen, at the minute I am creating a Windows.System.Drawing.Bitmap, and converting this to a BitmapImage but this feels like a slow inneficent way to do this. Does anyone what the fastest…
Eamonn McEvoy
  • 8,876
  • 14
  • 53
  • 83
3
votes
2 answers

C# 4.0 unlock image after creating BitmapImage

I am creating an BitmapImage from an existing image using: BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri(jpegPath, UriKind.Relative); bmp.EndInit(); After I have done this I want to delete the image from my hard…
SaphuA
  • 3,092
  • 3
  • 39
  • 58
3
votes
2 answers

How to convert a stream to BitmapImage?

I am trying to convert MemoryStream to Image by using the following code. Stream stream = new MemoryStream(bytes); BitmapImage bitmapImage = new BitmapImage(); await bitmapImage.SetSourceAsync(stream.AsRandomAccessStream()); but it throws an…
Santhiya
  • 191
  • 2
  • 14
3
votes
2 answers

Silverlight ComboBox bound to IEnumerable where images are downloaded from server

I am having an issue with binding a ComboBox to an IEnumerable, where the images are stored on the server and downloaded on demand. At the time the binding actually takes place, most of the images have not downloaded yet and causes the…
Jeffrey
  • 509
  • 4
  • 11
3
votes
0 answers

Creating instance of BitmapImage throws exception (RPC_E_WRONG_THREAD)

I'm trying to create an instance of BitmapImage in a method called IsImageValid. When doing so, I get this exception: the application called an interface that was marshalled for a different thread. (exception from hresult: 0x8001010e …
Dennis Schröer
  • 2,392
  • 16
  • 46