开发者

Wp7 clear canvas value

开发者 https://www.devze.com 2023-04-12 22:00 出处:网络
I am using canvas to add image programatically. for example: Image image1=new image1(); Image image2=new image1();

I am using canvas to add image programatically.

for example:

Image image1=new image1();
Image image2=new image1();

            var left = new BitmapImage();
            left.UriSource = new Uri("images/box.png", UriKind.Relative);
            image1.Source = left;
            image2.Source = left;

ContentPanelCanvas.Children.Add(image1);
ContentPanelCanvas.Children.Add(image2);

First time enter the loop Add Image to canvas. second time i want to clear canvas.

and again add different images same canvas.

Is this possible wp7.

tel开发者_开发问答l some idea to do this.

thanks


Yes, it is possible:

ContentPanelCanvas.Children.Clear();

This will empty the canvas.


Why not simply change the Source property of the images you already added?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号