xaml이 아닌 코드에 동적으로 단추에 이미지를 추가하는 방법을 알고 싶습니다. 누군가가 다음과 같은 방법을WP7 응용 프로그램의 코드 숨김 파일에서 실버 라이트 버튼에 배경 이미지를 설정하는 방법
ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri(@"Images/myImage.png", UriKind.Relative));
AlphabetButton.Background = brush;
을 진행 제안했지만 BitmapImage는 내가 BitConvertor 및 Bitmapcache을 찾을 수 있습니다 불구하고 인텔리에 의해 감지되지 않습니다. 예상대로
ImageBrush background = new ImageBrush();
background.ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"SplashScreenImage.jpg", UriKind.Relative));
Button1.Background = background;
작품 :이 방법이 아닌 경우 , 어떻게 다른 내가 배경 이미지
감사합니다 .. :) 네임 스페이스에 using.windows.media.imaging을 추가했습니다. 이제 BitmapImage에 액세스 할 수 있습니다. – alfah