HatchBrush
Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.Brush
public final class HatchBrush extends Brush
Bir tarama stiline, ön plan rengine ve arka plan rengine sahip dikdörtgen bir fırça tanımlar. Bu sınıf kalıtılamaz.
Yapıcılar
| Yapıcı | Açıklama |
|---|---|
| HatchBrush() |
Yöntemler
| Yöntem | Açıklama |
|---|---|
| getForegroundColor() | Tarama çizgilerinin rengini alır. |
| setForegroundColor(Color value) | Tarama çizgilerinin rengini ayarlar. |
| getBackgroundColor() | Tarama çizgileri arasındaki boşlukların rengini alır. |
| setBackgroundColor(Color value) | Tarama çizgileri arasındaki boşlukların rengini ayarlar. |
| getHatchStyle() | Bu fırçanın tarama stilini alır. |
| setHatchStyle(int value) | Bu fırçanın tarama stilini ayarlar. |
Example: This example shows the creation and usage Pen objects.
Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanımını gösterir. Örnek yeni bir Image oluşturur ve Image yüzeyine Dikdörtgenler çizer.
// BmpOptions bir örneği oluşturun ve çeşitli özelliklerini ayarlayın
com.aspose.imaging.imageoptions.BmpOptions bmpOptions = new com.aspose.imaging.imageoptions.BmpOptions();
bmpOptions.setBitsPerPixel(24);
// FileCreateSource bir örneği oluşturun ve bunu BmpOptions örneği için Source olarak atayın
// İkinci Boolean parametresi, oluşturulacak dosyanın IsTemporal olup olmadığını belirler
bmpOptions.setSource(new com.aspose.imaging.sources.FileCreateSource("C:\\temp\\sample.bmp", false));
// Belirtilen Yolda bir Image örneği oluştur.
com.aspose.imaging.Image image = com.aspose.imaging.Image.create(bmpOptions, 500, 500);
try {
// Graphics'in bir örneğini oluştur ve Image nesnesiyle başlat.
com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(image);
// Grafik yüzeyini Beyaz Renk ile temizle.
graphics.clear(com.aspose.imaging.Color.getWhite());
// Renk Kırmızı ve genişlik 5 olan bir Pen örneği oluştur.
com.aspose.imaging.Pen pen = new com.aspose.imaging.Pen(com.aspose.imaging.Color.getRed(), 5);
// HatchBrush'ın bir örneğini oluştur ve özelliklerini ayarla.
com.aspose.imaging.brushes.HatchBrush brush = new com.aspose.imaging.brushes.HatchBrush();
brush.setBackgroundColor(com.aspose.imaging.Color.getWheat());
brush.setForegroundColor(com.aspose.imaging.Color.getRed());
// Pen'in bir örneğini oluştur ve HatchBrush nesnesi ve genişlik ile başlat.
com.aspose.imaging.Pen brushedpen = new com.aspose.imaging.Pen(brush, 5);
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(pen, new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(210, 210), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 310), new com.aspose.imaging.Size(100, 100))
});
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(
brushedpen,
new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 310), new com.aspose.imaging.Size(100, 100))
});
// Tüm değişiklikleri kaydedin.
image.save();
} finally {
image.dispose();
}
HatchBrush()
public HatchBrush()
getForegroundColor()
public Color getForegroundColor()
Tarama çizgilerinin rengini alır.
Returns: Color - The color of hatch lines.
setForegroundColor(Color value)
public void setForegroundColor(Color value)
Tarama çizgilerinin rengini ayarlar.
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| value | Color | Tarama çizgilerinin rengi. |
Example: This example shows the creation and usage Pen objects. Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanımını gösterir. Örnek yeni bir Image oluşturur ve Image yüzeyine Dikdörtgenler çizer.
// BmpOptions bir örneği oluşturun ve çeşitli özelliklerini ayarlayın
com.aspose.imaging.imageoptions.BmpOptions bmpOptions = new com.aspose.imaging.imageoptions.BmpOptions();
bmpOptions.setBitsPerPixel(24);
// FileCreateSource bir örneği oluşturun ve bunu BmpOptions örneği için Source olarak atayın
// İkinci Boolean parametresi, oluşturulacak dosyanın IsTemporal olup olmadığını belirler
bmpOptions.setSource(new com.aspose.imaging.sources.FileCreateSource("C:\\temp\\sample.bmp", false));
// Belirtilen Yolda bir Image örneği oluştur.
com.aspose.imaging.Image image = com.aspose.imaging.Image.create(bmpOptions, 500, 500);
try {
// Graphics'in bir örneğini oluştur ve Image nesnesiyle başlat.
com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(image);
// Grafik yüzeyini Beyaz Renk ile temizle.
graphics.clear(com.aspose.imaging.Color.getWhite());
// Renk Kırmızı ve genişlik 5 olan bir Pen örneği oluştur.
com.aspose.imaging.Pen pen = new com.aspose.imaging.Pen(com.aspose.imaging.Color.getRed(), 5);
// HatchBrush'ın bir örneğini oluştur ve özelliklerini ayarla.
com.aspose.imaging.brushes.HatchBrush brush = new com.aspose.imaging.brushes.HatchBrush();
brush.setBackgroundColor(com.aspose.imaging.Color.getWheat());
brush.setForegroundColor(com.aspose.imaging.Color.getRed());
// Pen'in bir örneğini oluştur ve HatchBrush nesnesi ve genişlik ile başlat.
com.aspose.imaging.Pen brushedpen = new com.aspose.imaging.Pen(brush, 5);
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(pen, new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(210, 210), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 310), new com.aspose.imaging.Size(100, 100))
});
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(
brushedpen,
new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 310), new com.aspose.imaging.Size(100, 100))
});
// Tüm değişiklikleri kaydedin.
image.save();
} finally {
image.dispose();
}
getBackgroundColor()
public Color getBackgroundColor()
Tarama çizgileri arasındaki boşlukların rengini alır.
Returns: Color - The color of spaces between the hatch lines.
setBackgroundColor(Color value)
public void setBackgroundColor(Color value)
Tarama çizgileri arasındaki boşlukların rengini ayarlar.
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| value | Color | Tarama çizgileri arasındaki boşlukların rengi. |
Example: This example shows the creation and usage Pen objects. Bu örnek, Pen nesnelerinin oluşturulmasını ve kullanımını gösterir. Örnek yeni bir Image oluşturur ve Image yüzeyine Dikdörtgenler çizer.
// BmpOptions bir örneği oluşturun ve çeşitli özelliklerini ayarlayın
com.aspose.imaging.imageoptions.BmpOptions bmpOptions = new com.aspose.imaging.imageoptions.BmpOptions();
bmpOptions.setBitsPerPixel(24);
// FileCreateSource bir örneği oluşturun ve bunu BmpOptions örneği için Source olarak atayın
// İkinci Boolean parametresi, oluşturulacak dosyanın IsTemporal olup olmadığını belirler
bmpOptions.setSource(new com.aspose.imaging.sources.FileCreateSource("C:\\temp\\sample.bmp", false));
// Belirtilen Yolda bir Image örneği oluştur.
com.aspose.imaging.Image image = com.aspose.imaging.Image.create(bmpOptions, 500, 500);
try {
// Graphics'in bir örneğini oluştur ve Image nesnesiyle başlat.
com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(image);
// Grafik yüzeyini Beyaz Renk ile temizle.
graphics.clear(com.aspose.imaging.Color.getWhite());
// Renk Kırmızı ve genişlik 5 olan bir Pen örneği oluştur.
com.aspose.imaging.Pen pen = new com.aspose.imaging.Pen(com.aspose.imaging.Color.getRed(), 5);
// HatchBrush'ın bir örneğini oluştur ve özelliklerini ayarla.
com.aspose.imaging.brushes.HatchBrush brush = new com.aspose.imaging.brushes.HatchBrush();
brush.setBackgroundColor(com.aspose.imaging.Color.getWheat());
brush.setForegroundColor(com.aspose.imaging.Color.getRed());
// Pen'in bir örneğini oluştur ve HatchBrush nesnesi ve genişlik ile başlat.
com.aspose.imaging.Pen brushedpen = new com.aspose.imaging.Pen(brush, 5);
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(pen, new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(210, 210), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 310), new com.aspose.imaging.Size(100, 100))
});
// Pen nesnesini belirterek Dikdörtgenler çizin.
graphics.drawRectangles(
brushedpen,
new com.aspose.imaging.Rectangle[]
{
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(310, 110), new com.aspose.imaging.Size(100, 100)),
new com.aspose.imaging.Rectangle(new com.aspose.imaging.Point(110, 310), new com.aspose.imaging.Size(100, 100))
});
// Tüm değişiklikleri kaydedin.
image.save();
} finally {
image.dispose();
}
getHatchStyle()
public int getHatchStyle()
Bu fırçanın tarama stilini alır.
Returns: int
setHatchStyle(int value)
public void setHatchStyle(int value)
Bu fırçanın tarama stilini ayarlar.
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| değer | int |