Answer the question
In order to leave comments, you need to log in
How to show a bitmap continuously in an Image in WPF?
Subject. There is a method that receives WriteableBitmap as input (from the Kinect video stream), in the method, WriteableBitmap is converted to a regular Bitmap, then work is done with it, and at the output I convert it to BitmapSource. Actually, how can I continuously display this bitmap in an Image? DispatcherTimer terribly clogs memory. Are there any other ways?
ZY I'm new to c# and WPF, respectively.
Answer the question
In order to leave comments, you need to log in
Hung my Image<> in the ImageBox supplied by Emgu, and not in the WPF's Image. Now the memory does not fly away.
ZY I'm new to c# and WPF, respectively.
class BitmapContainer : INotifyPropertyChanged
{
public BitmapContainer()
{
//...
DataContext = this;
//...
}
private BitmapSource varBmpSrc_;
public BitmapSource BmpSrc
{
get
{
return varBmpSrc_;
}
set
{
varBmpSrc_ = value;
OnPropertyChanged("BmpSrc");//обязательно!!! Имплементить INotifyPropertyChanged интерфейс
}
}
}
...
<Image Source={Binding BmpSrc, UpdateSourceTrigger=PropertyChanged} />
...
//где-то на просторах вашего кода
bitmapContainerObject.BmpSrc = Converter(WriteableBitmap);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question