DicomImageResize Method (Int32, Int32, ResizeType) |
Namespace: Aspose.Imaging.FileFormats.Dicom
[C#] string dir = "c:\\temp\\"; using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom")) { // Scale up by 2 times using Nearest Neighbour resampling. image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample); // Save to PNG with default options. image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions()); } using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom")) { // Scale down by 2 times using Nearest Neighbour resampling. image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample); // Save to PNG with default options. image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions()); } using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom")) { // Scale up by 2 times using Bilinear resampling. image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample); // Save to PNG with default options. image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions()); } using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = (Aspose.Imaging.FileFormats.Dicom.DicomImage)Aspose.Imaging.Image.Load(dir + "sample.dicom")) { // Scale down by 2 times using Bilinear resampling. image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample); // Save to PNG with default options. image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions()); }