■ BitmapImage 클래스 : 부분 BitmapImage 객체 생성하기

----------------------------------------------------------------------------------------------------

using System;

using System.Windows;

using System.Windows.Media.Imaging;

 

#region BitmapImage 객체 생성하기 - CreateBitmapImage(uri, int32Rect)

 

/// <summary>

/// BitmapImage 객체 생성하기

/// </summary>

/// <param name="uri">URI 객체</param>

/// <param name="int32Rect">Int32Rect 객체</param>

/// <returns>BitmapImage 객체</returns>

public BitmapImage CreateBitmapImage(Uri uri, Int32Rect int32Rect)

{

    BitmapImage bitmapImage = new BitmapImage();

 

    bitmapImage.BeginInit();

 

    bitmapImage.UriSource = uri;

 

    bitmapImage.SourceRect = int32Rect;

 

    bitmapImage.EndInit();

 

    return bitmapImage;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker

댓글을 달아 주세요