您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 > 

03 youtube官網網頁版設置簽名圖片背景變透明(youtube網頁版怎么看)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-05-18 08:19:09【】8人已围观

简介oundbugshouldcall//popupWindowrepaint()butthatwillnotrepaintthe//panelpopupWindowgetContentPane()rep

ound bug should call // popupWindow repaint() but that will not repaint the // panel popupWindow getContentPane() repaint() } else { currOpacity = fadeInTimer stop() } } }) this fadeInTimer setRepeats(true) this fadeInTimer start() } }這時我們用0%的不透明度標記彈出窗口 然后我們啟動重復計時器進行五次迭代 每一次跌代我們增加窗口不透明度 % 并重新繪畫 最后我們停止計時器 最終的視覺結果是工具提示外觀的平滑退色序列 這一序列持續大約 毫秒

hide() 方法非常類似

@Override public void hide() { if (this toFade) { // cancel fade in if it s running if (this fadeInTimer isRunning()) this fadeInTimer stop() // start fading out this fadeOutTimer = new Timer( new ActionListener() { public void actionPerformed(ActionEvent e) { currOpacity = if (currOpacity >= ) { sun awt AWTUtilities setWindowOpacity(popupWindow currOpacity / f) // workaround bug should call // popupWindow repaint() but that will not repaint the // panel popupWindow getContentPane() repaint() } else { fadeOutTimer stop() popupWindow setVisible(false) popupWindow removeAll() popupWindow dispose() currOpacity = } } }) this fadeOutTimer setRepeats(true) this fadeOutTimer start() } else { popupWindow setVisible(false) popupWindow removeAll() popupWindow dispose() } }首先檢查退色序列是否仍在運行 根據需要將它刪除 然后 不立即隱藏窗口 而是將不透明度以 % 的增量從 % 改為 (因此漸隱序列是退色序列的兩倍)然后隱藏并處置彈出窗口 注意兩種方法參閱了 Boolean toFade 變量 —— 它在工具提示上被設置為 true 彈出窗口的其他類型(菜單 組合框下拉列表)沒有退色動畫

視頻反射現在讓我們做些更為激動人心的事情 在 Romain Guy 的博客條目 重畫管理器演示(第 章) 中 它顯示了提供反射功能的 Swing 組件 從他與 Chet Haase 合著的 《骯臟的富客戶機》 書中抽取一段測試應用程序 其中顯示該組件提供了 QuickTime 電影的實時反射 在窗口綁定 之外 進行反射如何?

首先要有實際應用中的反射幀的屏幕截圖 圖 顯示了正在播放 Get a Mac 廣告的形狀規則的 Swing 幀( 使用嵌入式 QuickTime 播放器 ) 伴隨著覆蓋桌面的透明的實時反射

圖 QuickTime 電影的反射

該實現重用了來自 Romain 的幾個構造塊并將它們擴展到 楨外 它還有一個重畫管理器 ( 要了解關于重畫管理器方面的詳細信息 請參見 使用重畫管理器的驗證覆蓋 條目 )以便將主楨內容與反射窗口保持同步 還需要在主楨上注冊組件偵聽器和窗口偵聽器以便確保反射窗口與主窗口的可見性 位置和大小保持同步 除此之外 還要有一個自定義窗格將其內容繪畫到脫屏緩沖區 脫屏緩沖區被用于繪畫主楨和在反射窗口內的反射

讓我們看一下代碼 主類是擴展 JFrame 的 JReflectionFrame 構造器創建了反射窗口并向其中添加非雙重緩沖和透明的面板 還重寫了面板的 paintComponent() 以便繪畫主楨內容的反射 在初始化反射楨的位置和大小后 我們安裝了一個自定義重畫管理器

public JReflectionFrame(String title) { super(title) reflection = new JWindow() reflectionPanel = new JPanel() { @Override protected void paintComponent(Graphics g) { // paint the reflection of the main window paintReflection(g) } } // mark the panel as non double buffered and non opaque // to make it translucent reflectionPanel setDoubleBuffered(false) reflectionPanel setOpaque(false) reflection setLayout(new BorderLayout()) reflection add(reflectionPanel BorderLayout CENTER) // register listeners see below …… // initialize the reflection size and location reflection setSize(getSize()) reflection setLocation(getX() getY() + getHeight()) reflection setVisible(true) // install custom repaint manager to force re painting // the reflection when something in the main window is // repainted RepaintManager setCurrentManager(new ReflectionRepaintManager()) }下面是保持反射窗口與主楨同步的偵聽器

this addComponentListener(new ComponentAdapter() { @Override public void ponentHidden(ComponentEvent e) { reflection setVisible(false) } @Override public void ponentMoved(ComponentEvent e) { // update the reflection location reflection setLocation(getX() getY() + getHeight()) } @Override public void ponentResized(ComponentEvent e) { // update the reflection size and location reflection setSize(getWidth() getHeight()) reflection setLocation(getX() getY() + getHeight()) } @Override public void ponentShown(ComponentEvent e) { reflection setVisible(true) // if the reflection window is opaque mark // it as per pixel translucent if ( sun awt AWTUtilities isWindowOpaque(reflection)) { sun awt AWTUtilities setWindowOpaque(reflection false) } } }) this addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { // force showing the reflection window reflection setAlwaysOnTop(true) reflection setAlwaysOnTop(false) } }) 重畫管理器相當簡單 它強制主楨的整個根窗格重畫 然后更新反射窗口 這樣可以最優化更新區域反射的同步 對于示例應用程序要達到的目的 這點就足夠了

private class ReflectionRepaintManager extends RepaintManager { @Override public void addDirtyRegion(JComponent c int x int y int w int h) { Window win = SwingUtilities getWindowAncestor(c) if (win instanceof JReflectionFrame) { // mark the entire root pane to be repainted JRootPane rp = ((JReflectionFrame) win) getRootPane() super addDirtyRegion(rp rp getWidth() rp getHeight()) // workaround bug should call reflection repaint() // but that will not repaint the panel reflectionPanel repaint() } else { super addDirtyRegion(c x y w h) } } }主楨 (脫屏緩沖區) 和反射窗口的繪圖代碼在 Romain 的 反射教程 中進行了詳細描述

lishixin/Article/program/Java/hx/201311/25650

圖片有哪些格式

1、JPEG是最常見的一種圖像格式,應用廣泛,特別是在網絡和光盤讀物上,都能找到它的身影。各類瀏覽器均支持JPEG這種圖像格式,因為JPEG格式的文件尺寸較小,下載速度快。

2、BMP,是一種與硬件設備無關的圖像文件格式,使用非常廣。它采用位映射存儲格式,除了圖像深度可選以外,不采用其他任何壓縮,因此,BMP文件所占用的空間很大。

3、GIF,格式的特點是其在一個GIF文件中可以存多幅彩色圖像,如果把存于一個文件中的多幅圖像數據逐幅讀出并顯示到屏幕上,就可構成一種最簡單的動畫。

4、PSD,這是Photoshop圖像處理軟件的專用文件格式,文件擴展名是.

很赞哦!(19)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片

职业:程序员,设计师

现居:河南信阳固始县

工作室:小组

Email:[email protected]