日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

java圖片處理類(圖片水印,圖片縮放)(7)_JSP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:jsp switch語句的用法
如果希望選擇執(zhí)行若干代碼塊中的一個(gè),你可以使用switch語句: 語法: switch(n) { case 1: 執(zhí)行代碼塊 1 break case 2: 執(zhí)行代碼塊 2 break default: 如果n即不是1也不是2,則執(zhí)行此代碼 } 工作原理:switch后面的(n)可以是表達(dá)式,也可以(并通常)是變量。然后表達(dá)

    /**
     * 給圖片添加文字水印
     * @param pressText 水印文字
     * @param srcImageFile 源圖像地址
     * @param destImageFile 目標(biāo)圖像地址
     * @param fontName 字體名稱
     * @param fontStyle 字體樣式
     * @param color 字體顏色
     * @param fontSize 字體大小
     * @param x 修正值
     * @param y 修正值
     * @param alpha 透明度:alpha 必須是范圍 [0.0, 1.0] 之內(nèi)(包含邊界值)的一個(gè)浮點(diǎn)數(shù)字
     */
    public final static void pressText2(String pressText, String srcImageFile,String destImageFile,
            String fontName, int fontStyle, Color color, int fontSize, int x,
            int y, float alpha) {
        try {
            File img = new File(srcImageFile);
            Image src = ImageIO.read(img);
            int width = src.getWidth(null);
            int height = src.getHeight(null);
            BufferedImage image = new BufferedImage(width, height,
                    BufferedImage.TYPE_INT_RGB);
            Graphics2D g = image.createGraphics();
            g.drawImage(src, 0, 0, width, height, null);
            g.setColor(color);
            g.setFont(new Font(fontName, fontStyle, fontSize));
            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP,
                    alpha));
            // 在指定坐標(biāo)繪制水印文字
            g.drawString(pressText, (width - (getLength(pressText) * fontSize))
                    / 2 + x, (height - fontSize) / 2 + y);
            g.dispose();
            ImageIO.write((BufferedImage) image, "JPEG", new File(destImageFile));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

分享:jsp if else語句使用方法
if else在大部份編程語言中都是這樣使用的,我們今天來簡單的介紹一下關(guān)于jsp教程 中的if else 與多重條件判斷。 HTML HEAD TITLEUsing the if Statement/TITLE /HEAD BODY H1Using the if Statement/H1 % int value = 10; if(value 0) out.println(Absolute value of

來源:模板無憂//所屬分類:JSP教程/更新時(shí)間:2013-04-17
相關(guān)JSP教程