This file contains hidden or 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
import aspose.imaging as imaging | |
import aspose.pycore as apc | |
from aspose.imaging import Image, License | |
from aspose.imaging.fileformats.gif import GifImage | |
from aspose.imaging.imageoptions import WebPOptions | |
try: | |
# Activate Aspose.Imaging license | |
license = License() | |
license.set_license("license.lic") |
This file contains hidden or 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
// Initialize a Bitmap class object | |
com.aspose.drawing.Bitmap bitmap = new com.aspose.drawing.Bitmap(1000, 800, com.aspose.drawing.imaging.PixelFormat.Format32bppPArgb); | |
com.aspose.drawing.Graphics graphics = com.aspose.drawing.Graphics.fromImage(bitmap); | |
// Create a Pen class instance | |
com.aspose.drawing.Pen pen = new com.aspose.drawing.Pen(com.aspose.drawing.Color.fromKnownColor(com.aspose.drawing.KnownColor.Blue), 2); | |
// Draw the rectangle | |
graphics.drawRectangle(pen, 10, 10, 900, 700); |
This file contains hidden or 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
// Initialize a Bitmap class object | |
Aspose.Drawing.Bitmap bitmap = new Aspose.Drawing.Bitmap(1000, 800, Aspose.Drawing.Imaging.PixelFormat.Format32bppPArgb); | |
Aspose.Drawing.Graphics graphics = Aspose.Drawing.Graphics.FromImage(bitmap); | |
// Create a Pen class instance | |
Aspose.Drawing.Pen pen = new Aspose.Drawing.Pen(Aspose.Drawing.Color.FromKnownColor(Aspose.Drawing.KnownColor.Blue), 2); | |
// Draw the rectangle | |
graphics.DrawRectangle(pen, 10, 10, 900, 700); |
This file contains hidden or 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
import com.aspose.imaging.Image; | |
//import com.aspose.imaging.License; | |
import com.aspose.imaging.imageoptions.WebPOptions; | |
public class ConvertGifToWebp { | |
public static void main(String[] args) { | |
try { | |
// Apply the Aspose.Imaging license | |
//License license = new License(); | |
//license.setLicense("license.lic"); |
This file contains hidden or 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
using System; | |
using Aspose.Imaging; | |
using Aspose.Imaging.ImageOptions; | |
class Program | |
{ | |
static void Main() | |
{ | |
License license = new License(); | |
license.SetLicense("license.lic"); |
This file contains hidden or 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
import aspose.imaging as imaging | |
from aspose.imaging import Image, Color, Graphics, License, Pen | |
from aspose.imaging.imageoptions import WebPOptions | |
from aspose.imaging.sources import FileCreateSource | |
from aspose.imaging.brushes import SolidBrush | |
# Load license (optional but recommended) | |
license = License() | |
license.set_license("license.lic") |
This file contains hidden or 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
import com.aspose.imaging.Color; | |
import com.aspose.imaging.Graphics; | |
import com.aspose.imaging.Image; | |
import com.aspose.imaging.License; | |
import com.aspose.imaging.Pen; | |
import com.aspose.imaging.brushes.SolidBrush; | |
import com.aspose.imaging.imageoptions.WebPOptions; | |
import com.aspose.imaging.sources.FileCreateSource; | |
public class CreateWebPShapes { |
This file contains hidden or 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
FileInputStream fis = new FileInputStream(dataDir + "Base64.txt"); | |
String base64 = IOUtils.toString(fis, "UTF-8"); | |
String base64ImageString = base64.replace("data:image/png;base64,", ""); | |
byte[] imageBytes = java.util.Base64.getDecoder().decode(base64ImageString); | |
String path = dataDir + "Base64 to Image.png"; | |
// Convert Base64 to PNG or JPG Image | |
FileOutputStream fos = new FileOutputStream(path); | |
try { | |
fos.write(imageBytes); |
This file contains hidden or 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
// Define the file paths | |
string base64FilePath = dataDir + "Base64.txt"; | |
string pdfOutputPath = dataDir + "Base64_to_PDF.pdf"; | |
// Read the Base64 string from the file | |
string base64 = File.ReadAllText(base64FilePath, Encoding.UTF8); | |
string base64ImageString = base64.Replace("data:image/png;base64,", ""); | |
// Decode the Base64 string to byte array | |
byte[] imageBytes = Convert.FromBase64String(base64ImageString); |
This file contains hidden or 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
using Aspose.Imaging; | |
using Aspose.Imaging.Brushes; | |
using Aspose.Imaging.ImageOptions; | |
using Aspose.Imaging.Sources; | |
License licence = new License(); | |
licence.SetLicense("license.lic"); | |
var imageOptions = new WebPOptions | |
{ |
NewerOlder