VectorImage

Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.DataStreamSupporter, com.aspose.imaging.Image

All Implemented Interfaces: com.aspose.imaging.interfaces.IObjectWithSizeF

public abstract class VectorImage extends Image implements IObjectWithSizeF

الصورة المتجهية هي الفئة الأساسية لجميع أنواع الصور المتجهية.

الطرق

طريقةالوصف
resize(int newWidth, int newHeight, int resizeType)يعيد تحجيم العرض الجديد المحدد.
resize(int newWidth, int newHeight, ImageResizeSettings settings)يعيد تحجيم الصورة باستخدام خيارات موسعة.
rotateFlip(int rotateFlipType)يدور، يقلب، أو يدور ويقلب الصورة.
crop(Rectangle rectangle)يقص المستطيل المحدد.
rotate(float angle)دوّر الصورة حول المركز.
getSizeF()يحصل على حجم الكائن، بالبوصة.
getWidthF()يحصل على عرض الكائن، بالبوصة.
getHeightF()يحصل على ارتفاع الكائن، بالبوصة.
getWidth()يحصل على عرض الصورة.
getHeight()يحصل على ارتفاع الصورة.
getDefaultOptions(Object[] args)يحصل على خيارات الصورة الافتراضية.
getEmbeddedImages()يحصل على الصور المضمنة.
removeBackground()يزيل الخلفية.
removeBackground(RemoveBackgroundSettings settings)يزيل الخلفية.

Example: The following example shows how to export a multipage vector image to another format in general way without referencing to a particular image type.

String dir = "C:\\aspose.imaging\\java\\misc\\ImagingReleaseQATester\\Tests\\testdata\\2548\\";
String inputFilePath = dir + "Multipage.cdr";
String outputFilePath = dir + "Multipage.cdr.tif";

com.aspose.imaging.ImageOptionsBase exportOptions = new com.aspose.imaging.imageoptions.TiffOptions(com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat.Default);

try(com.aspose.imaging.Image image = com.aspose.imaging.Image.load(inputFilePath))
{
    exportOptions.setMultiPageOptions(null);

    // تصدير الصفحتين الأوليتين فقط
    com.aspose.imaging.IMultipageImage multipageImage = image instanceof com.aspose.imaging.IMultipageImage ? (com.aspose.imaging.IMultipageImage)image : null;
    if (multipageImage != null && (multipageImage.getPages() != null && multipageImage.getPageCount() > 2))
    {
        exportOptions.setMultiPageOptions(new com.aspose.imaging.imageoptions.MultiPageOptions(new com.aspose.imaging.IntRange(0, 2)));
    }

    if (image instanceof com.aspose.imaging.VectorImage)
    {
        com.aspose.imaging.imageoptions.VectorRasterizationOptions defaultOptions = (com.aspose.imaging.imageoptions.VectorRasterizationOptions) image.getDefaultOptions(new Object[]{Color.getWhite(), image.getWidth(), image.getHeight()});
        exportOptions.setVectorRasterizationOptions(defaultOptions);
        defaultOptions.setTextRenderingHint(com.aspose.imaging.TextRenderingHint.SingleBitPerPixel);
        defaultOptions.setSmoothingMode(com.aspose.imaging.SmoothingMode.None);
    }

    image.save(outputFilePath, exportOptions);
}

resize(int newWidth, int newHeight, int resizeType)

public void resize(int newWidth, int newHeight, int resizeType)

يعيد تحجيم العرض الجديد المحدد.

Parameters:

معاملنوعالوصف
newWidthintالعرض الجديد.
newHeightintالارتفاع الجديد.
resizeTypeintنوع التحجيم.

resize(int newWidth, int newHeight, ImageResizeSettings settings)

public void resize(int newWidth, int newHeight, ImageResizeSettings settings)

يعيد تحجيم الصورة باستخدام خيارات موسعة.

Parameters:

معاملنوعالوصف
newWidthintالعرض الجديد.
newHeightintالارتفاع الجديد.
settingsImageResizeSettingsإعدادات تغيير الحجم.

rotateFlip(int rotateFlipType)

public void rotateFlip(int rotateFlipType)

يدور، يقلب، أو يدور ويقلب الصورة.

Parameters:

معاملنوعالوصف
rotateFlipTypeintنوع الدوران والقلب.

crop(Rectangle rectangle)

public void crop(Rectangle rectangle)

يقص المستطيل المحدد.

Parameters:

معاملنوعالوصف
rectangleRectangleالمستطيل.

rotate(float angle)

public void rotate(float angle)

دوّر الصورة حول المركز.

Parameters:

معاملنوعالوصف
anglefloatزاوية الدوران بالدرجات. القيم الموجبة تدور باتجاه عقارب الساعة.

getSizeF()

public final SizeF getSizeF()

يحصل على حجم الكائن، بالبوصة.

Returns: SizeF - the object size, in inches.

getWidthF()

public float getWidthF()

يحصل على عرض الكائن، بالبوصة.

Returns: float - عرض الكائن، بالبوصة.

getHeightF()

public float getHeightF()

يحصل على ارتفاع الكائن، بالبوصة.

Returns: float - ارتفاع الكائن، بالبوصة.

getWidth()

public int getWidth()

يحصل على عرض الصورة.

Returns: int - عرض الصورة.

getHeight()

public int getHeight()

يحصل على ارتفاع الصورة.

Returns: int - ارتفاع الصورة.

getDefaultOptions(Object[] args)

public ImageOptionsBase getDefaultOptions(Object[] args)

يحصل على خيارات الصورة الافتراضية.

Parameters:

معاملنوعالوصف
argsjava.lang.Object[]المعلمات.

Returns: ImageOptionsBase - The default image options.

getEmbeddedImages()

public EmbeddedImage[] getEmbeddedImages()

يحصل على الصور المضمنة.

Returns: com.aspose.imaging.EmbeddedImage[] - مصفوفة من الصور

Example: Support extracting embedded raster images from a vector image

String inputFileName = "test.cdr";
try (Image image = com.aspose.imaging.Image.load(inputFileName))
{
    com.aspose.imaging.VectorImage vectorImage = ((com.aspose.imaging.VectorImage) image);
    EmbeddedImage[] images = vectorImage.getEmbeddedImages();
    for (int i = 0; i < images.length; i++)
    {
        String outFileName = String.format("image%d.png", i++);
        try
        {
            images[i].getImage().save(outFileName, new PngOptions());
        }
        finally
        {
            images[i].close();
        }
    }
}

removeBackground()

public void removeBackground()

يزيل الخلفية.

removeBackground(RemoveBackgroundSettings settings)

public void removeBackground(RemoveBackgroundSettings settings)

يزيل الخلفية.

Parameters:

معاملنوعالوصف
settingsRemoveBackgroundSettingsالإعدادات.