Questions tagged [bitmapframe]
17 questions
2
votes
1 answer
How can I reference WindowsBase in .Net5?
I am writing a .NET 5 class library that contains the following code:
public T[] ConvertToArray(BitmapFrame frame, int samplesPerPixel) where T:struct
{
var pixelWidth = frame.PixelWidth;
var array = new T[pixelWidth * frame.PixelHeight…

Nigel
- 2,961
- 1
- 14
- 32
2
votes
2 answers
C# BitmapFrame.Thumbnail property is null for some images
I am trying to modify this project for showing images in a directory. But the problem is that the code does not work for all images like this one. So the problem is
BitmapFrame bitmapFrame = BitmapFrame.Create(new Uri(path))
Here on the repository…

Sumsuddin Shojib
- 3,583
- 3
- 26
- 45
2
votes
2 answers
Convert WPF BitmapSource to Icon for window
I have a 16x16 .png file which I have loaded as an ImageSource (BitmapSource) and it is working fine when I use it on an Image in a tabcontrol header.
I now want to use that same image in a floating window (inherited from the WPF Window class) when…

simmotech
- 61
- 1
- 4
1
vote
0 answers
Having BitmapFrame.Create() in my code breaks Winforms DPI scaling - Even if the code doesn't run
I have this function to check PNG color depth:
MemoryStream stream = new MemoryStream(File.ReadAllBytes(path));
var source = BitmapFrame.Create(stream, BitmapCreateOptions.IgnoreImageCache, BitmapCacheOption.OnDemand);
return…

nmkd
- 306
- 3
- 9
1
vote
1 answer
Exception: BitmapFrameDecode must have IsFrozen set to false to modify
I have a program written in C# WPF to print documents automatically. One of the features it has is it can detect image download failure so the document which has that empty image doesn't get printed.
This is one part of the code to detect download…

Rizki Pratama
- 551
- 4
- 23
1
vote
0 answers
BitmapFrame.Create cannot access this object
I'm trying to export several BitmapSource images from to png files. Here's my code:
Thread Call:
var exportImagesThread = new Thread(ExportRangeOfImages);
exportImagesThread.Start();
Function:
private void ExportRangeOfImages()
{
for (var…

Idanis
- 1,918
- 6
- 38
- 69
1
vote
2 answers
BitmapFrame in another thread
I am using a WPF BackgroundWorker to create thumbnails. My worker function looks like:
private void work(object sender, DoWorkEventArgs e)
{
try
{
var paths = e.Argument as string[];
var boxList = new List();
foreach…

Lasse Lindström
- 11
- 3
0
votes
2 answers
how to convert byte[] into BitmapFrame c#
I have tryed this but have exception - Operation is not valide due to current state of the object
private BitmapFrame backconvertor(byte[] incomingBuffer)
{
BitmapImage bmpImage = new BitmapImage();
MemoryStream mystream = new…

curiousity
- 4,703
- 8
- 39
- 59
0
votes
1 answer
BitmapMetadata: some properties clearing?
I'm dealing with this code: inside method call the metadata properties are all filled;
but in user code most of them are nulled. Why this behaviour?
public static BitmapFrame GetImageIPTC(string imageFile)
{
BitmapFrame meta;
using (var fs…

ʞᴉɯ
- 5,376
- 7
- 52
- 89
0
votes
1 answer
JpegBitmapEncoder / RenderTargetBitmap - excessive sharpening since .net 2 vs 4.7.2
I've been working on migrating legacy ASP.Net/C# system to Azure.
Initially just changing the minimal amount possible, but part of that is moving to updated .Net framework (2/3/3.5 => 4.7+)
Part of this is a tool which creates image previews in…

Daf
- 61
- 7
0
votes
1 answer
How to override(use) BitmapFrame.Thumbnail property in WPF C#?
Hello! The problem is? that I've got a multipage Tiff file to show, and I use
BitmapFrame.Thumbnail property to show small size thumbnail of every frame(page) of my multipage Tiff file. But< for some reason? the property returns null. Please, give…

Ivan Raskatov
- 11
- 4
0
votes
1 answer
Create BitmapFrame asynchronously in an async method
Anyone knows how to create BitmapFrame asynchronously in WPF?
I want to batch print XAML Image element whose Source property is set code behind. Here LogoImageUrl is the URL of the web image I want to load asynchronously.
LogoImage.Source =…

Rizki Pratama
- 551
- 4
- 23
0
votes
1 answer
C# WPF Release BitmapImage without using FileStream
My Question: Is there a way to load images into a BitmapImage that will not take up a tremendous amount of memory and the images can still be deleted? Read below for more details:
I have a class PhotoCollection : ObservableCollection{ },…

user3732456
- 33
- 9
0
votes
1 answer
Problem with BitmapFrame rendering (created from byte array) in C#
Here is the situation:
I have got the array of bytes containing the bitmap header together with the bitmap data. I know the offset of data, and I need to generate BitmapFrame for later rendering.
I wanted to avoid array cells copying and created a…

Jamie
- 1,092
- 3
- 22
- 44
0
votes
1 answer
BitmapFrame in WPF ComboBox
I have a dialog that lets the user pick a custom icon. Loaded icons are displayed in a combobox in which the user makes the selection. Here is the XAML code for the combobox:

Mizipzor
- 51,151
- 22
- 97
- 138