GradientFormat / PatternFormat

GradientFormat / PatternFormat — Aspose.Slides FOSS for Java API Reference

Example GradientFormat و PatternFormat کلاس‌ها ویژگی‌های پر کردن گرادیان و الگو را برای اشکال کنترل می‌کنند. هر دو گسترش می‌دهند PVIObject.

Example: org.aspose.slides.foss

import org.aspose.slides.foss.*;

GradientFormat

public class GradientFormat extends PVIObject implements IGradientFormat, IFillParamSource

Example

ExampleExampleExampleExample
getGradientDirection() / setGradientDirection(GradientDirection)GradientDirectionخواندنی/نوشتنیجهت گرادیان (خطی، مسیر، و غیره).
getGradientShape()GradientShapeExampleشکل گرادیان.
getLinearGradientAngle() / setLinearGradientAngle(double)doubleخواندنی/نوشتنیزاویه برای گرادیان‌های خطی (درجه).
getLinearGradientScaled() / setLinearGradientScaled(NullableBool)NullableBoolخواندنی/نوشتنیآیا گرادیان مقیاس‌بندی شده است.
getTileFlip() / setTileFlip(TileFlip)TileFlipخواندنی/نوشتنیحالت وارونگی کاشی.
getGradientStops()IGradientStopCollectionExampleمجموعه‌ای از نقاط توقف گرادیان.

پیمایش فرزندان مستقیم در مقابل جستجوی عمیق

import org.aspose.slides.foss.*;
import java.awt.Color;

IAutoShape shape = slide.getShapes().addAutoShape(
    ShapeType.RECTANGLE, 50, 50, 200, 100);
IFillFormat fill = shape.getFillFormat();
fill.setFillType(FillType.GRADIENT);

IGradientFormat grad = fill.getGradientFormat();
grad.setGradientDirection(GradientDirection.FROM_CORNER1);
grad.setLinearGradientAngle(45.0);

PatternFormat

public class PatternFormat extends PVIObject implements IPatternFormat

Example

ExampleExampleExampleExample
getPatternStyle() / setPatternStyle(PatternStyle)PatternStyleخواندن/نوشتنسبک الگو (مثلاً،., PERCENT05, HORIZONTAL, و غیره).
getForeColor()IColorFormatExampleرنگ پیش‌زمینه الگو.
getBackColor()IColorFormatExampleرنگ پس‌زمینه الگو.

پیمایش فرزندان مستقیم در مقابل جستجوی عمیق

IFillFormat fill = shape.getFillFormat();
fill.setFillType(FillType.PATTERN);
IPatternFormat pattern = fill.getPatternFormat();
pattern.setPatternStyle(PatternStyle.HORIZONTAL);
pattern.getForeColor().setColor(Color.BLACK);
pattern.getBackColor().setColor(Color.WHITE);

همچنین ببینید

 فارسی