Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/touseefelahi/stira.imagelibrary.wpf
This library have some controls that can display raw bytes or OpenCV Mat as Image in the WPF Image Control
https://github.com/touseefelahi/stira.imagelibrary.wpf
Last synced: 13 days ago
JSON representation
This library have some controls that can display raw bytes or OpenCV Mat as Image in the WPF Image Control
- Host: GitHub
- URL: https://github.com/touseefelahi/stira.imagelibrary.wpf
- Owner: Touseefelahi
- Created: 2020-08-27T13:55:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T05:33:10.000Z (over 2 years ago)
- Last Synced: 2023-05-21T23:19:41.670Z (over 1 year ago)
- Language: C#
- Size: 323 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Welcome to STIRA Image Library for WPF
This library have a control that can display raw bytes as image int ImageControl
in WPF
### Usage
Set the Resolution of input Image as WidthImage and HeightImage to in Image control.
For grayscall images fill the RawBytes from Row Column (0, 0) to (MaxWidth, MaxHeight).
For colored images set IsColored to true and fill the RawBytes in RGB format.### Light Image
xmlns:il="clr-namespace:Stira.ImageLibrary.Wpf;assembly=Stira.ImageLibrary.Wpf"
And in the backend we must Update FrameCounter to refresh the image at every new frame
e.g.public byte[] RawBytes { get; set; }
public int FrameCounter
{
get => frameCounter;
set => SetProperty(ref frameCounter, value);
}private void FrameReady(byte[] rawBytes)
{
if (rawBytes != null)
{
RawBytes = rawBytes;
RaisePropertyChanged(nameof(RawBytes));
FrameCounter++;
}
}### Mat Image
xmlns:il="clr-namespace:Stira.ImageLibrary.Wpf;assembly=Stira.ImageLibrary.Wpf"
#### And in the backend we must Update FrameCounter to refresh the image at every new frame e.g.
public StreamViewModel()
{
Camera = new Camera
{
IP = "192.168.10.239"
};
Camera.Updates += StreamUpdates;
Image = new Mat((int)Camera.Height, (int)Camera.Width,
Emgu.CV.CvEnum.DepthType.Cv8U, 1);
RaisePropertyChanged(nameof(Image));
}public int FrameCounter
{
get => frameCounter;
set => SetProperty(ref frameCounter, value);
}public Mat Image { get; set; }
private void FrameReady(byte[] rawBytes)
{
if (rawBytes != null)
{
Marshal.Copy(rawBytes, 0, Image.DataPointer, rawBytes.Length);
FrameCounter++; //Change in frameCounter refreshes the Image
}
}