'1.1마이그레이션'에 해당되는 글 2건
- 2008/03/06 Image.Source는 어떻게 쓰나
- 2008/03/06 BrowserHost야 어딜 간거니??? (4)
이미지 사용하기가 조금 복잡해졌어요.
하지만 의미를 찾자면 BitmapImage에 DownloadProgress이벤트가 있다는 것!
이제 이미지가 다 받아졌는지 확인 할 때 Timer 안 써도 된다는 것!
네임스페이스
Image image = new Image();
image.Source = new BitmapImage(new Uri("http://hugeflow.com/HFLogo.jpg", UriKind.Absolute));
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);
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;
BrowserHost.Resize 이벤트를 많이 애용했었지요.
BrowserHost가 Application.Current.Host.Content로 대체됩니다.
Resized 이벤트는 이렇게
IsFullScreen도 여기서 찾을 수 있습니다.
네임스페이스는 아래 것을 사용합니다.
BrowserHost가 Application.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;
}
{
Width = Application.Current.Host.Content.ActualWidth;
Height = Application.Current.Host.Content.ActualHeight;
}
IsFullScreen도 여기서 찾을 수 있습니다.
Application.Current.Host.Content.IsFullScreen
네임스페이스는 아래 것을 사용합니다.
using System.Windows;

이올린에 북마크하기
이올린에 추천하기



Prev

Rss Feed