bitmapimage

Bitmap manipulation as a referenced object

I am working with a Bitmap object that I add annotations or copyright material to the image and then return the modified bitmap. My problem is that the Bitmap won't hold the changes made to it as it moves along the chain. I am treating it as a reference type and would assume that as it gets passed to each class it would carry the changes...

Why does this silverlight code get a "catastrophic failure" when reading a BitmapImage out of IsolatedStorage?

In a Silverlight app, I save a Bitmap like this: public static void SaveBitmapImageToIsolatedStorageFile(OpenReadCompletedEventArgs e, string fileName) { using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(fileName, Fil...

How to get Silverlight's bitmapimage pixel height before it is drawn to canvas?

I have an Image, which I need to scale based on the image's pixel values. When I create the bitmapImage, the pixels (height and width) are both 0. Is there a way to get height and width before the image is drawn to the canvas? ...

WPF - Rotate and Save Image -both for the View and to Disk

Hello, I have a View that contains an image control. <Image x:Name="img" Height="100" Margin="5" Source="{Binding Path=ImageFullPath Converter={StaticResource ImagePathConverter}}"/> The binding uses a converter does nothing interesting except set BitmapCacheOption to "OnLoad", so...

BitmapImage loading UriSource via proxy

I'm having difficulty loading an image from a URL, when the request goes through a proxy. I have a url that will generate an image which I use to load a BitmapImage ( code below ). This works great for any of my users that connect directly to the internet, however, if the user is behind a proxy, it will not work. Any ideas would be gr...

How to force BitmapImage to use NTLM Authentication for HTTP download of Image

The following code worked nicely until our admins enabled KERBEROS on our servers: var image = new BitmapImage(new Uri("http://sharepoint/sites/Symbols/Symbols/ABCD.png")); The server is in the local intranet zone and requires windows authentication. After our admins also enabled KERBEROS in this domain, http downloads and webservice ...

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: <Image Width="50" Name="MemberImage" HorizontalAlignment="Left"> <Image.Source> <BitmapImage DecodePixelWidth="50" UriSource="questionmar...

Replace Color Gradient In Transparent Image

I have small function which will recolor pixels in a Bitmap from a given color to a new given color. The problems I have with the code are as follows: 1) The function gives results which are remapping white pixels which should not be concidered since I have a threshold... (unless I have defined this calculation wrong) 2) When certain ...

byte[] to BitmapImage in silverlight

Hello, For the purpose of a game, I need to serialize some pictures in a binary file through a WPF application, using bitmapEncoder and its child classes. But these class are not available in silverlight, so I can't load them into the browser from the same binary file. Does someone know how to convert a byte[] to BitmapImage in silver...

Unable to load an external image in Silverlight - "ag e network error" exception

Hi, I'm using Silverlight 4 and I'm experiencing the following problem: First off, the code: BitmapImage bitmapImage = new BitmapImage(); bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; bitmapImage.DownloadProgress += new EventHandler<DownloadProgressEventArgs>(bitmapImage_DownloadProgress); bit...

Repeating the image in horizontal position ( C# Drawing )

am using c# am having a bitmap image like below i want create a repeated image like below in horizontal position to get repeted continous image for some given width. i meant i like to draw repeated image like below from the above single bitmap (In simple words,in html we can have a image and set repeat X to get the repeated image.li...

C# Clear a BitmapImage or the instance of it.

I would like to clear a bitmap image. I've tried both uploadImage.Source = null; and uploadImage.Source = ""; This is the code I used to make the image: // BitmapImage.UriSource must be in a BeginInit/EndInit block BitmapImage myBitmapImage = new BitmapImage(); string curItem = destinationFolder + "\\" + listBox1.SelectedItem.ToS...

[WPF] Synchronously download an image from URL

Hi, I am trying to do a simple thing but I can't ... 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 are working async and that's certainly why I have this problem, but how can I do it synchronously ? Here is my functi...

Android handling out of memory exception on image processing

Hi all, This is the sequence part of this question: http://stackoverflow.com/questions/3674441/combining-2-images-overlayed so the problem is: if the image size is too big - it'll got an exception (out of memory exception) what i want is, to handle even if the handset got the lower spec hardware, it doesn't go to that exception (but it...

Silverlight strange bug with bitmap images and WebClient

I have strange bug with showing image in silverlight. The problem to show list of images that configured in xml file and this xml downloaded from server by WebClient type. WebClient client = new WebClient(); client.AllowReadStreamBuffering = true; client.OpenReadAsync(new Uri(path, UriKind.Relative), new GalleryU...

Handling image load exception gracefully

Hi, I'm loading user images using Silverlight 3. Everything works fine and I can set the file stream to a BitmapImage and it gets rendered OK. The problem is that if I try to load something that's not an image (like a .exe that's been renamed to .png) Silverlight crashes with a System.Exception that says "Catastrophic failure". The M...

How can I extract the palette from a 5-6-5 bitmap image?

I am trying to extract the palette from a 5-6-5 (16bit) bitmap image that I have produced using ImageConverter Plus from an original Photoshop file. I need to read out the palette and compare it to the palette I have elsewhere for another image. Is there a piece of freeware (or not) software that can do this? I can read palette files i...

Dynamically crop a BitmapImage object

I have a BitmapImage object that contains an image of 600 X 400 dimensions. Now from my C# code behind, I need to create two new BitmapImage objects, say objA and objB of dimensions 600 X 200 each such that objA contains the upper half cropped image and objB contains the lower half cropped image of the original image. ...

WPF BitmapImage Memory Problem

Hello I work on a WPF application that has multiple canvases and lots of buttons. The user cand load images to change the button background. This is the code where I load the image in the BitmapImage object bmp = new BitmapImage(); bmp.BeginInit(); bmp.CreateOptions = BitmapCreateOptions.IgnoreImageCache; bmp.CacheOption = BitmapCache...

error in my byte[] to WPF BitmapImage conversion?

I'm saving a BitmapImage to a byte[] for saving in a DB. I'm pretty sure the data is being saved and retrieved accurately so it's not an issue there. On my byte[] to BitmapImage conversion I keep getting an exception of "System.NotSupportedException: No imaging component suitable to complete this operation was found." Can anyone see w...