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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? image.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.graphics;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;import java.io.*;/** * Instances of this class are graphics which have been prepared * for display on a specific device. That is, they are ready * to paint using methods such as <code>GC.drawImage()</code> * and display on widgets with, for example, <code>Button.setImage()</code>. * <p> * If loaded from a file format that supports it, an * <code>Image</code> may have transparency, meaning that certain * pixels are specified as being transparent when drawn. Examples * of file formats that support transparency are GIF and PNG. * </p><p> * There are two primary ways to use <code>Images</code>.  * The first is to load a graphic file from disk and create an * <code>Image</code> from it. This is done using an <code>Image</code> * constructor, for example: * <pre> *    Image i = new Image(device, "C:\\graphic.bmp"); * </pre> * A graphic file may contain a color table specifying which * colors the image was intended to possess. In the above example, * these colors will be mapped to the closest available color in * SWT. It is possible to get more control over the mapping of * colors as the image is being created, using code of the form: * <pre> *    ImageData data = new ImageData("C:\\graphic.bmp");  *    RGB[] rgbs = data.getRGBs();  *    // At this point, rgbs contains specifications of all *    // the colors contained within this image. You may *    // allocate as many of these colors as you wish by *    // using the Color constructor Color(RGB), then *    // create the image: *    Image i = new Image(device, data); * </pre> * <p> * Applications which require even greater control over the image * loading process should use the support provided in class * <code>ImageLoader</code>. * </p><p> * Application code must explicitely invoke the <code>Image.dispose()</code>  * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> * * @see Color * @see ImageData * @see ImageLoader */public final class Image implements Drawable {		/**	 * specifies whether the receiver is a bitmap or an icon	 * (one of <code>SWT.BITMAP</code>, <code>SWT.ICON</code>)	 */	public int type;		/**	 * the handle to the OS image resource	 * (Warning: This field is platform dependent)	 */	public int handle;		/**	 * the device where this image was created	 */	Device device;		/**	 * specifies the transparent pixel	 * (Warning: This field is platform dependent)	 */	int transparentPixel = -1;		/**	 * the GC which is drawing on the image	 * (Warning: This field is platform dependent)	 */	GC memGC;		/**	 * the alpha data for the image	 * (Warning: This field is platform dependent)	 */	byte[] alphaData;		/**	 * the global alpha value to be used for every pixel	 * (Warning: This field is platform dependent)	 */	int alpha = -1;		/**	 * the image data used to create this image if it is a	 * icon. Used only in WinCE	 * (Warning: This field is platform dependent)	 */	ImageData data;		/**	 * specifies the default scanline padding	 * (Warning: This field is platform dependent)	 */	static final int DEFAULT_SCANLINE_PAD = 4;/** * Prevents uninitialized instances from being created outside the package. */Image () {}/** * Constructs an empty instance of this class with the * specified width and height. The result may be drawn upon * by creating a GC and using any of its drawing operations, * as shown in the following example: * <pre> *    Image i = new Image(device, width, height); *    GC gc = new GC(i); *    gc.drawRectangle(0, 0, 50, 50); *    gc.dispose(); * </pre> * <p> * Note: Some platforms may have a limitation on the size * of image that can be created (size depends on width, height, * and depth). For example, Windows 95, 98, and ME do not allow * images larger than 16M. * </p> * * @param device the device on which to create the image * @param width the width of the new image * @param height the height of the new image * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> *    <li>ERROR_INVALID_ARGUMENT - if either the width or height is negative or zero</li> * </ul> * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> */public Image(Device device, int width, int height) {	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	init(device, width, height);	if (device.tracking) device.new_Object(this);	}/** * Constructs a new instance of this class based on the * provided image, with an appearance that varies depending * on the value of the flag. The possible flag values are: * <dl> * <dt><b>IMAGE_COPY</b></dt> * <dd>the result is an identical copy of srcImage</dd> * <dt><b>IMAGE_DISABLE</b></dt> * <dd>the result is a copy of srcImage which has a <em>disabled</em> look</dd> * <dt><b>IMAGE_GRAY</b></dt> * <dd>the result is a copy of srcImage which has a <em>gray scale</em> look</dd> * </dl> * * @param device the device on which to create the image * @param srcImage the image to use as the source * @param flag the style, either <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code> * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> *    <li>ERROR_NULL_ARGUMENT - if srcImage is null</li> *    <li>ERROR_INVALID_ARGUMENT - if the flag is not one of <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code></li> *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon, or *          is otherwise in an invalid state</li> *    <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the Image is not supported</li> * </ul> * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> */public Image(Device device, Image srcImage, int flag) {	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	this.device = device;	if (srcImage == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	if (srcImage.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);	switch (flag) {		case SWT.IMAGE_COPY: {			Rectangle r = srcImage.getBounds();			this.type = srcImage.type;			switch (type) {				case SWT.BITMAP:					/* Get the HDC for the device */					int hDC = device.internal_new_GC(null);										/* Copy the bitmap */					int hdcSource = OS.CreateCompatibleDC(hDC);					int hdcDest = OS.CreateCompatibleDC(hDC);					int hOldSrc = OS.SelectObject(hdcSource, srcImage.handle);					handle = OS.CreateCompatibleBitmap(hdcSource, r.width, r.height);					if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);					int hOldDest = OS.SelectObject(hdcDest, handle);					OS.BitBlt(hdcDest, 0, 0, r.width, r.height, hdcSource, 0, 0, OS.SRCCOPY);					OS.SelectObject(hdcSource, hOldSrc);					OS.SelectObject(hdcDest, hOldDest);					OS.DeleteDC(hdcSource);					OS.DeleteDC(hdcDest);					/* Release the HDC for the device */					device.internal_dispose_GC(hDC, null);					transparentPixel = srcImage.transparentPixel;					alpha = srcImage.alpha;					if (srcImage.alphaData != null) {						alphaData = new byte[srcImage.alphaData.length];						System.arraycopy(srcImage.alphaData, 0, alphaData, 0, alphaData.length);					}					break;				case SWT.ICON:					if (OS.IsWinCE) {						init(device, srcImage.data);					} else {						handle = OS.CopyImage(srcImage.handle, OS.IMAGE_ICON, r.width, r.height, 0);						if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);					}					break;				default:					SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);			}			if (device.tracking) device.new_Object(this);				return;		}		case SWT.IMAGE_DISABLE: {			Rectangle r = srcImage.getBounds();			this.type = srcImage.type;			byte[] rgbBwBitmapInfo = {				40,0,0,0, /* biSize */				(byte)(r.width & 0xFF), /* biWidth */				(byte)((r.width & 0xFF00) >> 8),				(byte)((r.width & 0xFF0000) >> 16),				(byte)((r.width & 0xFF000000) >> 24),				(byte)(r.height & 0xFF), /* biHeight */				(byte)((r.height & 0xFF00) >> 8),				(byte)((r.height & 0xFF0000) >> 16),				(byte)((r.height & 0xFF000000) >> 24),				1,0, /* biPlanes */				1,0, /* biBitCount */				0,0,0,0, /* biCompression */				0,0,0,0, /* biSizeImage */				0,0,0,0, /* biXPelsPerMeter */				0,0,0,0, /* biYPelsPerMeter */				0,0,0,0, /* biClrUsed */				0,0,0,0, /* biClrImportant */				0,0,0,0, /* First color: black */				(byte)0xFF,(byte)0xFF,(byte)0xFF,0 /* Second color: white */			};			/* Get the HDC for the device */			int hDC = device.internal_new_GC(null);			/* Source DC */			int hdcSource = OS.CreateCompatibleDC(hDC);			if (hdcSource == 0) SWT.error(SWT.ERROR_NO_HANDLES);			/* Monochrome (Intermediate) DC */			int bwDC = OS.CreateCompatibleDC(hdcSource);			if (bwDC == 0) SWT.error(SWT.ERROR_NO_HANDLES);			/* Destination DC */			int hdcBmp = OS.CreateCompatibleDC(hDC);			if (hdcBmp == 0) SWT.error(SWT.ERROR_NO_HANDLES);			/* Monochrome (Intermediate) DIB section */			int[] pbitsBW = new int[1];			int hbmBW = OS.CreateDIBSection(bwDC, rgbBwBitmapInfo, OS.DIB_RGB_COLORS, pbitsBW, 0, 0);			if (hbmBW == 0) SWT.error(SWT.ERROR_NO_HANDLES);			switch (type) {				case SWT.BITMAP:					/* Attach the bitmap to the source DC */					int hOldSrc = OS.SelectObject(hdcSource, srcImage.handle);					/* Create the destination bitmap */					handle = OS.CreateCompatibleBitmap(hDC, r.width, r.height);					if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);					/* Attach the DIB section and the new bitmap to the DCs */					int hOldBw = OS.SelectObject(bwDC, hbmBW);					int hOldBmp = OS.SelectObject(hdcBmp, handle);					/* BitBlt the bitmap into the monochrome DIB section */					OS.BitBlt(bwDC, 0, 0, r.width, r.height, hdcSource, 0, 0, OS.SRCCOPY);					/* Paint the destination rectangle in gray */					RECT rect = new RECT();					rect.left = 0;					rect.top = 0;					rect.right = r.width;					rect.bottom = r.height;					OS.FillRect(hdcBmp, rect, OS.GetSysColorBrush(OS.COLOR_3DFACE));					/*					 * BitBlt the black bits in the monochrome bitmap into					 * COLOR_3DHILIGHT bits in the destination DC.					 * The magic ROP comes from Charles Petzold's book					 */					int hb = OS.CreateSolidBrush(OS.GetSysColor(OS.COLOR_3DHILIGHT));					int oldBrush = OS.SelectObject(hdcBmp, hb);					OS.BitBlt(hdcBmp, 1, 1, r.width, r.height, bwDC, 0, 0, 0xB8074A);					/*					 * BitBlt the black bits in the monochrome bitmap into 					 * COLOR_3DSHADOW bits in the destination DC.					 */					hb = OS.CreateSolidBrush(OS.GetSysColor(OS.COLOR_3DSHADOW));					OS.DeleteObject(OS.SelectObject(hdcBmp, hb));					OS.BitBlt(hdcBmp, 0, 0, r.width, r.height, bwDC, 0, 0, 0xB8074A);					OS.DeleteObject(OS.SelectObject(hdcBmp, oldBrush));					/* Free resources */					OS.SelectObject(hdcSource, hOldSrc);					OS.SelectObject(hdcBmp, hOldBmp);					OS.SelectObject(bwDC, hOldBw);					OS.DeleteDC(hdcSource);					OS.DeleteDC(bwDC);					OS.DeleteDC(hdcBmp);					OS.DeleteObject(hbmBW);										/* Release the HDC for the device */					device.internal_dispose_GC(hDC, null);					break;				case SWT.ICON:					/* Get icon information */					ICONINFO iconInfo = new ICONINFO();					if (OS.IsWinCE) {						GetIconInfo(srcImage, iconInfo);					} else {						if (!OS.GetIconInfo(srcImage.handle, iconInfo))							SWT.error(SWT.ERROR_INVALID_IMAGE);					}					int hdcMask = OS.CreateCompatibleDC(hDC);					/* Create the destination bitmaps */					if (iconInfo.hbmColor == 0)						hOldSrc = OS.SelectObject(hdcSource, iconInfo.hbmMask);					else						hOldSrc = OS.SelectObject(hdcSource, iconInfo.hbmColor);					int newHbmp = OS.CreateCompatibleBitmap(hdcSource, r.width, r.height);					if (newHbmp == 0) SWT.error(SWT.ERROR_NO_HANDLES);					int newHmask = OS.CreateBitmap(r.width, r.height, 1, 1, null);					if (newHmask == 0) SWT.error(SWT.ERROR_NO_HANDLES);					/* BitBlt the source mask into the destination mask */					int hOldMask = OS.SelectObject(hdcMask, newHmask);					if (iconInfo.hbmColor != 0)						OS.SelectObject(hdcSource, iconInfo.hbmMask);					OS.SelectObject(hdcSource, iconInfo.hbmMask);					OS.BitBlt(hdcMask, 0, 0, r.width, r.height, hdcSource, 0, 0, OS.SRCCOPY);					/* Attach the monochrome DIB section and the destination bitmap to the DCs */					hOldBw = OS.SelectObject(bwDC, hbmBW);					/* BitBlt the bitmap into the monochrome DIB section */					if (iconInfo.hbmColor == 0) {						OS.SelectObject(hdcSource, iconInfo.hbmMask);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品一区二区亚洲孕妇| 亚洲高清免费观看| 精品国产一区二区三区av性色| 在线免费观看不卡av| 欧洲精品一区二区| 91精品在线一区二区| 欧美一区二区三区成人| 欧美一级xxx| 久久视频一区二区| 国产女人18毛片水真多成人如厕| 欧美国产日本视频| 亚洲视频每日更新| 五月婷婷欧美视频| 激情五月婷婷综合网| 国产东北露脸精品视频| 99r国产精品| 欧美日韩一区小说| 精品国精品国产| 中文字幕中文乱码欧美一区二区| 一区二区在线免费观看| 久久国产尿小便嘘嘘尿| 国产成人在线视频免费播放| 91视频观看免费| 欧美日韩色一区| 精品奇米国产一区二区三区| 亚洲欧洲成人av每日更新| 亚洲午夜av在线| 国产精品123| 精品视频一区三区九区| 久久久.com| 水蜜桃久久夜色精品一区的特点| 韩国女主播成人在线观看| 色综合天天天天做夜夜夜夜做| 制服视频三区第一页精品| 久久久电影一区二区三区| 亚洲国产sm捆绑调教视频| 国产一区二区不卡在线 | 日本成人在线看| 国产乱码精品一区二区三区忘忧草| 成人国产一区二区三区精品| 制服丝袜亚洲播放| 亚洲免费在线观看| 国产乱码字幕精品高清av | 欧美r级电影在线观看| 最新日韩在线视频| 美女尤物国产一区| 在线观看av一区二区| 中文字幕精品三区| 九九国产精品视频| 欧美日韩一区小说| 一区二区三区免费观看| 国产99久久久精品| 久久综合色8888| 日韩精品午夜视频| 在线免费观看一区| 亚洲蜜桃精久久久久久久| 国产91丝袜在线播放0| 精品久久久久99| 蜜臀国产一区二区三区在线播放 | 欧美一区二区三区日韩| 亚洲人成网站在线| 成人av网站免费观看| 日本一区二区三区高清不卡| 国模一区二区三区白浆| 日韩美女视频在线| 久久精品二区亚洲w码| 日韩一区二区三区三四区视频在线观看 | 欧美理论在线播放| 一区二区三区在线视频播放| 99国产欧美久久久精品| 中文字幕乱码一区二区免费| 国产传媒日韩欧美成人| 欧美韩日一区二区三区四区| 丰满岳乱妇一区二区三区| 国产午夜精品理论片a级大结局| 黑人精品欧美一区二区蜜桃| 久久天堂av综合合色蜜桃网| 国产二区国产一区在线观看| 国产精品剧情在线亚洲| 91首页免费视频| 亚洲一级二级在线| 911国产精品| 久久99久久精品| 久久久精品欧美丰满| 成人激情免费视频| 一区二区三区欧美亚洲| 欧美嫩在线观看| 国内精品久久久久影院色| 国产精品天干天干在线综合| 91色porny在线视频| 亚洲福利视频一区| 久久综合一区二区| hitomi一区二区三区精品| 伊人夜夜躁av伊人久久| 日韩一区二区视频| 高清视频一区二区| 亚洲综合区在线| 精品少妇一区二区三区| av不卡一区二区三区| 亚洲福利视频一区二区| 久久九九99视频| 欧美性感一类影片在线播放| 久国产精品韩国三级视频| 国产精品免费观看视频| 欧美日本国产视频| 国产精一品亚洲二区在线视频| 亚洲三级电影全部在线观看高清| 欧美巨大另类极品videosbest| 国产一区二区中文字幕| 一区二区三区电影在线播| 精品福利在线导航| 欧美视频一区二区| 国产福利一区二区三区视频| 午夜久久久久久久久| 亚洲国产精华液网站w| 8x8x8国产精品| 99久久er热在这里只有精品15| 麻豆一区二区三| 亚洲一区二区在线播放相泽| 国产午夜亚洲精品理论片色戒| 欧美日韩精品欧美日韩精品一综合| 国产成人av一区二区三区在线观看| 午夜欧美2019年伦理| 亚洲精品久久久蜜桃| 国产欧美日韩卡一| 精品久久国产老人久久综合| 精品视频在线看| 91国内精品野花午夜精品| 国产成人免费视频网站| 免费久久99精品国产| 一区二区三区精品视频| 亚洲视频一区在线观看| 中文字幕在线播放不卡一区| 亚洲精品一区二区三区影院| 51精品久久久久久久蜜臀| 欧美在线播放高清精品| 97精品视频在线观看自产线路二| 国产一区二区三区免费在线观看| 亚洲va韩国va欧美va精品| 一区二区三区电影在线播| 亚洲视频在线观看三级| 亚洲三级理论片| 亚洲激情欧美激情| 一区二区三区视频在线观看| 亚洲精品国产无天堂网2021| 中文字幕人成不卡一区| 国产精品成人一区二区三区夜夜夜| 国产欧美日韩在线观看| 中文成人av在线| 亚洲欧美一区二区在线观看| 欧美国产日韩a欧美在线观看| 国产欧美日韩亚州综合| 国产精品久久久久久一区二区三区 | 在线视频你懂得一区二区三区| 91在线无精精品入口| 成人app软件下载大全免费| 成人免费看黄yyy456| 99久久精品免费看国产免费软件| 成人福利视频在线看| 91视视频在线直接观看在线看网页在线看 | 国产精品免费久久久久| 国产精品福利在线播放| 一区二区国产视频| 午夜精品视频一区| 久久av资源网| 国产成人福利片| 色久优优欧美色久优优| 欧美卡1卡2卡| 精品国产a毛片| 国产精品色哟哟网站| 亚洲在线中文字幕| 日本三级亚洲精品| 高清shemale亚洲人妖| 91麻豆高清视频| 日韩欧美中文字幕一区| 日本一区二区电影| 一区二区三区成人| 久久99日本精品| 色综合久久综合| 精品国产髙清在线看国产毛片 | 日韩亚洲欧美在线| 国产精品免费aⅴ片在线观看| 亚洲自拍偷拍网站| 国产成人免费视频| 欧美日韩美少妇| 国产精品污污网站在线观看| 亚洲成人激情av| 粉嫩一区二区三区性色av| 欧美日韩国产三级| 国产精品国产自产拍高清av| 五月综合激情网| 91麻豆精品一区二区三区| 2024国产精品| 午夜视频在线观看一区二区三区| 国产一区二区三区电影在线观看| 日本黄色一区二区| 欧美激情一区二区三区不卡 | 美脚の诱脚舐め脚责91 | 91麻豆精品国产91久久久更新时间 | 91麻豆精品国产自产在线观看一区 |