NewItemFactory.GetImageStream 메서드

컬렉션 편집기나 하위 속성 편집기에서 아이콘으로 사용할 수 있는 지정된 Type에 대한 이미지를 가져옵니다.

네임스페이스:  Microsoft.Windows.Design.PropertyEditing
어셈블리:  Microsoft.Windows.Design.Interaction(Microsoft.Windows.Design.Interaction.dll)

구문

‘선언
Public Overridable Function GetImageStream ( _
    type As Type, _
    desiredSize As Size, _
    <OutAttribute> ByRef imageName As String _
) As Stream
public virtual Stream GetImageStream(
    Type type,
    Size desiredSize,
    out string imageName
)
public:
virtual Stream^ GetImageStream(
    Type^ type, 
    Size desiredSize, 
    [OutAttribute] String^% imageName
)
abstract GetImageStream : 
        type:Type * 
        desiredSize:Size * 
        imageName:string byref -> Stream 
override GetImageStream : 
        type:Type * 
        desiredSize:Size * 
        imageName:string byref -> Stream 
public function GetImageStream(
    type : Type, 
    desiredSize : Size, 
    imageName : String
) : Stream

매개 변수

  • type
    형식: System.Type
    이미지를 가져올 형식입니다.
  • imageName
    형식: System.String%
    찾은 이미지의 이름입니다.

반환 값

형식: System.IO.Stream
type에 표시할 이미지를 나타내는 Stream입니다.

예외

예외 상황
ArgumentNullException

type는 nullNull 참조(Visual Basic의 경우 Nothing)입니다.

설명

이 메서드는 컨트롤과 동일한 어셈블리에서 포함 리소스를 검색합니다.

type에 대해 사용할 수 있는 이미지가 여러 개인 경우 이 메서드는 desiredSize에 가장 가까운 이미지를 검색합니다. 이 메서드가 항상 desiredSize와 정확하게 일치하는 이미지를 반환하는 것은 아닙니다.

이 메서드가 반환하는 개체는 ContentControlContent 속성으로 설정될 수 있습니다.

이 메서드의 기본 구현에서는 Namespace.ControlName.Icon.Extension이라는 이미지를 검색합니다.

현재는 다음과 같은 확장명만 인식됩니다.

  • png

  • .bmp

  • .gif

  • .jpg

  • .jpeg

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

NewItemFactory 클래스

Microsoft.Windows.Design.PropertyEditing 네임스페이스

기타 리소스

WPF Designer 확장성