반응형

// img 에 출력하기.

protected override void OnManipulationStarted(ManipulationStartedEventArgs e)

        {

            WebClient webClient = new WebClient();

            webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_OpenReadCompleted);

            webClient.OpenReadAsync(new Uri("http://www.charlespetzold.com/Media/HelloWp7.jpg"));


            e.Complete();

            e.Handled = true;

            

            base.OnManipulationStarted(e);

        }


        void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)

        {

            if (!e.Cancelled && e.Error == null)

            {

                BitmapImage bmp = new BitmapImage();

                bmp.SetSource(e.Result);

                img.Source = bmp;

            }

        }

반응형
Posted by 컴스터
,