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

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

?? gc.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.*;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;/** * Class <code>GC</code> is where all of the drawing capabilities that are  * supported by SWT are located. Instances are used to draw on either an  * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>. * <dl> * <dt><b>Styles:</b></dt> * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd> * </dl> *  * <p> * The SWT drawing coordinate system is the two-dimensional space with the origin * (0,0) at the top left corner of the drawing area and with (x,y) values increasing * to the right and downward respectively. * </p> *  * <p> * Application code must explicitly invoke the <code>GC.dispose()</code>  * method to release the operating system resources managed by each instance * when those instances are no longer required. This is <em>particularly</em> * important on Windows95 and Windows98 where the operating system has a limited * number of device contexts available. * </p> *  * <p> * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified. * </p> * * @see org.eclipse.swt.events.PaintEvent */public final class GC {		/**	 * the handle to the OS device context	 * (Warning: This field is platform dependent)	 */	public int handle;	Drawable drawable;	GCData data;/** * Prevents uninitialized instances from being created outside the package. */GC() {}/**	  * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the * foreground and background color in the GC to match those * in the drawable. * <p> * You must dispose the graphics context when it is no longer required.  * </p> * @param drawable the drawable to draw on * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the drawable is null</li> *    <li>ERROR_NULL_ARGUMENT - if there is no current device</li> *    <li>ERROR_INVALID_ARGUMENT *          - if the drawable is an image that is not a bitmap or an icon *          - if the drawable is an image or printer that is already selected *            into another graphics context</li> * </ul> * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li> * </ul> */public GC(Drawable drawable) {	this(drawable, SWT.NONE);}/**	  * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the * foreground and background color in the GC to match those * in the drawable. * <p> * You must dispose the graphics context when it is no longer required.  * </p> *  * @param drawable the drawable to draw on * @param style the style of GC to construct *  * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the drawable is null</li> *    <li>ERROR_NULL_ARGUMENT - if there is no current device</li> *    <li>ERROR_INVALID_ARGUMENT *          - if the drawable is an image that is not a bitmap or an icon *          - if the drawable is an image or printer that is already selected *            into another graphics context</li> * </ul> * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li> * </ul> *   * @since 2.1.2 */public GC(Drawable drawable, int style) {	if (drawable == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	GCData data = new GCData ();	data.style = checkStyle(style);	int hDC = drawable.internal_new_GC(data);	Device device = data.device;	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	data.device = device;	init (drawable, data, hDC);	if (device.tracking) device.new_Object(this);	}static int checkStyle(int style) {	if ((style & SWT.LEFT_TO_RIGHT) != 0) style &= ~SWT.RIGHT_TO_LEFT;	return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);}/** * Copies a rectangular area of the receiver at the specified * position into the image, which must be of type <code>SWT.BITMAP</code>. * * @param image the image to copy into * @param x the x coordinate in the receiver of the area to be copied * @param y the y coordinate in the receiver of the area to be copied * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the image is null</li> *    <li>ERROR_INVALID_ARGUMENT - if the image is not a bitmap or has been disposed</li>  * </ul> * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public void copyArea(Image image, int x, int y) {	if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	if (image.type != SWT.BITMAP || image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);		/* Get the HDC for the device */	Device device = data.device; 	int hDC = device.internal_new_GC(null); 	 	/* Copy the bitmap area */	Rectangle rect = image.getBounds(); 		int memHdc = OS.CreateCompatibleDC(hDC);	int hOldBitmap = OS.SelectObject(memHdc, image.handle);	OS.BitBlt(memHdc, 0, 0, rect.width, rect.height, handle, x, y, OS.SRCCOPY);	OS.SelectObject(memHdc, hOldBitmap);	OS.DeleteDC(memHdc);		/* Release the HDC for the device */	device.internal_dispose_GC(hDC, null);}/** * Copies a rectangular area of the receiver at the source * position onto the receiver at the destination position. * * @param srcX the x coordinate in the receiver of the area to be copied * @param srcY the y coordinate in the receiver of the area to be copied * @param width the width of the area to copy * @param height the height of the area to copy * @param destX the x coordinate in the receiver of the area to copy to * @param destY the y coordinate in the receiver of the area to copy to * * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY) {	if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	/*	* Feature in WinCE.  The function WindowFromDC is not part of the	* WinCE SDK.  The fix is to remember the HWND.	*/	int hwnd = data.hwnd;	if (hwnd == 0) {		OS.BitBlt(handle, destX, destY, width, height, handle, srcX, srcY, OS.SRCCOPY);	} else {		RECT lprcClip = null;		int hrgn = OS.CreateRectRgn(0, 0, 0, 0);		if (OS.GetClipRgn(handle, hrgn) == 1) {			lprcClip = new RECT();			OS.GetRgnBox(hrgn, lprcClip);		}		OS.DeleteObject(hrgn);		RECT lprcScroll = new RECT();		OS.SetRect(lprcScroll, srcX, srcY, srcX + width, srcY + height);		int res = OS.ScrollWindowEx(hwnd, destX - srcX, destY - srcY, lprcScroll, lprcClip, 0, null, OS.SW_INVALIDATE | OS.SW_ERASE); 		/*		* Feature in WinCE.  ScrollWindowEx does not accept combined		* vertical and horizontal scrolling.  The fix is to do a		* BitBlt and invalidate the appropriate source area.		*/		if (res == 0 && OS.IsWinCE) {			OS.BitBlt(handle, destX, destY, width, height, handle, srcX, srcY, OS.SRCCOPY);			int deltaX = destX - srcX, deltaY = destY - srcY;			boolean disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY);			if (disjoint) {				OS.InvalidateRect(hwnd, lprcScroll, true);			} else {				if (deltaX != 0) {					int newX = destX - deltaX;					if (deltaX < 0) newX = destX + width;					OS.SetRect(lprcScroll, newX, srcY, newX + Math.abs(deltaX), srcY + height);					OS.InvalidateRect(hwnd, lprcScroll, true);				}				if (deltaY != 0) {					int newY = destY - deltaY;					if (deltaY < 0) newY = destY + height;					OS.SetRect(lprcScroll, srcX, newY, srcX + width, newY + Math.abs(deltaY));					OS.InvalidateRect(hwnd, lprcScroll, true);				}			}		}	}}int createDIB(int width, int height) {	short depth = 32;	BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER();	bmiHeader.biSize = BITMAPINFOHEADER.sizeof;	bmiHeader.biWidth = width;	bmiHeader.biHeight = -height;	bmiHeader.biPlanes = 1;	bmiHeader.biBitCount = depth;	if (OS.IsWinCE) bmiHeader.biCompression = OS.BI_BITFIELDS;	else bmiHeader.biCompression = OS.BI_RGB;	byte[]	bmi = new byte[BITMAPINFOHEADER.sizeof + (OS.IsWinCE ? 12 : 0)];	OS.MoveMemory(bmi, bmiHeader, BITMAPINFOHEADER.sizeof);	/* Set the rgb colors into the bitmap info */	if (OS.IsWinCE) {		int redMask = 0xFF00;		int greenMask = 0xFF0000;		int blueMask = 0xFF000000;		/* big endian */		int offset = BITMAPINFOHEADER.sizeof;		bmi[offset] = (byte)((redMask & 0xFF000000) >> 24);		bmi[offset + 1] = (byte)((redMask & 0xFF0000) >> 16);		bmi[offset + 2] = (byte)((redMask & 0xFF00) >> 8);		bmi[offset + 3] = (byte)((redMask & 0xFF) >> 0);		bmi[offset + 4] = (byte)((greenMask & 0xFF000000) >> 24);		bmi[offset + 5] = (byte)((greenMask & 0xFF0000) >> 16);		bmi[offset + 6] = (byte)((greenMask & 0xFF00) >> 8);		bmi[offset + 7] = (byte)((greenMask & 0xFF) >> 0);		bmi[offset + 8] = (byte)((blueMask & 0xFF000000) >> 24);		bmi[offset + 9] = (byte)((blueMask & 0xFF0000) >> 16);		bmi[offset + 10] = (byte)((blueMask & 0xFF00) >> 8);		bmi[offset + 11] = (byte)((blueMask & 0xFF) >> 0);	}	int[] pBits = new int[1];	int hDib = OS.CreateDIBSection(0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0);	if (hDib == 0) SWT.error(SWT.ERROR_NO_HANDLES);	return hDib;}/** * Disposes of the operating system resources associated with * the graphics context. Applications must dispose of all GCs * which they allocate. */public void dispose() {	if (handle == 0) return;	if (data.device.isDisposed()) return;		/* Select stock pen and brush objects and free resources */	if (data.hPen != 0) {		int nullPen = OS.GetStockObject(OS.NULL_PEN);		OS.SelectObject(handle, nullPen);		OS.DeleteObject(data.hPen);		data.hPen = 0;	}	if (data.hBrush != 0) {		int nullBrush = OS.GetStockObject(OS.NULL_BRUSH);		OS.SelectObject(handle, nullBrush);		OS.DeleteObject(data.hBrush);		data.hBrush = 0;	}		/*	* Put back the original bitmap into the device context.	* This will ensure that we have not left a bitmap	* selected in it when we delete the HDC.	*/	int hNullBitmap = data.hNullBitmap;	if (hNullBitmap != 0) {		OS.SelectObject(handle, hNullBitmap);		data.hNullBitmap = 0;	}	Image image = data.image;	if (image != null) image.memGC = null;		/*	* Dispose the HDC.	*/	Device device = data.device;	if (drawable != null) drawable.internal_dispose_GC(handle, data);	drawable = null;	handle = 0;	data.image = null;	data.ps = null;	if (device.tracking) device.dispose_Object(this);	data.device = null;	data = null;}/** * Draws the outline of a circular or elliptical arc  * within the specified rectangular area. * <p> * The resulting arc begins at <code>startAngle</code> and extends   * for <code>arcAngle</code> degrees, using the current color. * Angles are interpreted such that 0 degrees is at the 3 o'clock * position. A positive value indicates a counter-clockwise rotation * while a negative value indicates a clockwise rotation. * </p><p> * The center of the arc is the center of the rectangle whose origin  * is (<code>x</code>, <code>y</code>) and whose size is specified by the  * <code>width</code> and <code>height</code> arguments.  * </p><p> * The resulting arc covers an area <code>width + 1</code> pixels wide * by <code>height + 1</code> pixels tall. * </p>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品18久久久久| 精品日本一线二线三线不卡| 日韩免费看的电影| 亚洲色图第一区| 国产精品综合视频| 337p亚洲精品色噜噜狠狠| 国产精品欧美经典| 国产剧情av麻豆香蕉精品| 欧美日韩综合色| 欧美成人精品福利| 香蕉成人伊视频在线观看| 一本久道中文字幕精品亚洲嫩| 波多野结衣在线一区| 精品国产一区二区三区久久久蜜月 | 亚洲国产成人在线| 免费在线欧美视频| 欧美日韩一区二区三区四区五区| 国产精品久久久久久久久免费樱桃| 麻豆精品久久久| 欧美一区二区在线观看| 亚洲第一福利一区| 欧美性xxxxx极品少妇| 一二三区精品福利视频| 色狠狠桃花综合| 亚洲人成网站精品片在线观看| 国产精品99久| 中文字幕乱码日本亚洲一区二区| 国产精品2024| 亚洲国产激情av| av电影天堂一区二区在线| 国产精品免费免费| 大美女一区二区三区| 国产精品不卡在线| 一本色道久久综合精品竹菊| 亚洲精品五月天| 欧美日韩一区二区在线观看视频| 亚洲成av人综合在线观看| 欧美日本国产视频| 日韩精品欧美成人高清一区二区| 欧美丰满少妇xxxxx高潮对白| 图片区小说区国产精品视频| 日韩一区二区免费在线电影| 国内精品国产成人| 国产区在线观看成人精品| 不卡视频在线看| 一区二区三区在线影院| 欧美三级韩国三级日本三斤| 麻豆成人免费电影| 国产亚洲视频系列| 99精品热视频| 天堂午夜影视日韩欧美一区二区| 欧美成va人片在线观看| 不卡的av网站| 婷婷成人激情在线网| 欧美变态凌虐bdsm| 99在线精品观看| 五月综合激情网| 久久久精品影视| 色婷婷国产精品| 免费在线欧美视频| 亚洲欧洲日韩一区二区三区| 欧美久久久久久蜜桃| 国产福利视频一区二区三区| 亚洲欧美日韩精品久久久久| 欧美一区在线视频| 成人精品视频.| 免费在线看成人av| 国产精品久久久久久久久免费丝袜 | 91麻豆精品国产无毒不卡在线观看 | 欧美精品色一区二区三区| 国内精品久久久久影院薰衣草| 亚洲欧洲三级电影| 欧美哺乳videos| 欧美无砖砖区免费| 国产成人av一区二区| 午夜一区二区三区视频| 亚洲国产精品二十页| 欧美一区二区三区在线视频| 97se亚洲国产综合自在线| 国产综合久久久久影院| 亚洲国产精品精华液网站| 中文字幕欧美激情一区| 欧美一区二区三区在线看| 色老头久久综合| 成人av影院在线| 国内精品伊人久久久久av一坑| 亚洲国产婷婷综合在线精品| 国产精品久久久久影院亚瑟| 精品国产乱码久久久久久蜜臀| 在线视频亚洲一区| 99久久精品免费看| 国产一区二区剧情av在线| 日韩精品一二三| 亚洲成人综合在线| 亚洲欧美另类小说| 国产精品素人一区二区| 久久免费精品国产久精品久久久久| 欧美精品在线观看播放| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产aⅴ精品一区二区三区色成熟| 美脚の诱脚舐め脚责91 | 精品乱人伦小说| 欧美日韩国产一区二区三区地区| 99国产精品久久久久久久久久久 | 91久久久免费一区二区| 成人美女视频在线看| 国产乱对白刺激视频不卡| 激情欧美日韩一区二区| 九色|91porny| 国产最新精品精品你懂的| 国产一区二区网址| 国产一区二区三区国产| 国产在线精品视频| 国产精品影音先锋| 国产传媒久久文化传媒| 国产剧情一区在线| 成人免费不卡视频| 99精品1区2区| 欧美三日本三级三级在线播放| 欧美这里有精品| 欧美顶级少妇做爰| 日韩欧美亚洲一区二区| 国产视频在线观看一区二区三区| 久久综合国产精品| 欧美国产一区二区| 亚洲欧美影音先锋| 亚洲综合av网| 石原莉奈在线亚洲三区| 捆绑调教一区二区三区| 国产米奇在线777精品观看| 成人在线综合网| 色综合久久综合网| 欧美一区在线视频| 国产精品天干天干在观线| 亚洲美女免费视频| 日韩极品在线观看| 国产高清在线精品| 欧美在线观看视频一区二区| 欧美一区二区性放荡片| 国产欧美日本一区二区三区| 一区二区三区高清不卡| 日韩av不卡一区二区| 国产91精品精华液一区二区三区| 99久精品国产| 日韩免费电影一区| 国产精品九色蝌蚪自拍| 日本欧美在线看| 成人av在线资源网| 制服视频三区第一页精品| 国产色综合久久| 亚洲国产日产av| 懂色av中文字幕一区二区三区| 91免费国产在线| 欧美精品一区二区不卡| 一区二区三区91| 国产91富婆露脸刺激对白| 欧美在线免费播放| 国产女主播视频一区二区| 天天影视涩香欲综合网| 福利电影一区二区三区| 在线成人av网站| 日韩一区在线播放| 久久不见久久见中文字幕免费| 99久久精品国产一区| 久久只精品国产| 五月综合激情日本mⅴ| av电影在线观看一区| 久久综合色天天久久综合图片| 亚洲综合图片区| 不卡的av在线| 久久精品综合网| 久久精品国产亚洲高清剧情介绍| 色94色欧美sute亚洲线路二 | 精品福利一二区| 午夜精品一区在线观看| 91欧美一区二区| 久久久久国产精品厨房| 蜜臀久久99精品久久久久宅男 | 欧美高清在线视频| 国产一区二区主播在线| 日韩午夜在线观看| 日韩精品久久理论片| 欧美性xxxxx极品少妇| 亚洲三级在线看| av网站免费线看精品| 国产亚洲精品精华液| 精品亚洲成av人在线观看| 日韩免费观看2025年上映的电影| 视频在线在亚洲| 3751色影院一区二区三区| 亚洲18女电影在线观看| 欧美无人高清视频在线观看| 亚洲男人的天堂av| 91亚洲精华国产精华精华液| 国产精品成人在线观看| 95精品视频在线| 亚洲激情自拍视频| 欧美四级电影在线观看| 亚洲乱码国产乱码精品精可以看 | 丝袜亚洲另类欧美|