In my application, I want the user to upload an image as a canvas background. How can I assign a canvas background image?
Use ImageBrush to set the Canvas.Background property.
ImageBrush ib = new ImageBrush(); ib.ImageSource = new BitmapImage(new Uri(@"sampleImages\berries.jpg", UriKind.Relative)); mycanvas.Background = ib;
Source: https://habr.com/ru/post/912281/More articles:Can the bytecode created by luac be used on computers without the Lua library? - luaJSON parsing from Google Spreadsheet - jsonTwitter Bootstrap Carousel Slide not working - javascriptNotepad ++ Automatically detecting tabs or spaces in Python - pythonJava Awt Robot changes Windows mouse speed - javaWCF Primer - Unable to debug (insert) - debuggingCreate a custom "auto-increment" of the primary primary key? - sqlPosition independent code, shared libraries and code veneers - get them to work together - cIIS I / O Transitions - asp.netHow to write a test file to test things like “30 days expire”? - unit-testingAll Articles