/// <summary> /// Process existing WMF image using given parameters, and upload updated image to Cloud Storage. /// </summary> public void ModifyWmfAndUploadToStorage() { Console.WriteLine("Update parameters of a WMF image and upload to cloud storage"); UploadSampleImageToCloud(); var bkColor = "gray"; int? pageWidth = 300; int? pageHeight = 300; int? borderX = 50; int? borderY = 50; bool?fromScratch = null; var folder = CloudPath; // Input file is saved at the Examples folder in the storage string storage = null; // We are using default Cloud Storage var exportFormat = "png"; var getImageWmfRequest = new ModifyWmfRequest(SampleImageFileName, bkColor, pageWidth, pageHeight, borderX, borderY, fromScratch, folder, storage, exportFormat); Console.WriteLine( $"Call ModifyWmf with params: background color:{bkColor}, page width:{pageWidth}, page height:{pageHeight}, border X:{borderX}, border Y:{borderY}"); using (var updatedImage = ImagingApi.ModifyWmf(getImageWmfRequest)) { UploadImageToCloud(GetModifiedSampleImageFileName(), updatedImage); } Console.WriteLine(); }
public void ModifyWmfTest() { string name = "test.wmf"; string bkColor = "gray"; int pageWidth = 300; int pageHeigth = 300; int borderX = 50; int borderY = 50; bool? fromScratch = null; string folder = TempFolder; string storage = this.TestStorage; this.TestGetRequest( "ModifyWmfTest", $"Input image: {name}; BackColor: {bkColor}; Page width: {pageWidth}; Page height: {pageHeigth}; BorderX: {borderX}; BorderY: {borderY}", name, delegate { var request = new ModifyWmfRequest(name, bkColor, pageWidth, pageHeigth, borderX, borderY, fromScratch, folder, storage); return(ImagingApi.ModifyWmf(request)); }, delegate(ImagingResponse originalProperties, ImagingResponse resultProperties, Stream resultStream) { Assert.NotNull(resultProperties.PngProperties); Assert.AreEqual(pageWidth + borderX * 2, resultProperties.Width); Assert.AreEqual(pageHeigth + borderY * 2, resultProperties.Height); }, folder, storage); }