亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? compositeeffects.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
字號(hào):
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.graphics;import java.awt.*;import java.awt.geom.*;import java.awt.image.*;public class CompositeEffects implements GraphicsExample {    Image cover;  // The image we'll be displaying, and its size    static final int COVERWIDTH = 127, COVERHEIGHT = 190;    /** This constructor loads the cover image */    public CompositeEffects() {	java.net.URL imageurl = this.getClass().getResource("cover.gif");	cover = new javax.swing.ImageIcon(imageurl).getImage();    }    // These are basic GraphicsExample methods    public String getName() {return "Composite Effects";}     public int getWidth() { return 6*COVERWIDTH + 70; }     public int getHeight() { return COVERHEIGHT + 35; }    /** Draw the example */    public void draw(Graphics2D g, Component c) {	// fill the background 	g.setPaint(new Color(175, 175, 175));	g.fillRect(0, 0, getWidth(), getHeight());	// Set text attributes	g.setColor(Color.black);	g.setFont(new Font("SansSerif", Font.BOLD, 12));	// Draw the unmodified image	g.translate(10, 10);	g.drawImage(cover, 0, 0, c);	g.drawString("SRC_OVER", 0, COVERHEIGHT+15);	// Draw the cover again, using AlphaComposite to make the opaque	// colors of the image 50% translucent	g.translate(COVERWIDTH+10, 0);	g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,						  0.5f));	g.drawImage(cover, 0, 0, c);	// Restore the pre-defined default Composite for the screen, so	// opaque colors stay opaque.	g.setComposite(AlphaComposite.SrcOver);	// Label the effect	g.drawString("SRC_OVER, 50%", 0, COVERHEIGHT+15);	// Now get an offscreen image to work with.  In order to achieve	// certain compositing effects, the drawing surface must support	// transparency. Onscreen drawing surfaces cannot, so we have to do the	// compositing in an offscreen image that is specially created to have	// an "alpha channel", then copy the final result to the screen.	BufferedImage offscreen =	    new BufferedImage(COVERWIDTH, COVERHEIGHT,			      BufferedImage.TYPE_INT_ARGB);		// First, fill the image with a color gradient background that varies	// left-to-right from opaque to transparent yellow	Graphics2D osg = offscreen.createGraphics();	osg.setPaint(new GradientPaint(0, 0, Color.yellow,				       COVERWIDTH, 0,				       new Color(255, 255, 0, 0))); 	osg.fillRect(0,0, COVERWIDTH, COVERHEIGHT);	// Now copy the cover image on top of this, but use the DstOver rule	// which draws it "underneath" the existing pixels, and allows the	// image to show depending on the transparency of those pixels.	osg.setComposite(AlphaComposite.DstOver);	osg.drawImage(cover, 0, 0, c);		// And display this composited image on the screen.  Note that the	// image is opaque and that none of the screen background shows through	g.translate(COVERWIDTH+10, 0);	g.drawImage(offscreen, 0, 0, c);	g.drawString("DST_OVER", 0, COVERHEIGHT+15);	// Now start over and do a new effect with the off-screen image.	// First, fill the offscreen image with a new color gradient.  We	// don't care about the colors themselves; we just want the	// translucency of the background to vary.  We use opaque black to	// transparent black. Note that since we've already used this offscreen	// image, we set the composite to Src, we can fill the image and	// ignore anything that is already there.	osg.setComposite(AlphaComposite.Src); 	osg.setPaint(new GradientPaint(0, 0, Color.black,				       COVERWIDTH, COVERHEIGHT,				       new Color(0, 0, 0, 0))); 	osg.fillRect(0,0, COVERWIDTH, COVERHEIGHT);		// Now set the compositing type to SrcIn, so colors come from the 	// source, but translucency comes from the destination	osg.setComposite(AlphaComposite.SrcIn);		// Draw our loaded image into the off-screen image, compositing it.	osg.drawImage(cover, 0, 0, c);		// And then copy our off-screen image to the screen.  Note that the	// image is translucent and some of the image shows through.	g.translate(COVERWIDTH+10, 0);	g.drawImage(offscreen, 0, 0, c);	g.drawString("SRC_IN", 0, COVERHEIGHT+15);		// If we do the same thing but use SrcOut, then the resulting image 	// will have the inverted translucency values of the destination	osg.setComposite(AlphaComposite.Src); 	osg.setPaint(new GradientPaint(0, 0, Color.black,				       COVERWIDTH, COVERHEIGHT,				       new Color(0, 0, 0, 0))); 	osg.fillRect(0,0, COVERWIDTH, COVERHEIGHT);	osg.setComposite(AlphaComposite.SrcOut);	osg.drawImage(cover, 0, 0, c);	g.translate(COVERWIDTH+10, 0);	g.drawImage(offscreen, 0, 0, c);	g.drawString("SRC_OUT", 0, COVERHEIGHT+15);	// Here's a cool effect; it has nothing to do with compositing, but	// uses an arbitrary shape to clip the image.  It uses Area to combine	// shapes into more complicated ones.	g.translate(COVERWIDTH+10, 0);	Shape savedClip = g.getClip();  // Save current clipping region	// Create a shape to use as the new clipping region.  	// Begin with an ellipse	Area clip = new Area(new Ellipse2D.Float(0,0,COVERWIDTH,COVERHEIGHT));	// Intersect with a rectangle, truncating the ellipse.	clip.intersect(new Area(new Rectangle(5,5,					      COVERWIDTH-10,COVERHEIGHT-10)));	// Then subtract an ellipse from the bottom of the truncated ellipse.	clip.subtract(new Area(new Ellipse2D.Float(COVERWIDTH/2-40,						   COVERHEIGHT-20, 80, 40)));	// Use the resulting shape as the new clipping region	g.clip(clip);	// Then draw the image through this clipping region	g.drawImage(cover, 0, 0, c);	// Restore the old clipping region so we can label the effect	g.setClip(savedClip);	g.drawString("Clipping", 0, COVERHEIGHT+15);    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久小美女| 青青草国产成人99久久| 91一区二区在线| 亚洲成人777| 久久久青草青青国产亚洲免观| 国产精品一色哟哟哟| 久久五月婷婷丁香社区| 99久久综合色| 欧洲色大大久久| 亚洲一级电影视频| 成人免费观看视频| 亚洲麻豆国产自偷在线| 欧美一区二区三区免费在线看| 国产在线不卡一区| 亚洲一区二区三区小说| 91精品久久久久久久久99蜜臂| 风间由美性色一区二区三区| 亚洲国产精品一区二区久久恐怖片| 2021中文字幕一区亚洲| 欧美系列亚洲系列| 青青青爽久久午夜综合久久午夜 | 丁香啪啪综合成人亚洲小说| 亚洲成人动漫一区| 国产精品理论片| 欧美成人免费网站| 欧美中文字幕一区二区三区| 久久99国内精品| 亚洲二区在线观看| 国产精品视频在线看| 日韩欧美一区二区免费| 欧美最猛性xxxxx直播| 国产成人福利片| 日本伊人色综合网| 一区二区三区不卡在线观看 | 337p亚洲精品色噜噜| av成人免费在线观看| 国产高清在线精品| 亚洲r级在线视频| 亚洲欧美日韩中文字幕一区二区三区 | 一区二区三区在线播放| 国产精品污www在线观看| 精品国产一区二区三区av性色| 欧美人妇做爰xxxⅹ性高电影| 在线影视一区二区三区| 99久久伊人网影院| 国产91精品欧美| 国产老女人精品毛片久久| 日韩国产精品大片| 日韩高清不卡一区| 日日夜夜精品视频天天综合网| 亚洲第一激情av| 亚洲国产一区二区三区| 亚洲精品乱码久久久久久| 中文字幕一区二区在线播放| 欧美xxx久久| 精品国产乱码久久久久久1区2区| 欧美一区二区三区四区高清| 欧美高清视频www夜色资源网| 色欧美片视频在线观看在线视频| 一道本成人在线| 国产成人自拍在线| 福利电影一区二区| 国产精品18久久久久久久网站| 黄色小说综合网站| 极品尤物av久久免费看| 久久狠狠亚洲综合| 精品亚洲成a人| 美女视频一区在线观看| 麻豆freexxxx性91精品| 日产精品久久久久久久性色| 毛片av一区二区三区| 日韩黄色一级片| 蜜臂av日日欢夜夜爽一区| 久久精品国产**网站演员| 国内精品伊人久久久久av影院| 亚洲视频精选在线| 欧美三级电影一区| 91视频免费观看| 粉嫩一区二区三区在线看| 一本到三区不卡视频| 91国在线观看| 国产日韩高清在线| 99久久精品国产导航| 日本一区二区三区四区| 日韩精品亚洲一区二区三区免费| 亚洲国产另类av| 亚洲视频在线一区观看| 午夜久久久久久| 日韩一卡二卡三卡四卡| 免费成人在线视频观看| 欧美综合在线视频| 精品国产免费一区二区三区四区| 亚洲成人在线观看视频| 狠狠色狠狠色综合| 色综合久久久网| 精品三级在线看| 婷婷久久综合九色国产成人| 麻豆精品一区二区| 一本到三区不卡视频| 亚洲午夜一区二区三区| 国产一区日韩二区欧美三区| 国产精品不卡在线| 欧美一区二区三区在线| 一区二区日韩电影| 97成人超碰视| 欧美国产亚洲另类动漫| 精品一区二区三区免费播放| 欧美成人一区二区三区在线观看| 1000部国产精品成人观看| 波多野结衣在线aⅴ中文字幕不卡| 久久久久久久综合色一本| 亚洲欧美一区二区视频| 欧美无乱码久久久免费午夜一区| 亚洲免费观看高清完整版在线观看| 国产成人免费高清| 久久伊人中文字幕| 极品尤物av久久免费看| 日韩欧美中文一区二区| 亚洲五月六月丁香激情| av日韩在线网站| 国产人久久人人人人爽| 老司机午夜精品| 中文字幕一区二| 欧美不卡123| 久久成人免费网| 国产精品国产三级国产三级人妇 | 亚洲国产一区二区在线播放| 高清不卡一区二区在线| 欧美中文字幕亚洲一区二区va在线 | 亚洲成人免费电影| 精品国产伦一区二区三区观看体验| 一区二区三区中文在线观看| 成人久久久精品乱码一区二区三区| 精品国产乱码久久久久久久久 | 亚洲一二三四久久| 日韩中文字幕不卡| 成人精品在线视频观看| 国产日产精品1区| 国产精品亚洲第一区在线暖暖韩国 | 久久精品久久综合| 精品久久久久香蕉网| 久久电影网电视剧免费观看| 欧美成人一区二区三区| 日韩福利电影在线观看| 欧美一区二区久久| 老汉av免费一区二区三区 | 亚洲视频一区二区在线观看| 91视视频在线观看入口直接观看www | 麻豆成人久久精品二区三区红 | 国产麻豆一精品一av一免费| 国产三级久久久| 成人黄色软件下载| 亚洲精品国产无天堂网2021 | 99久久综合国产精品| 一区二区欧美在线观看| 在线成人免费观看| 久久精品国产一区二区| 久久久午夜精品| 91丨九色porny丨蝌蚪| 亚洲在线免费播放| 91精品国产综合久久福利软件 | www.欧美亚洲| 亚洲国产视频直播| 欧美大胆人体bbbb| 成人一区二区三区在线观看| 日韩久久一区二区| 欧美久久婷婷综合色| 久久成人久久爱| 国产精品美女久久久久高潮| 在线观看国产一区二区| 蜜桃视频第一区免费观看| 欧美激情一区二区三区蜜桃视频 | 欧美日韩一区二区三区高清| 美女视频一区在线观看| 国产精品久久久久久久蜜臀| 欧美久久久久中文字幕| 久久久美女毛片| 日韩在线观看一区二区| 不卡一区中文字幕| 99视频一区二区| 26uuu久久天堂性欧美| 国产偷国产偷精品高清尤物| 亚洲日本在线看| 婷婷成人综合网| 成人aaaa免费全部观看| 欧美成人一区二区三区在线观看| 欧美国产日韩a欧美在线观看 | 1024国产精品| 9191精品国产综合久久久久久| 国产专区欧美精品| 一区二区三区四区视频精品免费 | 久久99国产精品麻豆| 中文字幕一区二区视频| 日韩精品一区二区三区中文精品 | 欧美日韩成人激情| 国产xxx精品视频大全| 日本人妖一区二区| 一区二区三区毛片| 欧美国产一区视频在线观看| 欧美一区二区人人喊爽|