Reputation: 905
I'd like to draw an image (like a bar code) pixel-by-pixel in a Visual Basic .NET WPF Application and …
It should also be possible to add Paint-like editing features later.
What is a good approach?
System.Drawing.Bitmap
works internally, but the only way I could show it is to convert it to an ImageSource
and show it inside an Image
control. Is there any better way?
Upvotes: 1
Views: 678
Reputation: 184296
I think WriteableBitmap
might help, it already is an ImageSource
. Check out the documentation for some usage examples. I have not used this for a long time so i cannot help you with it, possibly searches on this site may turn up some useful info as well.
As WriteableBitmap
is a BitmapSource
you can just use Clipboard.SetImage
to copy it.
To save images you can in general use a subclass ob BitmapEncoder
(also see doc for usage; you probably want to use the BmpBitmapEncoder
).
Upvotes: 1