ToolboxBitmapAttribute.GetImage 메서드

정의

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

오버로드

GetImage(Object)

Image 개체와 관련된 작은 ToolboxBitmapAttribute를 가져옵니다.

GetImage(Type)

Image 개체와 관련된 작은 ToolboxBitmapAttribute를 가져옵니다.

GetImage(Object, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

GetImage(Type, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

GetImage(Type, String, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

GetImage(Object)

Image 개체와 관련된 작은 ToolboxBitmapAttribute를 가져옵니다.

public:
 System::Drawing::Image ^ GetImage(System::Object ^ component);
public System.Drawing.Image GetImage (object component);
public System.Drawing.Image? GetImage (object? component);
member this.GetImage : obj -> System.Drawing.Image
Public Function GetImage (component As Object) As Image

매개 변수

component
Object

ToolboxBitmapAttribute 개체에 작은 이미지가 없으면 이 메서드는 구성 요소 매개 변수에서 지정한 개체의 형식을 정의하는 어셈블리에서 비트맵 리소스를 검색합니다. 예를 들어, ControlA 형식의 개체를 구성 요소 매개 변수에 전달하는 경우 이 메서드는 ControlA를 정의하는 어셈블리를 검색합니다.

반환

Image

Image 개체와 관련된 작은 ToolboxBitmapAttribute입니다.

예제

다음 예제에서는 GetImage 메서드를 사용하는 방법을 보여 줍니다.

private:
    static Image^ GetImageOfCustomControl(Control^ userControl)
    {
        Image^ controlImage = nullptr;
        AttributeCollection^ attrCol =
            TypeDescriptor::GetAttributes(userControl);
        ToolboxBitmapAttribute^ imageAttr = (ToolboxBitmapAttribute^)
            attrCol[ToolboxBitmapAttribute::typeid];
        if (imageAttr != nullptr)
        {
            controlImage = imageAttr->GetImage(userControl);
        }

        return controlImage;
    }
private Image GetImageOfCustomControl(Control userControl)
{
    Image controlImage = null;
    AttributeCollection attrCol = 
            TypeDescriptor.GetAttributes(userControl);
    ToolboxBitmapAttribute imageAttr = (ToolboxBitmapAttribute)
        attrCol[typeof(ToolboxBitmapAttribute)];
    if (imageAttr != null)
    {
        controlImage = imageAttr.GetImage(userControl);
    }

    return controlImage;
}
Private Function GetImageOfCustomControl(ByVal userControl As Control) As Image 
    Dim controlImage As Image = Nothing
    Dim attrCol As AttributeCollection = TypeDescriptor.GetAttributes(userControl)
    Dim imageAttr As ToolboxBitmapAttribute = _
        CType(attrCol(GetType(ToolboxBitmapAttribute)), ToolboxBitmapAttribute)
    If (imageAttr IsNot Nothing) Then
        controlImage = imageAttr.GetImage(userControl)
    End If
    
    Return controlImage

End Function

설명

이 메서드는 namespace.classname.bmp 리소스를 검색합니다. 여기서 네임스페이스는 매개 변수로 지정된 개체 형식의 정의를 포함하는 네임스페이 component 스입니다. 예를 들어 ControlA 형식의 개체를 매개 변수에 전달한다고 가정합니다 component . ControlA가 AssemblyA.dll NamespaceA에 있는 경우 이 메서드는 AssemblyA.dll NamespaceA.ControlA.bmp 리소스를 검색합니다.

적용 대상

GetImage(Type)

Image 개체와 관련된 작은 ToolboxBitmapAttribute를 가져옵니다.

public:
 System::Drawing::Image ^ GetImage(Type ^ type);
public System.Drawing.Image GetImage (Type type);
public System.Drawing.Image? GetImage (Type type);
member this.GetImage : Type -> System.Drawing.Image
Public Function GetImage (type As Type) As Image

매개 변수

type
Type

ToolboxBitmapAttribute 개체에 작은 이미지가 없으면 이 메서드는 형식 매개 변수에서 지정한 형식을 정의하는 어셈블리에서 비트맵 리소스를 검색합니다. 예를 들어, typeof(ControlA)를 형식 매개 변수에 전달하는 경우 이 메서드는 ControlA를 정의하는 어셈블리를 검색합니다.

반환

Image

Image 개체와 관련된 작은 ToolboxBitmapAttribute입니다.

설명

이 메서드는 namespace.classname.bmp 리소스를 검색합니다. 여기서 네임스페이스는 매개 변수로 지정된 형식의 정의를 포함하는 네임스페이 type 스입니다. 예를 들어 typeof(ControlA)를 매개 변수에 전달한다고 가정합니다 type . ControlA가 AssemblyA.dll NamespaceA에 있는 경우 이 메서드는 AssemblyA.dll NamespaceA.ControlA.bmp 리소스를 검색합니다.

적용 대상

GetImage(Object, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

public:
 System::Drawing::Image ^ GetImage(System::Object ^ component, bool large);
public System.Drawing.Image GetImage (object component, bool large);
public System.Drawing.Image? GetImage (object? component, bool large);
member this.GetImage : obj * bool -> System.Drawing.Image
Public Function GetImage (component As Object, large As Boolean) As Image

매개 변수

component
Object

ToolboxBitmapAttribute 개체에 작은 이미지가 없으면 이 메서드는 구성 요소 매개 변수에서 지정한 개체의 형식을 정의하는 어셈블리에서 비트맵 리소스를 검색합니다. 예를 들어, ControlA 형식의 개체를 구성 요소 매개 변수에 전달하는 경우 이 메서드는 ControlA를 정의하는 어셈블리를 검색합니다.

large
Boolean

이 메서드에 의해 큰 이미지(true) 또는 작은 이미지(false)가 반환될지 여부를 지정합니다. 작은 이미지는 16x16이고, 큰 이미지는 32x32입니다.

반환

Image

Image 개체와 관련된 ToolboxBitmapAttribute 개체입니다.

설명

이 메서드는 namespace.classname.bmp 리소스를 검색합니다. 여기서 네임스페이스는 매개 변수로 지정된 개체 형식의 정의를 포함하는 네임스페이 component 스입니다. 예를 들어 ControlA 형식의 개체를 매개 변수에 전달한다고 가정합니다 component . ControlA가 AssemblyA.dll NamespaceA에 있는 경우 이 메서드는 AssemblyA.dll NamespaceA.ControlA.bmp 리소스를 검색합니다.

ToolboxBitmapAttribute 개체에 큰 이미지가 아직 없는 경우 이 메서드는 작은 이미지의 크기를 조정하여 큰 이미지를 만듭니다.

적용 대상

GetImage(Type, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

public:
 System::Drawing::Image ^ GetImage(Type ^ type, bool large);
public System.Drawing.Image GetImage (Type type, bool large);
public System.Drawing.Image? GetImage (Type type, bool large);
member this.GetImage : Type * bool -> System.Drawing.Image
Public Function GetImage (type As Type, large As Boolean) As Image

매개 변수

type
Type

ToolboxBitmapAttribute 개체에 작은 이미지가 없으면 이 메서드는 구성 요소 형식에서 지정한 형식을 정의하는 어셈블리에서 비트맵 리소스를 검색합니다. 예를 들어, typeof(ControlA)를 형식 매개 변수에 전달하는 경우 이 메서드는 ControlA를 정의하는 어셈블리를 검색합니다.

large
Boolean

이 메서드에 의해 큰 이미지(true) 또는 작은 이미지(false)가 반환될지 여부를 지정합니다. 작은 이미지는 16x16이고, 큰 이미지는 32x32입니다.

반환

Image

Image 개체와 관련된 ToolboxBitmapAttribute입니다.

설명

이 메서드는 namespace.classname.bmp 리소스를 검색합니다. 여기서 네임스페이스는 매개 변수로 지정된 형식의 정의를 포함하는 네임스페이 type 스입니다. 예를 들어 typeof(ControlA)를 매개 변수에 전달한다고 가정합니다 type . ControlA가 AssemblyA.dll NamespaceA에 있는 경우 이 메서드는 AssemblyA.dll NamespaceA.ControlA.bmp 리소스를 검색합니다.

ToolboxBitmapAttribute 개체에 큰 이미지가 아직 없는 경우 이 메서드는 작은 이미지의 크기를 조정하여 큰 이미지를 만듭니다.

적용 대상

GetImage(Type, String, Boolean)

Image 개체와 관련된 작거나 큰 ToolboxBitmapAttribute를 가져옵니다.

public:
 System::Drawing::Image ^ GetImage(Type ^ type, System::String ^ imgName, bool large);
public System.Drawing.Image GetImage (Type type, string imgName, bool large);
public System.Drawing.Image? GetImage (Type type, string? imgName, bool large);
member this.GetImage : Type * string * bool -> System.Drawing.Image
Public Function GetImage (type As Type, imgName As String, large As Boolean) As Image

매개 변수

type
Type

ToolboxBitmapAttribute 개체에 작은 이미지가 없으면 이 메서드는 구성 요소 형식에서 지정한 형식을 정의하는 어셈블리에 포함된 비트맵 리소스를 검색합니다. 예를 들어, typeof(ControlA)를 형식 매개 변수에 전달하는 경우 이 메서드는 ControlA를 정의하는 어셈블리를 검색합니다.

imgName
String

포함된 비트맵 리소스의 이름입니다.

large
Boolean

이 메서드에 의해 큰 이미지(true) 또는 작은 이미지(false)가 반환될지 여부를 지정합니다. 작은 이미지는 16x16이고, 큰 이미지는 32x32입니다.

반환

Image

Image 개체와 관련된 ToolboxBitmapAttribute입니다.

설명

이 메서드는 namespace.imgName이라는 리소스를 검색합니다. 여기서 네임스페이스는 매개 변수로 지정된 형식의 정의를 포함하는 네임스페이 type 스입니다. 예를 들어 typeof(ControlA)를 매개 변수에 type 전달하고 imgName 매개 변수에 "MyBitmap.bmp"를 전달했다고 가정합니다. ControlA가 AssemblyA.dll NamespaceA에 있는 경우 이 메서드는 AssemblyA.dll NamespaceA.MyBitmap.bmp 리소스를 검색합니다.

ToolboxBitmapAttribute 개체에 큰 이미지가 아직 없는 경우 이 메서드는 작은 이미지의 크기를 조정하여 큰 이미지를 만듭니다.

적용 대상