Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from Vips to System.Windows.Media.Imaging.BitmapImage #81

Open
gil-c opened this issue Jun 4, 2020 · 1 comment
Open

Conversion from Vips to System.Windows.Media.Imaging.BitmapImage #81

gil-c opened this issue Jun 4, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@gil-c
Copy link

gil-c commented Jun 4, 2020

Hello,

I saw the suggestions in the ticket #57

How about the conversion from Vips to System.Windows.Media.Imaging.BitmapImage?

Currently I am doing:

var bmImage = new BitmapImage();
bmImage.BeginInit();
bmImage.StreamSource = vipsImage.WriteToStream(".tiff");
bmImage.EndInit();

Is there a better way?

@kleisauke kleisauke added the enhancement New feature or request label Jun 12, 2020
@kleisauke
Copy link
Owner

Hi @gil-c,

I've never did anything with WPF, so it needs to be investigated. Perhaps you need also to set

bmImage.CacheOption = BitmapCacheOption.OnLoad;

to ensure the BitmapImage doesn't try to read a closed stream.

Let's tag this as an enhancement. Very happy to accept a PR of course, if you're able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants