Java Graphics Settings gradientPaint(Graphics2D g2d, Point2D startPosition, Color startColor, Point2D endPosition, Color endColor, int sx, int sy, int ex, int ey)

Here you can find the source of gradientPaint(Graphics2D g2d, Point2D startPosition, Color startColor, Point2D endPosition, Color endColor, int sx, int sy, int ex, int ey)

Description

gradient Paint

License

Open Source License

Declaration

public static void gradientPaint(Graphics2D g2d, Point2D startPosition, Color startColor, Point2D endPosition,
            Color endColor, int sx, int sy, int ex, int ey) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

import java.awt.GradientPaint;
import java.awt.Graphics2D;

import java.awt.geom.Point2D;

public class Main {
    public static void gradientPaint(Graphics2D g2d, Point2D startPosition, Color startColor, Point2D endPosition,
            Color endColor, int sx, int sy, int ex, int ey) {
        GradientPaint gradient = new GradientPaint(startPosition, startColor, endPosition, endColor, true);
        g2d.setPaint(gradient);// w  w w . j  a v a  2s .  c o m
        g2d.fillRect(sx, sy, ex, ey);
    }
}

Related

  1. getRenderingHints(Graphics2D g2d, Map hintsToSave, RenderingHints savedHints)
  2. getRenderingHints(Graphics2D g2d, RenderingHints hintsToSave, RenderingHints savedHints)
  3. getSecondWindowConfiguration()
  4. getTransparentGraphicsConfiguration()
  5. gradientFillShape(Graphics2D g, Color startColor, Color endColor, Shape shape)
  6. setClip(Graphics g, Rectangle clipBounds)
  7. setRenderingHints(Graphics2D g)
  8. setRenderingHints(Graphics2D g2d)
  9. setTextRenderingHints(Graphics2D g2d)