load image on canvas when navigate.. which is on other canvas in other page with c# and xaml in windows app -


i have used following code pick image on canvas.now want add image on canvas on different page when navigate it.

private async void edit_click(object sender, routedeventargs e)     {          windows.storage.pickers.fileopenpicker filepicker = new windows.storage.pickers.fileopenpicker();         filepicker.suggestedstartlocation = windows.storage.pickers.pickerlocationid.pictureslibrary;         filepicker.filetypefilter.add(".jpg");         filepicker.filetypefilter.add(".png");         filepicker.filetypefilter.add(".bmp");         filepicker.viewmode = windows.storage.pickers.pickerviewmode.thumbnail;         windows.storage.storagefile imagefile = await filepicker.picksinglefileasync();         if (imagefile != null)         {             windows.ui.xaml.media.imaging.bitmapimage bitmap = new windows.ui.xaml.media.imaging.bitmapimage();             windows.storage.streams.irandomaccessstream stream = await imagefile.openasync(windows.storage.fileaccessmode.read);             image newimage = new image();             bitmap.setsource(stream);             newimage.source = bitmap;             newimage.height = 250;             newimage.stretch = stretch.uniformtofill;             newimage.manipulationmode = manipulationmodes.all;              this.thecanvas.children.add(newimage);         }     }      private void save_click(object sender, routedeventargs e)     {          this.frame.navigate(typeof(showdp));     } 

you can in many ways, 1 create static repository of images like:

public class settings {  public static image canvasimage; } 

and set in code, in edit click or consider, , can , set part of app using:

settings.canvasimage = ... 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -