public BasicCommandReturn DownloadImageToSlave(Image Image) { if (Image.Height != StaticImageHelpers.ImageHieght && Image.Width != StaticImageHelpers.ImageWidth) { throw new Exception("Image is not the correct size. Image bust be 8 bits (one byte) per pixel in a 256 by 288 pixel canvas for 73,728 pixels and is assumed to be grey scaled image."); } byte[] ImageBytes = StaticImageHelpers.GetBytesFromImage(Image); return(DownloadImageToSlave(ImageBytes)); }
public BasicCommandReturn DownloadImageToSlave(byte[] ImageBitmapAsBytes, bool AlreadyCompressed = false) { if (!AlreadyCompressed) { ImageBitmapAsBytes = StaticImageHelpers.GetCompressedImageBytes(ImageBitmapAsBytes); } SendCommand(CommandCodes.DownloadImage); BasicCommandReturn Return = GetReturn(); if (Return.Status != Errors.Success) { return(Return); } SendDataStream(ImageBitmapAsBytes); return(Return); }