Image 클래스

정의

BitmapMetafile 서브클래스에 기능을 제공하는 추상 기본 클래스입니다.

public ref class Image abstract : MarshalByRefObject, ICloneable, IDisposable, System::Runtime::Serialization::ISerializable
public abstract class Image : MarshalByRefObject, ICloneable, IDisposable, System.Runtime.Serialization.ISerializable
[System.ComponentModel.TypeConverter("System.Drawing.ImageConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")]
public abstract class Image : MarshalByRefObject, ICloneable, IDisposable, System.Runtime.Serialization.ISerializable
[System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))]
public abstract class Image : MarshalByRefObject, ICloneable, IDisposable, System.Runtime.Serialization.ISerializable
[System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))]
[System.Serializable]
public abstract class Image : MarshalByRefObject, ICloneable, IDisposable, System.Runtime.Serialization.ISerializable
[System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Image : MarshalByRefObject, ICloneable, IDisposable, System.Runtime.Serialization.ISerializable
type Image = class
    inherit MarshalByRefObject
    interface ICloneable
    interface IDisposable
    interface ISerializable
[<System.ComponentModel.TypeConverter("System.Drawing.ImageConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")>]
type Image = class
    inherit MarshalByRefObject
    interface ICloneable
    interface IDisposable
    interface ISerializable
[<System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))>]
type Image = class
    inherit MarshalByRefObject
    interface ICloneable
    interface IDisposable
    interface ISerializable
[<System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))>]
[<System.Serializable>]
type Image = class
    inherit MarshalByRefObject
    interface IDisposable
    interface ICloneable
    interface ISerializable
[<System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageConverter))>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Image = class
    inherit MarshalByRefObject
    interface ISerializable
    interface ICloneable
    interface IDisposable
Public MustInherit Class Image
Inherits MarshalByRefObject
Implements ICloneable, IDisposable, ISerializable
상속
파생
특성
구현

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었습니다. 이벤트에 대한 처리기입니다 Paint . Graphics 개체가 이벤트에 전달되고 양식에 이미지를 그리는 데 사용됩니다. 코드는 다음 작업을 수행합니다.

  • SampImag.jpg 파일에서 이미지를 만듭니다. 이 파일은 애플리케이션 실행 파일과 동일한 폴더에 있어야 합니다.

  • 이미지의 왼쪽 위 모서리를 그릴 지점을 만듭니다.

  • 폼에 크기가 지정되지 않은 이미지를 그립니다.

private:
   void ImageExampleForm_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) 
   {
      // Create image.
      Image^ newImage = Image::FromFile( "SampImag.jpg" );

      // Create Point for upper-left corner of image.
      Point ulCorner = Point(100,100);

      // Draw image to screen.
      e->Graphics->DrawImage( newImage, ulCorner );
   }
private void ImageExampleForm_Paint(object sender, PaintEventArgs e)
{         
    // Create image.
    Image newImage = Image.FromFile("SampImag.jpg");
             
    // Create Point for upper-left corner of image.
    Point ulCorner = new Point(100, 100);
             
    // Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner);
}
Private Sub ImageExampleForm_Paint _
    (ByVal sender As System.Object, _
    ByVal e As System.Windows.Forms.PaintEventArgs) _
    Handles MyBase.Paint


    ' Create image.
    Dim newImage As Image = Image.FromFile("SampImag.jpg")

    ' Create Point for upper-left corner of image.
    Dim ulCorner As New Point(100, 100)

    ' Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner)
End Sub

설명

Windows Form에서 를 Image 그리려면 메서드 중 DrawImage 하나를 사용합니다.

참고

.NET 6 이상 버전에서는 이 형식을 포함하는 System.Drawing.Common 패키지가 Windows 운영 체제에서만 지원됩니다. 플랫폼 간 앱에서 이 형식을 사용하면 컴파일 시간 경고 및 런타임 예외가 발생합니다. 자세한 내용은 Windows에서만 지원되는 System.Drawing.Common을 참조하세요.

속성

Flags

Image의 픽셀 데이터에 대한 특성 플래그를 가져옵니다.

FrameDimensionsList

Image에 있는 프레임의 크기를 나타내는 GUID의 배열을 가져옵니다.

Height

Image의 높이(픽셀)를 가져옵니다.

HorizontalResolution

Image의 가로 해상도(인치 당 픽셀 수)를 가져옵니다.

Palette

Image에 사용되는 색상표를 가져오거나 설정합니다.

PhysicalDimension

이 이미지의 너비와 높이를 가져옵니다.

PixelFormat

Image의 픽셀 형식을 가져옵니다.

PropertyIdList

Image에 저장된 속성 항목의 ID를 가져옵니다.

PropertyItems

Image에 저장된 모든 속성 항목(메타데이터)을 가져옵니다.

RawFormat

Image의 파일 형식을 가져옵니다.

Size

이 이미지의 너비와 높이를 픽셀로 가져옵니다.

Tag

이미지에 대한 추가 데이터를 제공하는 개체를 가져오거나 설정합니다.

VerticalResolution

Image의 세로 해상도(인치 당 픽셀 수)를 가져옵니다.

Width

Image의 너비(픽셀)를 가져옵니다.

메서드

Clone()

Image의 정확한 복사본을 만듭니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Image에서 사용하는 리소스를 모두 해제합니다.

Dispose(Boolean)

Image에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Finalize()

가비지 컬렉션이 회수하기 전에 개체가 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다.

FromFile(String)

지정된 파일에서 Image를 만듭니다.

FromFile(String, Boolean)

해당 파일에 포함된 색 관리 정보를 사용하여 지정된 파일에서 Image를 만듭니다.

FromHbitmap(IntPtr)

GDI 비트맵 핸들에서 Bitmap을 만듭니다.

FromHbitmap(IntPtr, IntPtr)

GDI 비트맵 핸들과 GDI 색상표 핸들에서 Bitmap을 만듭니다.

FromStream(Stream)

지정된 데이터 스트림에서 Image를 만듭니다.

FromStream(Stream, Boolean)

해당 스트림에 포함된 색 관리 정보를 선택적으로 사용하여 지정된 데이터 스트림에서 Image를 만듭니다.

FromStream(Stream, Boolean, Boolean)

포함된 색 관리 정보를 선택적으로 사용하고 이미지 데이터의 유효성을 검사하여 지정된 데이터 스트림에서 Image를 만듭니다.

GetBounds(GraphicsUnit)

지정된 단위로 이미지의 범위를 가져옵니다.

GetEncoderParameterList(Guid)

지정된 이미지 인코더가 지원하는 매개 변수에 대한 정보를 반환합니다.

GetFrameCount(FrameDimension)

지정된 크기의 프레임 수를 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetPixelFormatSize(PixelFormat)

지정된 픽셀 형식의 색 농도(픽셀 당 비트 수)를 반환합니다.

GetPropertyItem(Int32)

지정된 속성 항목을 이 Image에서 가져옵니다.

GetThumbnailImage(Int32, Int32, Image+GetThumbnailImageAbort, IntPtr)

Image의 축소판 그림을 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
IsAlphaPixelFormat(PixelFormat)

Image에 대한 픽셀 형식에 알파 정보가 포함되는지 여부를 나타내는 값을 반환합니다.

IsCanonicalPixelFormat(PixelFormat)

픽셀 형식이 32비트/픽셀인지 여부를 나타내는 값을 반환합니다.

IsExtendedPixelFormat(PixelFormat)

픽셀 형식이 64비트/픽셀인지 여부를 나타내는 값을 반환합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
RemovePropertyItem(Int32)

지정된 속성 항목을 이 Image에서 제거합니다.

RotateFlip(RotateFlipType)

Image를 회전하거나, 대칭 이동하거나, 회전하여 대칭 이동합니다.

Save(Stream, ImageCodecInfo, EncoderParameters)

지정된 인코더 및 이미지 인코더 매개 변수를 사용하여 이 이미지를 지정된 스트림에 저장합니다.

Save(Stream, ImageFormat)

이 이미지를 지정된 형식의 지정된 스트림에 저장합니다.

Save(String)

Image를 지정된 파일이나 스트림에 저장합니다.

Save(String, ImageCodecInfo, EncoderParameters)

지정된 인코더 및 이미지 인코더 매개 변수를 사용하여 이 Image를 지정된 파일에 저장합니다.

Save(String, ImageFormat)

Image를 지정된 형식으로 지정된 파일에 저장합니다.

SaveAdd(EncoderParameters)

Save 메서드에 대한 이전 호출에 지정된 파일이나 스트림에 프레임을 추가합니다. 이 메서드를 사용하여 다중 프레임 이미지에서 선택한 프레임을 다른 다중 프레임 이미지에 저장합니다.

SaveAdd(Image, EncoderParameters)

Save 메서드에 대한 이전 호출에 지정된 파일이나 스트림에 프레임을 추가합니다.

SelectActiveFrame(FrameDimension, Int32)

크기와 인덱스로 지정한 프레임을 선택합니다.

SetPropertyItem(PropertyItem)

Image에 속성 항목(메타데이터)을 저장합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

대상 개체를 직렬화하는 데 필요한 데이터로 SerializationInfo를 채웁니다.

적용 대상

추가 정보