'1.1마이그레이션'에 해당되는 글 2건

  1. 2008/03/06 Image.Source는 어떻게 쓰나
  2. 2008/03/06 BrowserHost야 어딜 간거니??? (4)
2008/03/06 20:15

Image.Source는 어떻게 쓰나

이미지 사용하기가 조금 복잡해졌어요.

Image image = new Image();
image.Source = new BitmapImage(new Uri("http://hugeflow.com/HFLogo.jpg", UriKind.Absolute));

하지만 의미를 찾자면 BitmapImage에 DownloadProgress이벤트가 있다는 것!
이제 이미지가 다 받아졌는지 확인 할 때 Timer 안 써도 된다는 것!

Image image = new Image();
BitmapImage bitmap = new BitmapImage(new Uri("http://hugeflow.com/HFLogo.jpg", UriKind.Absolute));
bitmap.DownloadProgress += new DownloadProgressEventHandler(bitmap_DownloadProgress);

이벤트 핸들러

void bitmap_DownloadProgress(object sender, DownloadProgressEventArgs e)
{
    BitmapImage bitmap = sender as BitmapImage;

    if (e.Progress == 1)
    {
         // 다 받아졌다!
    }
}


네임스페이스

using System.Windows.Media.Imaging;
이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

Trackback : http://gilverlight.net/trackback/2750 관련글 쓰기

2008/03/06 19:57

BrowserHost야 어딜 간거니???

BrowserHost.Resize 이벤트를 많이 애용했었지요.

BrowserHostApplication.Current.Host.Content로 대체됩니다.

Resized 이벤트는 이렇게

Application.Current.Host.Content.Resized += new EventHandler(Content_Resized);


void Content_Resized(object sender, EventArgs e)
{
    Width = Application.Current.Host.Content.ActualWidth;
    Height = Application.Current.Host.Content.ActualHeight;
}

IsFullScreen도 여기서 찾을 수 있습니다.

Application.Current.Host.Content.IsFullScreen


네임스페이스는 아래 것을 사용합니다.

using System.Windows;



이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 4

Trackback : http://gilverlight.net/trackback/2749 관련글 쓰기

  1. 배정민 2008/06/25 16:30 address edit & del reply

    좋은 정보 고맙습니다 ^^

    • BlogIcon 길버트 2008/06/26 11:29 address edit & del

      네~ 천만에요! :)

  2. 실버사랑 2008/08/31 20:26 address edit & del reply

    이 문제 찾아보고 있었는데 ..좋은정보 감사합니다.

    • BlogIcon 길버트 2008/09/01 13:46 address edit & del

      도움되셨다니, 기쁩니다!