Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/72d3047ce7bdb812473fe8d86d3a9b52 to your computer and use it in GitHub Desktop.
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
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 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