This gist contains code snippets related to extraction of TIFF frames from multiframe TIFF image using Aspose.Imaging Cloud SDK for .NET For more information, please visit
Last active
June 19, 2021 21:07
-
-
Save aspose-cloud/72d3047ce7bdb812473fe8d86d3a9b52 to your computer and use it in GitHub Desktop.
This Gist contains code snippets related extraction of TIFF frame from MultiFrame TIFF image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string clientID = "718e4235-8866-4ebe-bff4-f5a14a4b6466"; // Get ClientID from https://dashboard.aspose.cloud/ | |
string clientSecret = "388e864b819d8b067a8b1cb625a2ea8e"; // Get CLientSecret from https://dashboard.aspose.cloud/ | |
// create an instance of ImagingApi | |
Aspose.Imaging.Cloud.Sdk.Api.ImagingApi imagingApi = new ImagingApi(clientSecret, clientID,"https://api.aspose.cloud/","v3.0",false); | |
// input TIFF image available on Cloud storage | |
String fileName = "TiffSampleImage.tiff"; | |
int? frameId = 5; // Index of a frame | |
int? newWidth = 300; | |
int? newHeight = 450; | |
int? x = 10; | |
int? y = 10; | |
int? rectWidth = 200; | |
int? rectHeight = 300; | |
string rotateFlipMethod = "RotateNoneFlipNone"; | |
// Result will include just the specified frame | |
bool? saveOtherFrames = false; | |
string folder = null; // Input file is saved at the root of the storage | |
string storage = null; // We are using default Cloud Storage | |
GetImageFrameRequest getImageFrameRequest = new GetImageFrameRequest(fileName, frameId, newWidth, newHeight, | |
x, y, rectWidth, rectHeight, rotateFlipMethod, saveOtherFrames, folder, storage); | |
Stream imageFrame = imagingApi.GetImageFrame(getImageFrameRequest); | |
// Save updated image to local storage | |
using (var fileStream = File.Create("/Users/nayyershahbaz/Downloads/MyResultant.tiff")) | |
{ | |
imageFrame.Seek(0, SeekOrigin.Begin); | |
imageFrame.CopyTo(fileStream); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This Gist contains code snippets related extraction of TIFF frame from MultiFrame TIFF image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment