How achieve Image.Clone() in WPF? -
I get an array of byte (byte []) from db and present it in image control using the following method I:
public image binarymageframebottyconter (byte [] value image) {image img = new image (); Byte [] bytes = rectangle as value byte []; Memory stream stream = new memorystream (bytes); Bitmap image image = new bitmap image (); Image.BeginInit (); Image.StreamSource = Stream; Image.EndInit (); Img.Source = image; Img.Height = 240; Img.Width = 240; Return img; } So now that's sung, I want to copy the image. From image to image (control) to another element: Paragraph.
Paragraph 1. Online. Add (new inlineUI Container (ImageOne)); But nothings appear, I try to create a new image using ImageOne.Source, but I got this example with Yuri (@ "Path"), I The method can not be applied because my bitmap image comes from a byte [] type
image img = new image (); Img.Source = New Bitmap Image (New Urine (@ "C: \ Mouse \ A")); Help with this issue, thanks!
< Create a new image element and its source in the same bitmap image:Code> Byte [] imageInfo = File.ReadAllBytes ("IMG_0726.JPG"); Bitmap Image Image; (MemoryStream ImageStream = New MemoryStream (ImageInfo)) Using {image = new bitmapImage (); image.BeginInit (); Image .CacheOption = Bitmap sop.Open Download; Image.StreamSource = imageStream; image.EndInit ();} This.mainImage.Source = image; Th Is.secondaryImage.Source = image;This also works if you copy one source to another:
this.mainImage.Source = Image; this secondary image. Source = this.mima image. Source;
Comments
Post a Comment