Drawroundrect, Fillroundrect Ve Affinetransform Kullanımı

Drawroundrect, fillroundrect ve affinetransform kullanımı

drawRoundRect

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;

public class NewJApplet extends JApplet {

    public void paint(Graphics Ekran) {
        Ekran.setColor(Color.red);
        Ekran.drawRoundRect(25, 25, 100, 100, 100, 100);
        Ekran.setColor(Color.yellow);
        Ekran.drawRoundRect(35, 45, 30, 30, 100, 100);
        Ekran.setColor(Color.gray);
        Ekran.drawRoundRect(75, 45, 30, 30, 100, 100);
        Ekran.setColor(Color.green);
        Ekran.drawRoundRect(55, 75, 30, 30, 100, 100);

    }
}
 

Ekran;

drawRoundRect, fillRoundRect ve AffineTransform kullanımı

 

fillRoundRect

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;

public class NewJApplet  extends JApplet {

    public void paint(Graphics Ekran) {
        Ekran.setColor(Color.red);
        Ekran.fillRoundRect(25, 25, 100, 100, 100, 100);
        Ekran.setColor(Color.yellow);
        Ekran.fillRoundRect(35, 45, 30, 30, 100, 100);
        Ekran.setColor(Color.gray);
        Ekran.fillRoundRect(75, 45, 30, 30, 100, 100);
        Ekran.setColor(Color.green);
        Ekran.fillRoundRect(55, 75, 30, 30, 100, 100);

    }
}
 

  Ekran;

Drawroundrect, Fillroundrect Ve Affinetransform Kullanımı

 

Affine Transform

import java.awt.*;
import java.awt.geom.*;
import javax.swing.JApplet;

public class drawround_fillround_afflinetransform extends JApplet {

    public void paint(Graphics Ekran) {
        Graphics2D Ekran2D = (Graphics2D) Ekran;
        Ekran2D.setPaint(Color.red);
        Rectangle2D s1 = new Rectangle2D.Double(55, 55, 65, 30);
        AffineTransform at = AffineTransform.getRotateInstance(45, 50, 50);
        Ekran2D.setTransform(at);
        Ekran2D.fill(s1);

    }
}

  Ekran;

Drawroundrect, Fillroundrect Ve Affinetransform Kullanımı

Gamze Üsküplü

Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...