C# Класс Paint.PictureIOManager

Picture IO manager. Handles reading and writing the Images files and the Image Information file
Наследование: IPictureIOManager
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CopyImage ( IFilenameResolver destinationImageFilenameResolver ) : void

Copies the image (and all associated data files) to the specified image name

CreateDirectoryStructure ( ) : void

Creates the directory structure for this image to be saved to disk

DeleteImage ( ) : void

Deletes the image and all associated data files

LoadData ( GraphicsDevice device, SpriteBatch spriteBatch, RenderTarget2D undoRedoRenderTargets, Color backgroundColor ) : void

Loads existing image data from disk into the undoRedoRenderTargets and copies latest canvas recorder files into the 'working folder'

LoadImageStateData ( ) : ImageStateData

Loads the imageStateData from disk

PictureIOManager ( IFilenameResolver filenameResolver ) : System

Initializes a new instance of the Paint.PictureIOManager class.

SaveData ( ImageStateData imageStateData, RenderTarget2D masterImageRenderTarget, RenderTarget2D undoRedoRenderTargets, int bottomMarginToCutOff ) : void

Saves all the undoRedoRenderTargets to disk and the imageStateData

SaveImageStateData ( string filename, ImageStateData imageStateData ) : void

Saves the imageStateData to disk

Описание методов

CopyImage() публичный Метод

Copies the image (and all associated data files) to the specified image name
public CopyImage ( IFilenameResolver destinationImageFilenameResolver ) : void
destinationImageFilenameResolver IFilenameResolver /// Details of where we need to copy the files. ///
Результат void

CreateDirectoryStructure() публичный Метод

Creates the directory structure for this image to be saved to disk
public CreateDirectoryStructure ( ) : void
Результат void

DeleteImage() публичный Метод

Deletes the image and all associated data files
public DeleteImage ( ) : void
Результат void

LoadData() публичный Метод

Loads existing image data from disk into the undoRedoRenderTargets and copies latest canvas recorder files into the 'working folder'
public LoadData ( GraphicsDevice device, SpriteBatch spriteBatch, RenderTarget2D undoRedoRenderTargets, Color backgroundColor ) : void
device GraphicsDevice /// Graphics device required for rendering ///
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch /// Sprite Batch for rendering the images into the rendertargets ///
undoRedoRenderTargets Microsoft.Xna.Framework.Graphics.RenderTarget2D /// Sequence of images representing the undo/redo chain ///
backgroundColor Color /// background color for all rendering ///
Результат void

LoadImageStateData() публичный Метод

Loads the imageStateData from disk
public LoadImageStateData ( ) : ImageStateData
Результат ImageStateData

PictureIOManager() публичный Метод

Initializes a new instance of the Paint.PictureIOManager class.
public PictureIOManager ( IFilenameResolver filenameResolver ) : System
filenameResolver IFilenameResolver Filename resolver.
Результат System

SaveData() публичный Метод

Saves all the undoRedoRenderTargets to disk and the imageStateData
public SaveData ( ImageStateData imageStateData, RenderTarget2D masterImageRenderTarget, RenderTarget2D undoRedoRenderTargets, int bottomMarginToCutOff ) : void
imageStateData ImageStateData Image state data.
masterImageRenderTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D /// Sequence of images representing the undo/redo chain
undoRedoRenderTargets Microsoft.Xna.Framework.Graphics.RenderTarget2D
bottomMarginToCutOff int Because the toolbox will always take up some space we will cut off the bottom section (toolbox height) /// when saving the master image so that there is no annoying white space at the bottom
Результат void

SaveImageStateData() публичный Метод

Saves the imageStateData to disk
public SaveImageStateData ( string filename, ImageStateData imageStateData ) : void
filename string File to save the image data
imageStateData ImageStateData Image state data.
Результат void