■ InkCanvas 클래스 : 데이터 로드하기

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

using System.IO;

using System.Windows.Controls;

 

#region 데이터 로드하기 - LoadData(inkCanvas, filePath)

 

/// <summary>

/// 데이터 로드하기

/// </summary>

/// <param name="inkCanvas">InkCanvas 객체</param>

/// <param name="filePath">파일 경로</param>

public void LoadData(InkCanvas inkCanvas, string filePath)

{

    FileStream fileStream = null;

 

    try

    {

        fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);

 

        inkCanvas.Strokes = new StrokeCollection(fileStream);

    }

    finally

    {

        if(fileStream != null)

        {

            fileStream.Close();

        }

    }

}

 

#endregion

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요