다음을 통해 공유


TextureLoader.FromStream 메서드 (Device, Stream, Int32, Int32, Int32, Int32, Usage, Format, Pool, Filter, Filter, Int32)

업데이트: 2007년 11월

지정된 속성을 사용하여 메모리 내 파일에서 질감을 만듭니다.

네임스페이스:  Microsoft.WindowsMobile.DirectX.Direct3D
어셈블리:  Microsoft.WindowsMobile.DirectX(Microsoft.WindowsMobile.DirectX.dll)

구문

‘선언
Public Shared Function FromStream ( _
    device As Device, _
    stream As Stream, _
    readBytes As Integer, _
    width As Integer, _
    height As Integer, _
    mipLevels As Integer, _
    usage As Usage, _
    format As Format, _
    pool As Pool, _
    filter As Filter, _
    mipFilter As Filter, _
    colorKey As Integer _
) As Texture
‘사용 방법
Dim device As Device
Dim stream As Stream
Dim readBytes As Integer
Dim width As Integer
Dim height As Integer
Dim mipLevels As Integer
Dim usage As Usage
Dim format As Format
Dim pool As Pool
Dim filter As Filter
Dim mipFilter As Filter
Dim colorKey As Integer
Dim returnValue As Texture

returnValue = TextureLoader.FromStream(device, _
    stream, readBytes, width, height, _
    mipLevels, usage, format, pool, filter, _
    mipFilter, colorKey)
public static Texture FromStream(
    Device device,
    Stream stream,
    int readBytes,
    int width,
    int height,
    int mipLevels,
    Usage usage,
    Format format,
    Pool pool,
    Filter filter,
    Filter mipFilter,
    int colorKey
)
public:
static Texture^ FromStream(
    Device^ device, 
    Stream^ stream, 
    int readBytes, 
    int width, 
    int height, 
    int mipLevels, 
    Usage usage, 
    Format format, 
    Pool pool, 
    Filter filter, 
    Filter mipFilter, 
    int colorKey
)
public static function FromStream(
    device : Device, 
    stream : Stream, 
    readBytes : int, 
    width : int, 
    height : int, 
    mipLevels : int, 
    usage : Usage, 
    format : Format, 
    pool : Pool, 
    filter : Filter, 
    mipFilter : Filter, 
    colorKey : int
) : Texture

매개 변수

  • stream
    형식: System.IO.Stream

    질감을 만드는 데 사용할 스트림입니다.

  • readBytes
    형식: System.Int32

    메모리 내 파일의 크기(바이트)입니다.

  • width
    형식: System.Int32

    너비(픽셀 단위)입니다. 이 값이 0이면 크기를 파일에서 가져옵니다.

  • height
    형식: System.Int32

    높이(픽셀)입니다. 이 값이 0이면 크기를 파일에서 가져옵니다.

  • mipLevels
    형식: System.Int32

    요청되는 밉 수준의 수입니다. 이 값이 0이면 완전한 밉맵 체인이 만들어집니다.

  • usage
    형식: Microsoft.WindowsMobile.DirectX.Direct3D.Usage

    0이나 Usage 값을 지정합니다. RenderTarget을 지정하여 표면이 렌더링 대상으로 사용됨을 나타냅니다. 이렇게 하면 리소스를 DeviceSetRenderTarget 메서드에 대한 renderTarget 매개 변수에 전달할 수 있습니다. 응용 프로그램에서는 ManagerCheckDeviceFormat 메서드를 사용하여 장치에서 이 연산을 지원하는지 여부를 확인해야 합니다. 표면이 동적으로 처리되어야 함을 나타내려면 Dynamic을 지정합니다.

  • colorKey
    형식: System.Int32

    투명 검정으로 바꿀 값이거나, 색상 키를 사용하지 않으려면 0입니다. colorKey는 항상 소스 이미지 형식에 관계없는 32비트 ARGB 색입니다. 알파는 최상위 8비트이며 불투명 색상 키의 경우 일반적으로 FF로 설정해야 합니다. 예를 들어, 불투명 검정의 경우 이 값은 0xFF000000과 같습니다.

반환 값

형식: Microsoft.WindowsMobile.DirectX.Direct3D.Texture

만든 질감 개체입니다.

예외

예외 상황
InvalidCallException

메서드 호출이 잘못된 경우. 예를 들어 메서드의 매개 변수에 잘못된 값이 포함되어 있을 수 있습니다.

OutOfMemoryException

Direct3D에서 호출을 완료하는 데 필요한 메모리를 할당할 수 없는 경우

설명

이 메서드는 .bmp, .dds, .jpg, .png 및 .gif 파일 형식을 지원합니다.

권한

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

플랫폼

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Compact Framework

3.5, 2.0에서 지원

참고 항목

참조

TextureLoader 클래스

TextureLoader 멤버

FromStream 오버로드

Microsoft.WindowsMobile.DirectX.Direct3D 네임스페이스