Total members 11895 |It is currently Sun Dec 22, 2024 5:17 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Use Alpha values to draw
Code:
import java.awt.*;
import javax.swing.*;

public class UseAlphaValues extends JFrame {
int width, height;

  UseAlphaValues(String st) {
    this(st, 350, 300);
  }
  UseAlphaValues(String st, int w, int h) {
    setTitle(st);
    setSize(width = w, height = h);
    setBackground(Color.black);
    }
   public void paint(Graphics g) {
    Color color1 = new Color(150, 100, 100, 70);
    Color color2 = new Color(75, 150, 200, 125);
    Color color3 = new Color(120, 150, 200, 200);
    g.setColor(color1);
    g.fillOval(0, 0, width / 2, height / 2);
    g.setColor(color2);
    g.fillOval(width / 4, height / 4, width / 2, height / 2);
    g.setColor(color3);
    g.fillOval(width / 3, height / 3, width / 4, height / 4);
  }
  public static void main(String[] args) {
    new UseAlphaValues("Use Alpha values to draw in layers.")
      .setVisible(true);
  }
}





Attachments:
File comment: output ,
layers.gif
layers.gif [ 6.35 KiB | Viewed 4392 times ]

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada
Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Use Alpha values to draw
 What is Alpha Reseller Master Reseller Hosting?     -  
 modulus of two values     -  
 Calculate the sum of values in an array     -  
 Get image pixels Values in ITK     -  
 URL Characters and URL Encoding Values     -  
 EXTRACTING VALUES FROM XML FILE     -  
 Dividing two Integer values     -  
 Using Multiple Values for a Cookie in php     -  
 How can i Get Brightness and Contrast values of img     -  
 Return all the values of an array using array_values     -  



Topic Tags

Java Graphics
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com