C# Class Paint.PictureIOManager

Picture IO manager. Handles reading and writing the Images files and the Image Information file
Inheritance: IPictureIOManager
Mostrar archivo Open project: RandolphBurt/MonoGame-iOS-SimplePaint Class Usage Examples

Public Methods

Method Description
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

Method Details

CopyImage() public method

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. ///
return void

CreateDirectoryStructure() public method

Creates the directory structure for this image to be saved to disk
public CreateDirectoryStructure ( ) : void
return void

DeleteImage() public method

Deletes the image and all associated data files
public DeleteImage ( ) : void
return void

LoadData() public method

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 ///
return void

LoadImageStateData() public method

Loads the imageStateData from disk
public LoadImageStateData ( ) : ImageStateData
return ImageStateData

PictureIOManager() public method

Initializes a new instance of the Paint.PictureIOManager class.
public PictureIOManager ( IFilenameResolver filenameResolver ) : System
filenameResolver IFilenameResolver Filename resolver.
return System

SaveData() public method

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
return void

SaveImageStateData() public method

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.
return void