Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
conholdate-gists / introduction_converting_presentation_slides_to_ima.java
Created December 10, 2025 10:15
Convert PPTX to JPEG with Conholdate.Total for Java
import com.aspose.slides.ImageSaveOptions;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;
public class PptxToJpeg {
public static void main(String[] args) {
// Path to the source PPTX file
String sourcePath = "input.pptx";
// Output folder for JPEG images
String outputFolder = "output/";
@conholdate-gists
conholdate-gists / introduction_converting_powerpoint_presentations_t.cs
Created December 10, 2025 08:44
Convert PPTX to PNG with Conholdate.Total for .NET
using System;
using System.IO;
using Conholdate.Total.Slides;
class Program
{
static void Main()
{
// Path to the source PPTX file
string inputPath = "sample.pptx";
@conholdate-gists
conholdate-gists / introduction_converting_powerpoint_slides_to_jpeg_.cs
Created December 10, 2025 08:35
Convert PPT to JPG with Conholdate.Total for .NET
// Convert PPT to JPG - Complete Code Example
using System;
using System.Drawing;
using System.Drawing.Imaging;
using Conholdate.Total.Slides; // Namespace for presentation handling
namespace PptToJpgDemo
{
class Program
{
@conholdate-gists
conholdate-gists / introduction_converting_photoshop_files_to_webfrie.java
Created December 10, 2025 08:11
Convert PSD to PNG with Conholdate.Total for Java
import com.aspose.total.Image;
import com.aspose.total.ImageLoadOptions;
import com.aspose.total.ImageSaveOptions;
import com.aspose.total.fileformats.png.PngOptions;
public class PsdToPng {
public static void main(String[] args) throws Exception {
// Path to the source PSD file
String sourcePath = "input.psd";
@conholdate-gists
conholdate-gists / crop-image.java
Created May 16, 2025 10:17
Crop Image in Java | Crop JPG PNG BMP TIFF any Picture
// Load the image.
com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage)com.aspose.imaging.Image.Load("image.png");
// Before cropping, the image should be cached for better performance.
if (!rasterImage.isCached())
{
rasterImage.cacheData();
}
// Create an instance of Rectangle class with desired size and crop the image.
@conholdate-gists
conholdate-gists / flip-image-horizontal.java
Created May 12, 2025 13:36
Flip Images in Java | Flip Images Horizontally or Vertically
// Load image
com.aspose.imaging.RasterImage image = (com.aspose.imaging.RasterImage) com.aspose.imaging.Image.load("image.png");
// Flip the image horizontally
image.rotateFlip(com.aspose.imaging.RotateFlipType.RotateNoneFlipX);
// Save the flipped image
image.save("flipped-horizontal.png");
@conholdate-gists
conholdate-gists / rotate-image.cs
Created May 2, 2025 14:36
Rotate Image in C#
// Load an image in an instance of Image
using (Image image = Image.Load("image.bmp"))
{
// Rotate the image
image.RotateFlip(RotateFlipType.Rotate270FlipNone);
// Save image
image.Save("image-rotated.bmp");
}
@conholdate-gists
conholdate-gists / convert-dwf-to-pdf.cs
Created April 23, 2025 20:54
Convert DWF to PDF in C#
// Load the input DWF file
Image image = Image.Load("DWFtoPDF.dwf");
// Create an object of CadRasterizationOptions to set different properties
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions()
{
PageWidth = 1600,
PageHeight = 1600,
ContentAsBitmap = true
@conholdate-gists
conholdate-gists / resize-image-proportionally.cs
Created April 23, 2025 18:46
Resize Image in C# | Scale JPG PNG GIF BMP Picture
// Load image
using (Image image = Image.Load("aspose-logo.png"))
{
// Cache image data
if (!image.IsCached)
{
image.CacheData();
}
// Specify width and height
@conholdate-gists
conholdate-gists / image-to-base64.cs
Created April 17, 2025 20:32
Convert Image to Base64 | JPG PNG to Base64 Image
// Load an input JPG image
var bytes = File.ReadAllBytes(@"C:\Files\Sample_JPG.jpg");
// Initialize an SVGDocument object
var document = new SVGDocument();
// Create an image element
var img = (SVGImageElement)document.CreateElementNS("http://www.w3.org/2000/svg", "image");
// Convert image to Base64