I'm trying to bind a Byte array from my databse to a WPF Image. My XAML: <Window.Resources> <local:BinaryImageConverter x:Key="imgConverter" /> </Window.Resources> ... <Image Source="{Binding Path=ImageData, Converter={StaticResource imgConverter}}" /> I've modified code published by Ryan Cromwell for a value converter: Class BinaryImageConverter Implements IValueConverter Private Function Convert(ByVal value As Object, ByVal [...] read more
I have programmed an application that it needs to download *.png files and set it into the background of the button in WPF. So, when i run this program, it faces the Error as > No imaging component suitable to complete this operation was found." My code is as below [...] read more
I am working on a Windows 8 Metro app that applies filters to images. I have a web version of the app and wanted to port it. But as we all know WinRT doesn't have all the good things .NET provides otherwise :/ Currently I am applying the filters on [...] read more
The above exception occurs at line await bitmapImage.SetSourceAsync(fileStream); whenever I tried to retrieve image from local file. This is the method I'm using for storing and retrieving the image file. public async Task<BitmapImage> RetrieveImageFromFile(String fileName) { try { StorageFile localFile = await _storageFolder.GetFileAsync(fileName + "Img"); BitmapImage bitmapImage = new BitmapImage(); [...] read more
I have a thumbnail generation routine that I created using WIC for a .NET app. It has been working fine for the past year, but we just migrated to a new server. Old Server was W2k8 R2 Enterprise SP1 New Server is W2k8 Standard SP1 Here's the code that is [...] read more
In my UWP Windows 10 Mobile app, I am attempting to access and manipulate the transparency of individual pixels in the PixelBuffer for a given WriteableBitmap. The issue I'm having is that BitmapDecoder.CreateAsync() is throwing > "The component cannot be found. (Exception from HRESULT: 0x88982F50)". I have spent WAY too [...] read more
I'm working on SharpDX to do image processing on Metro. Now I successfully get the data in WICBitmap, and copy it to WriteableBitmap to show the image in Image Control. But now the problem is, I need to put the data from a WriteableBitmap(not from a file, the image data [...] read more
I am binding an Image's Source property to a URI string property on the model: <Image Validation.ErrorTemplate="{StaticResource validationTemplate}"> <Image.Source> <Binding Path="LargeImage.ImageUri"> <Binding.ValidationRules> <ExceptionValidationRule/> </Binding.ValidationRules> </Binding> </Image.Source> </Image> <ControlTemplate x:Key="validationTemplate"> <Border BorderThickness="2" CornerRadius="2" BorderBrush="Red"> <AdornedElementPlaceholder/> </Border> </ControlTemplate> I want the Image to display a red border when LargeImage.ImageUri isn't a valid [...] read more
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 exception in the SetSourceAsync method and the exception is > System.Exception was unhandled by user code HResult=-2003292336 Message=The > component cannot [...] read more
I sometimes get an error when i try to take a picture within my uwp app. This error is very hard to reproduce and happend a few min ago on desktop platform. I used a hovercam to retrieve the imagebuffer. public async Task<IBuffer> TakePhotoAsync() { Debug.WriteLine("taking picture..."); using (var stream [...] read more
I got this error when trying to pick a folder then displaying all the images in it. my code: var folderPicker = new Windows.Storage.Pickers.FolderPicker(); folderPicker.FileTypeFilter.Add(".jpg"); var folder = await folderPicker.PickSingleFolderAsync(); var filesList = await folder.GetFilesAsync(); for (int i = 0; i < filesList.Count ; i++) { using (var stream = [...] read more
I have a structure containing an image in black and white: public class Img { public int height; public int width; public byte[] matrix; } The values containing in matrix are 0 or 255. What is the best way to display this image in a component using C# WPF? I've [...] read more
I have a byte array to a BitmapImage converter and it works fine. For tile support within my app, I create a tile from an image (resize and crop it) and save it into my database as byte array. Now, if I want to display this tile with my converter, [...] read more
I'm making a Windows Phone 8.1 app (Windows Runtime, not Silverlight 8.1), and I need to create a WriteableBitmap from a Stream, but when I try to do so, I get this exception: "An exception of type 'System.Exception' occurred in mscorlib.ni.dll but was not handled in user code > Additional [...] read more
I have a Web image with specified URL, it can be browsed in the browser. i tried to retrieve it from web url and when program goes to bitmapImage.SetSource(ms); i get a exception " ex = {System.Exception: The component cannot be found. (Exception from HRESULT: 0x88982F50) at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at [...] read more
I use a cache mechanism, which saves images to the isolated storage and load it the next times, especially when there's no internet connection. However, it works fine for small images, but not for "large" images which are about 200kb. This is my code: public static object ExtractFromLocalStorage(Uri imageFileUri, string [...] read more
I am trying to load a texture from a .GLB model in Direct3D 11. The image data is encoded as PNG (I checked the buffer and I could see the file signature in the first 4 bytes). When I try to execute my code, there is an HRESULT returning a [...] read more
I'm having an issue when loading a BitmapImage. I'm using 2 functions to return a bitmapimage. The first function determines which image it should load and then pass off a StorageFile to the second function to read this file in from the assets folder. There doesn't seem to be any [...] read more
I'm running into an issue where I can't load 3D .obj files into my test app. I get the following exception: System.NotSupportedException: 'No imaging component suitable to complete this operation was found.' COMException: The component cannot be found. (Exception from HRESULT: 0x88982F50) The code being used is: Model3DGroup combinedModel = [...] read more
I need to render an xaml element and apply a blur effect using LumiaImageSDK 3 var bitmapRended = new RenderTargetBitmap(); await bitmapRended.RenderAsync(LayoutRoot); IBuffer buffer = await bitmapRended.GetPixelsAsync(); var target = new WriteableBitmap(bitmapRended.PixelWidth, bitmapRended.PixelHeight); var source = new BufferImageSource(buffer); var blur = new BlurEffect(source, 128); var renderer = new WriteableBitmapRenderer(blur, target); [...] read more
For Windows Phone 8 development, everything I've read is saying that you have to set a stream as the source of a bitmapimage in order to convert a byte[] array to a bitmapimage. When I implement this though, I receive an error at: bitmapImage.SetSource(stream); Error: An exception of type 'System.Exception' [...] read more
How can i get an Image from a base64 string on Windows Phone 8.1? I know how to decode the image if that helps? var imageBytes = Convert.FromBase64String(base64StringWithImageData); var ms = new MemoryStream(imageBytes, 0, imageBytes.Length); var decoder = await BitmapDecoder.CreateAsync(BitmapDecoder.PngDecoderId, ms.AsRandomAccessStream()); But nowhere have i found how i can get [...] read more
I need to convert rgb to YCBCR pixel format. and i used WICConvertBitmapSource(). my source pixel format is GUID_WICPixelFormat24bppBGR. And iwanted to convert it to GUID_WICPixelFormat16bppCbCr when I trying to pass that to the function, its return HRESULT as 0x88982F50. if i pass GUID_WICPixelFormat32bppBGRA ,the functions returns no error my [...] read more
I want to be able to save images in IsolatedStorage, and later get it. for this purpose I wrote a helper which I want to access it from everywhere in my app: for creating an image: public static void SaveImage(Stream image, string name) { try { IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication(); [...] read more
I try to get an image stream from IsolatedStorage then assign it a bitmap image, like this: using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(filePath, FileMode.Open, isolatedStorage)) { BitmapImage image = new BitmapImage(); image.SetSource(fileStream); return image; } But in image.SetSource(fileStream) line, I get this error: > The component cannot be found. (Exception [...] read more
My program is loading a BitmapImage from file using the Uri constructor for use in a WPF image. This works perfectly fine on my machine (and on most user's machines), but one of my users is getting an exception when constructing the BitmapImage from the following relevant section of code. [...] read more
I'm trying to load a ID2D1Bitmap from a bitmap resource. To do so, I consulted an MSDN guide which told me to use the Windows Imaging Component (IWIC) to process the image before Direct2D uses it. However, it fails when I call CreateDecoderFromStream(), and it returns a strange error message [...] read more
I want to get a BitmapImage when capture view's screenshot. So I start to get byte array data first, then convert to BitmapImage. RenderTargetBitmap renderTarget = new RenderTargetBitmap(); await renderTarget.RenderAsync(swapChainPanel); IBuffer pixelBuffer = await renderTarget.GetPixelsAsync(); await GetBitmapAsync(pixelBuffer.ToArray()); ... public static async Task<BitmapImage> GetBitmapAsync(byte[] data) { var bitmapImage = new BitmapImage(); [...] read more
My question is about: * So I can connect to an MS Access Database and read from it. * Store the data from the data table. * Cannot convert the byte[] data to a displayable image for my WPF application * I am trying to retrieve a jpeg or png [...] read more
My objective is to resize an image that I create and after resizing it with the same ratio and finally save it on my drive. so just below the code is working I'm 100% sure that the code work The problem is on the ResizeImage method. Everything work well until [...] read more
I'm working on a (Universal Windows) c++/cx Directx project, which builds to a dll used in a c# UWP project. I'm using the DirectX Toolkit to load textures. I already use it to create a texture from file, but now I need it to create a texture from a byte [...] read more
I have a .DDS texture file with a format of DXGI_FORMAT_BC3_UNORM that contains 10 mipmaps which I have linked here: https://1drv.ms/u/s!AiGFMy6hVmtN1Ba3UZsc8682VcEO I would like to display each individual mipmap of this texture to my XAML app's UI, so I need to convert them to bitmaps. I am getting the data [...] read more
I wanted to test my application on the computer of a friend to check, if my work on runs on other peoples' machine. (Do I have included all libraries? Etc.) However, my application crashes when I load *.dds textures. I use them in the 2D background of my scene. Here [...] read more
I am trying to render layout data to a bitmap in a platform-agnostic manner by returning a Splat.IBitmap and am having trouble outputting the results. My WPF platform code looks like this: MemoryStream stream = new MemoryStream(); try { RenderTargetBitmap target = new RenderTargetBitmap(1024, 1024, 300, 300, PixelFormats.Default); PreviewView preview [...] read more
PROBLEM I'm trying using ZXing.Net.Mobile to create barcode image in UWP project. I found this approach. But in line var wb = result.ToBitmap() as WriteableBitmap; I'm getting result as byte[], which doesn't have method ToBitmap(). Then I found this straight forward code var writer = new BarcodeWriter(); writer.Format = BarcodeFormat.QR_CODE; [...] read more
I have a WritableBitmap that was created from a snapshot from a webcam. I want to load it into a BitmapDecoder so I can crop the image. Here is the code: IRandomAccessStream ras = displaySource.PixelBuffer.AsStream().AsRandomAccessStream(); BitmapDecoder decoder = await BitmapDecoder.CreateAsync(ras); //Fails Here displaySource is the WritableBitmap from the webcam and [...] read more
I'm doing this way: using Windows.Storage; using Windows.UI.Xaml.Media.Imaging; ... private async void LoadFiles() { StorageFolder folder = KnownFolders.SavedPictures; IReadOnlyList<StorageFile> list = await folder.GetFilesAsync(); var images = new List<BitmapImage>(); if (list != null) { foreach (StorageFile file in list) { var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read); BitmapImage bitmapImage = new BitmapImage(); await [...] read more
I want to set hex string The following format that start with 0x to source of <Image> control. Data in resource is : var myImageData = "0x89504E470D0A1A0A0000000D0F910000000467414D410....." I used the following method to convert to byte array myImageData : static byte[] GetBytes(string data) { var bytes = new byte[data.Length * [...] read more
I am trying to add an element in existing isolated folder in xml code: public void writeToXML(List<AppTile> appList) { // Write to the Isolated Storage XmlWriterSettings x_W_Settings = new XmlWriterSettings(); x_W_Settings.Indent = true; using (IsolatedStorageFile ISF = IsolatedStorageFile.GetUserStoreForApplication()) { if (!ISF.FileExists("config.xml")) { using (IsolatedStorageFileStream stream = ISF.OpenFile("config.xml", FileMode.CreateNew)) { XmlSerializer [...] read more
I have a byte array stored in an entity framework database. The list of objects is set to a ListView source. The list view has this template as its item template: <DataTemplate x:Key="ItemContentTemplate"> <Grid Height="auto" Margin="0,0,0,10"> <Image Width="auto" Height="auto" Source="{Binding InitialImage, Converter={StaticResource ResourceKey=ImageSourceConverter}}" Margin="10"/> </Grid> </DataTemplate> I'm using this as [...] read more
So I have this method to set some basic MetaData tags which eventually will be added to my image: BitmapMetadata metaData = new BitmapMetadata("jpg"); foreach (var t in tags) { try { switch (t.Key) { case "Author": metaData.Author = new System.Collections.ObjectModel.ReadOnlyCollection<string>(new string[] { t.Value }); break; case "Rating": int rating [...] read more
I would like to resize an image picked from the gallery of the phone before uploading it via background transfer so far I have:- filePicker.pickSingleFileAsync().then(function (file) { uploadSingleFileAsync(uri, file); }).done(null, displayException); function uploadSingleFileAsync(uri, file) { if (!file) { displayError("Error: No file selected."); return; } return file.getBasicPropertiesAsync().then(function (properties) { if (properties.size [...] read more
I am using a ValueConverter to get the thumbnail for an m4 file that was recorded by directly with WinRT's MediaCapture. After much debugging and alternate approaches, I've settle on the converter code below. I am getting the following error The component cannot be found. (Exception from HRESULT: 0x88982F50) on [...] read more
I have a Web service which is connected to a DB, I need to pull out a type BLOB from that BD through the web service and then create an Image. The web service send a bytes array from the blob and I tried with a converter bind to the [...] read more
I'm using the following to convert incoming Byte array data from a network stream into an image to display on screen but after awhile of running fine I keep getting the exception "No imaging component suitable to complete this operation was found." with the inner exception of "The component cannot [...] read more