Create an image that does not support transparency : Image « Advanced Graphics « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Advanced Graphics » ImageScreenshots 
Create an image that does not support transparency
  

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Transparency;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class BasicShapes extends JPanel {

  public void paint(Graphics g) {
    Graphics2D g2d = (Graphics2Dg;
    int width = 100;
    int height = 100;

    BufferedImage bimage = g2d.getDeviceConfiguration().createCompatibleImage(
        width, height, Transparency.OPAQUE);
  }

  public static void main(String[] args) {

    JFrame frame = new JFrame("Basic Shapes");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new BasicShapes());
    frame.setSize(350250);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  }
}

    

   
    
  
Related examples in the same category
1. Create an image that supports transparent pixels
2. Create an image that supports arbitrary levels of transparency
3. Creating a buffered image using Component.createImage().
4. Creating a Buffered Image from an Image
5. Drawing on a Buffered Image
6. If the buffered image supports transparency
7. Converting a Buffered Image (BufferedImage) from an Image
8. Getting and Setting Pixels in a Buffered Image
9. Scaling a Buffered Image
10. Shearing a Buffered Image
11. Translating a Buffered Image
12. Rotating a Buffered Image
13. Flipping a Buffered Image
14. Flip the image horizontally
15. Flip the image vertically and horizontally, equivalent to rotating the image 180 degrees
16. 2D Image Draw
17. Transform image
18. Creating a Image Zoomer using Graphics2D
19. Gaussian Blur DemoGaussian Blur Demo
20. Intermediate ImagesIntermediate Images
21. Image reflectionImage reflection
22. Bloom DemoBloom Demo
23. Box Blur DemoBox Blur Demo
24. Brightness Increase DemoBrightness Increase Demo
25. Blur an ImageBlur an Image
26. Blur our image: Blur means an unfocused image
27. A reflected image: effect makes an illusion as if the image was reflected in water
28. Enlarge Image With AnimationEnlarge Image With Animation
29. Image ZoomingImage Zooming
30. Simple image handling and drawing interactionSimple image handling and drawing interaction
31. Unsharp Mask DemoUnsharp Mask Demo
32. Create a grayscale image with Java 2D tools
33. A 3x3 kernel that embosses an image.
34. A 3x3 kernel that blurs an image.
35. A 3x3 kernel that sharpens an image.
36. Embossing a Buffered Image
37. Brighten the image by 30%
38. Darken the image by 10%
39. Extend RGBImageFilter to create ColorFilter class
40. Extend RGBImageFilter to create AlphaFilter class
41. Enlarging an image by pixel replication
42. Shrinking an image by skipping pixels
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.