Page 1 of 1

Creating ImageSource at runtime

Posted: 25 Apr 2016, 16:39
by ZanAlex
Hi everyone,

I'd like to have an ImageSource as a member of a data model and I'd like to create that ImageSource as I create my data model. I've had a look at the BitmapSource API and it requires an Drawing::Image, but I can't find that class in the headers, so I guess I cannot use it.

I've found a way to do it in regular WPF (http://stackoverflow.com/a/11881612), is there an equivalent in the C++ API?

Many thanks,
Alexandre.

Re: Creating ImageSource at runtime

Posted: 27 Apr 2016, 11:13
by jsantos
As explained in the Image Tutorial, you must use a TextureSource for runtime images. You can construct it using a path, as shown in the DataBinding C++ sample or using a native texture handle. In that case, you are in charge of loading the texture.

BitmapSource is deprecated. It will be removed in 1.2.6.