`
philip01
  • 浏览: 46266 次
  • 来自: ...
社区版块
存档分类
最新评论

图片合并

阅读更多

package com.overseas;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

/**
 * @version 1.0
 * @since 2009-07-02
 * @author springmvc2006@sina.com
 *
 */
public class AggregaPicture {

 private static int alpha = 1000; // 0, 100, 1000, 10000

 private static String pictureType = "png"; // png, jpg

 public static void main(String[] args) throws Exception {

  File workFile = new File("d:/img/work");
  builderPicture(new File(workFile, "1.jpg"), "d:/img/work/", 20, 20);
  transferSize(workFile, 600, 600); // 要转的图片路径
  AggregaPicture aggregaPicture = new AggregaPicture();
  File temp = new File(workFile.getParent() + "/temp"); // 临时文件


  aggregaPicture.task(new File("d:/img/aggregaPictureFileName20@20."
    + pictureType), temp, 20, 20);
/*  aggregaPicture.task(new File("d:/img/aggregaPictureFileName3@3."
    + pictureType), temp, 3, 3);
  aggregaPicture.task(new File("d:/img/aggregaPictureFileName9@1."
    + pictureType), temp, 9, 1);
  aggregaPicture.task(new File("d:/img/aggregaPictureFileName4@2."
    + pictureType), temp, 4, 2);
  aggregaPicture.task(new File("d:/img/aggregaPictureFileName3@2."
    + pictureType), temp, 3, 2);
  aggregaPicture.deleteImage(temp);*/

 }

 public static void builderPicture(File file, String newPath, int colNum, int rowNum) {
  for(int i=0; i<colNum*rowNum; i++){
   copy(file, newPath+i+"."+pictureType);
  }
 }

 /**
  * @param width
  * @param height
  */
 public void task(File aggregaPictureFileName, File file, int rowNum,
   int colNum) throws Exception {
  if (!file.exists()) {
   throw new FileNotFoundException();
  }

  File[] files = file.listFiles();

  if (files.length < rowNum * colNum) {
   throw new ArrayIndexOutOfBoundsException();
  }

  ImageIcon rowResultImage = null;
  ImageIcon resultImage = null;
  String imageOneName = null;
  String imageTwoName = null;

  if (colNum > 1) {
   rowResultImage = mergeRow(files, 1, colNum);
   resultImage = rowResultImage;
   for (int i = 2; (i <= rowNum) && (colNum > 1); i++) {
    rowResultImage = mergeRow(files, i, colNum);
    resultImage = mergeCol(resultImage, rowResultImage);
   }
  } else if (colNum == 1) {
   ImageIcon imageIconOne = null;
   ImageIcon imageIconTwo = null;
   imageOneName = files[0].getAbsolutePath();
   imageTwoName = files[1].getAbsolutePath();
   imageIconOne = new ImageIcon(imageOneName);
   imageIconTwo = new ImageIcon(imageTwoName);

   rowResultImage = mergeVertical(imageIconOne, imageIconTwo);
   resultImage = rowResultImage;
   for (int i = 2; i < rowNum; i++) {
    System.out.println("col =" + files[i].getAbsolutePath());
    rowResultImage = new ImageIcon(files[i].getAbsolutePath());
    resultImage = mergeCol(resultImage, rowResultImage);
   }
  }

  saveAggregaPictureFile(resultImage, aggregaPictureFileName);
 }

 public ImageIcon mergeRow(File[] files, int rowNum, int colNum)
   throws Exception {

  ImageIcon imageIconOne = null;
  ImageIcon imageIconTwo = null;
  ImageIcon rowResultImage = null;

  String imageOneName = null;
  String imageTwoName = null;

  imageOneName = files[colNum * (rowNum - 1)].getAbsolutePath();

  System.out.println("rowNum " + rowNum);
  System.out.println(imageOneName);
  imageTwoName = files[colNum * (rowNum - 1) + 1].getAbsolutePath();
  System.out.println(imageTwoName);

  imageIconOne = new ImageIcon(imageOneName);
  imageIconTwo = new ImageIcon(imageTwoName);

  rowResultImage = mergeHorizontal(imageIconOne, imageIconTwo);

  for (int i = 2; i < colNum; i++) {
   imageOneName = files[colNum * (rowNum - 1) + i].getAbsolutePath();
   System.out.println(imageOneName);
   imageIconOne = new ImageIcon(imageOneName);
   rowResultImage = mergeHorizontal(rowResultImage, imageIconOne);
  }

  return rowResultImage;

 }

 public ImageIcon mergeCol(ImageIcon imageOne, ImageIcon imageTwo)
   throws Exception {
  return mergeVertical(imageOne, imageTwo);
 }

 public ImageIcon mergeHorizontal(ImageIcon imageOne, ImageIcon imageTwo)
   throws Exception {
  ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

  BufferedImage bufferedImage = setAlpha(imageOne);
  int widthOne = bufferedImage.getWidth();
  int heightOne = bufferedImage.getHeight();
  int[] imageArrayOne = new int[widthOne * heightOne];
  imageArrayOne = bufferedImage.getRGB(0, 0, widthOne, heightOne,
    imageArrayOne, 0, widthOne);

  BufferedImage bufferedImageTwo = setAlpha(imageTwo);
  int widthTwo = bufferedImageTwo.getWidth();
  int heightTwo = bufferedImageTwo.getHeight();
  int[] imageArrayTwo = new int[widthTwo * heightTwo];
  imageArrayTwo = bufferedImageTwo.getRGB(0, 0, widthTwo, heightTwo,
    imageArrayTwo, 0, widthTwo);

  // int smallHeightSize = heightOne > heightTwo ? heightTwo : heightOne;

  // 生成新图片
  BufferedImage imageNew = new BufferedImage(widthOne + widthTwo,
    heightOne, BufferedImage.TYPE_INT_RGB);
  imageNew.setRGB(0, 0, widthOne, heightOne, imageArrayOne, 0, widthOne);// 设置左半部分的RGB
  imageNew.setRGB(widthOne, 0, widthTwo, heightTwo, imageArrayTwo, 0,
    widthTwo);
  ImageIO.write(imageNew, pictureType, byteArrayOutputStream);// 写图片

  File file = new File("d:/img/mergeHorizontal");
  if (!file.exists()) {
   file.mkdirs();
  }
  ImageIO.write(imageNew, pictureType, new File("d:/img/mergeHorizontal/"
    + getSystemDate() + "." + pictureType));

  ImageIcon tempIcon = new ImageIcon(byteArrayOutputStream.toByteArray());
  return tempIcon;
 }

 public ImageIcon mergeVertical(ImageIcon imageOne, ImageIcon imageTwo)
   throws Exception {
  ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

  BufferedImage bufferedImage = setAlpha(imageOne);
  int widthOne = bufferedImage.getWidth();
  int heightOne = bufferedImage.getHeight();


  BufferedImage bufferedImageTwo = setAlpha(imageTwo);
  int widthTwo = bufferedImageTwo.getWidth();
  int heightTwo = bufferedImageTwo.getHeight();
  int[] imageArrayTwo = new int[widthTwo * heightTwo];
  

  // 生成新图片
  BufferedImage imageNew = new BufferedImage(widthOne, heightOne
    + heightTwo, BufferedImage.TYPE_INT_RGB);
  
  
  imageArrayTwo = bufferedImageTwo.getRGB(0, 0, widthTwo, heightTwo,
    imageArrayTwo, 0, widthTwo);
  imageNew.setRGB(0, heightOne, widthTwo, heightTwo, imageArrayTwo, 0,
    widthTwo);
  imageArrayTwo = null;
  bufferedImageTwo = null;
  
  
  int[] imageArrayOne = new int[widthOne * heightOne];
  imageArrayOne = bufferedImage.getRGB(0, 0, widthOne, heightOne,
    imageArrayOne, 0, widthOne);
  imageNew.setRGB(0, 0, widthOne, heightOne, imageArrayOne, 0, widthOne);
  imageArrayOne = null;
  bufferedImage = null;


  // imageNew.setRGB(width,0,width,height,imageArrayTwo,0,width);

  ImageIO.write(imageNew, pictureType, byteArrayOutputStream);// 写图片

  File file = new File("d:/img/mergeVertical");
  if (!file.exists()) {
   file.mkdirs();
  }
  ImageIO.write(imageNew, pictureType, new File("d:/img/mergeVertical/"
    + getSystemDate() + "." + pictureType));
  ImageIcon tempIcon = new ImageIcon(byteArrayOutputStream.toByteArray());
  return tempIcon;
 }

 private BufferedImage setAlpha(ImageIcon imageIcon) {
  BufferedImage bufferedImage = new BufferedImage(imageIcon
    .getIconWidth(), imageIcon.getIconHeight(),
    BufferedImage.TYPE_4BYTE_ABGR);
  try {

   Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
   g2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon
     .getImageObserver());
   // int alpha = 100;
   for (int j1 = bufferedImage.getMinY(); j1 < bufferedImage
     .getHeight(); j1++) {
    for (int j2 = bufferedImage.getMinX(); j2 < bufferedImage
      .getWidth(); j2++) {
     int rgb = bufferedImage.getRGB(j2, j1);
     int R = (rgb & 0xff0000) >> 16;
     int G = (rgb & 0xff00) >> 8;
     int B = (rgb & 0xff);

     rgb = ((alpha + 1) << 24) | (rgb & 0x00ffffff);

     bufferedImage.setRGB(j2, j1, rgb);
    }
   }
   g2D.dispose();
  } catch (Exception e) {
   e.printStackTrace();
  }

  return bufferedImage;

 }

 public void saveAggregaPictureFile(ImageIcon imageIcon,
   File aggregaPictureFileName) throws Exception {
  BufferedImage bufferedImage = new BufferedImage(imageIcon
    .getIconWidth(), imageIcon.getIconHeight(),
    BufferedImage.TYPE_4BYTE_ABGR);
  Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
  g2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon.getImageObserver());
  // 循环每一个像素点,改变像素点的Alpha值
  // int alpha = 100;
  for (int j1 = bufferedImage.getMinY(); j1 < bufferedImage.getHeight(); j1++) {
   for (int j2 = bufferedImage.getMinX(); j2 < bufferedImage
     .getWidth(); j2++) {
    int rgb = bufferedImage.getRGB(j2, j1);
    int R = (rgb & 0xff0000) >> 16;
    int G = (rgb & 0xff00) >> 8;
    int B = (rgb & 0xff);

    //rgb = ((alpha + 1) << 24) | (rgb & 0x00ffffff);

    bufferedImage.setRGB(j2, j1, rgb);

   }
  }
  g2D.drawImage(bufferedImage, 0, 0, imageIcon.getImageObserver());

  // 生成图片为PNG

  ImageIO.write(bufferedImage, pictureType, aggregaPictureFileName);
  g2D.dispose();
 }

 public static void transferSize(File imgDir, int width, int heigth)
   throws Exception {
  if (!imgDir.exists()) {
   throw new FileNotFoundException();
  }

  String tempDir = imgDir.getParent() + "/temp/";
  File file = new File(tempDir);
  if (!file.exists()) {
   file.mkdirs();
  }

  File[] imgFiles = imgDir.listFiles();

  for (int i = 0; i < imgFiles.length; i++) {
   if (imgFiles[i].isFile()) {
    ScaleImage is = new ScaleImage();
    try {
     System.out.println(imgFiles[i].getAbsolutePath());
     is.saveImageAsJpg(imgFiles[i].getAbsolutePath(), tempDir
       + imgFiles[i].getName(), width, heigth);
    } catch (Exception e) {
     e.printStackTrace();
    }

   }
  }
 }

 public static void copy(String oldPath, String newPath) {
  File oldfile = new File(oldPath);
  copy(oldfile, newPath);
 }

 public static void copy(File oldfile, String newPath) {
  InputStream inStream = null;
  FileOutputStream fs = null;
  try {
   int bytesum = 0;
   int byteread = 0;
   if (oldfile.exists()) {
    inStream = new FileInputStream(oldfile);
    fs = new FileOutputStream(newPath);
    byte[] buffer = new byte[1024];
    while ((byteread = inStream.read(buffer)) != -1) {
     bytesum += byteread;
     fs.write(buffer, 0, byteread);
    }
    inStream.close();
    fs.close();
   }
  } catch (Exception e) {
   System.out.println("error  ");
   e.printStackTrace();
  }finally{
   if(inStream != null){
    try {
     inStream.close();
     inStream = null;
    } catch (IOException e) {
     e.printStackTrace();
    }
   }
   
   if(fs != null){
    try {
     fs.close();
     fs = null;
    } catch (IOException e) {
     e.printStackTrace();
    }
   }
  }
 }

 public void deleteImage(File temp) {
  if (temp.exists()) {

   File[] tempImages = temp.listFiles();
   for (int i = 0; i < tempImages.length; i++) {
    tempImages[i].delete();
   }
  }

 }

 public static String getSystemDate() {
  Calendar cal = Calendar.getInstance();
  SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
  String mDateTime = formatter.format(cal.getTime());
  return mDateTime;
 }

}

 

package com.overseas;

import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;

/**
 * springmvc2006@sina.com
 *
 */
public class ScaleImage {
 
 
 private int width;  
  
    private int height;  
 
    private int scaleWidth;  
 
    double support = (double) 3.0;  
 
    double PI = (double) 3.14159265358978;  
 
    double[] contrib;  
 
    double[] normContrib;  
 
    double[] tmpContrib;  
 
    int startContrib, stopContrib;  
 
    int nDots;  
 
    int nHalfDots;  
 

    public static void main(String[] args) {  
        ScaleImage is = new ScaleImage();  
        try {  
            is.saveImageAsJpg("d:/img/temp/3.jpg", "d:/img/temp/3.bak.jpg", 200, 200);  
        } catch (Exception e) {  
            // TODO Auto-generated catch block  
            e.printStackTrace();  
        }  
    }  
 
    // fromFileStr原图片地址,saveToFileStr生成缩略图地址,formatWideth生成图片宽度,formatHeight高度  
    public void saveImageAsJpg(String fromFileStr, String saveToFileStr,  
            int formatWideth, int formatHeight) throws Exception {  
        BufferedImage srcImage;  
        File saveFile = new File(saveToFileStr);  
        File fromFile = new File(fromFileStr);  
        srcImage = javax.imageio.ImageIO.read(fromFile); // construct image  
        int imageWideth = srcImage.getWidth(null);  
        int imageHeight = srcImage.getHeight(null);  
        int changeToWideth = 0;  
        int changeToHeight = 0;  
        if (imageWideth > 0 && imageHeight > 0) {  
            // flag=true;  
            if (imageWideth / imageHeight >= formatWideth / formatHeight) {  
                if (imageWideth > formatWideth) {  
                    changeToWideth = formatWideth;  
                    changeToHeight = (imageHeight * formatWideth) / imageWideth;  
                } else {  
                    changeToWideth = imageWideth;  
                    changeToHeight = imageHeight;  
                }  
            } else {  
                if (imageHeight > formatHeight) {  
                    changeToHeight = formatHeight;  
                    changeToWideth = (imageWideth * formatHeight) / imageHeight;  
                } else {  
                    changeToWideth = imageWideth;  
                    changeToHeight = imageHeight;  
                }  
            }  
        }  
 
        srcImage = imageZoomOut(srcImage, changeToWideth, changeToHeight);  
        ImageIO.write(srcImage, "JPEG", saveFile);  
    }  
 
    public BufferedImage imageZoomOut(BufferedImage srcBufferImage, int w, int h) {  
        width = srcBufferImage.getWidth();  
        height = srcBufferImage.getHeight();  
        scaleWidth = w;  
 
        if (DetermineResultSize(w, h) == 1) {  
            return srcBufferImage;  
        }  
        CalContrib();  
        BufferedImage pbOut = HorizontalFiltering(srcBufferImage, w);  
        BufferedImage pbFinalOut = VerticalFiltering(pbOut, h);  
        return pbFinalOut;  
    }  
 
    /** *//** 
     * 决定图像尺寸 
     */ 
    private int DetermineResultSize(int w, int h) {  
        double scaleH, scaleV;  
        scaleH = (double) w / (double) width;  
        scaleV = (double) h / (double) height;  
        // 需要判断一下scaleH,scaleV,不做放大操作  
        if (scaleH >= 1.0 && scaleV >= 1.0) {  
            return 1;  
        }  
        return 0;  
 
    } // end of DetermineResultSize()  
 
    private double Lanczos(int i, int inWidth, int outWidth, double Support) {  
        double x;  
 
        x = (double) i * (double) outWidth / (double) inWidth;  
 
        return Math.sin(x * PI) / (x * PI) * Math.sin(x * PI / Support)  
                / (x * PI / Support);  
 
    }  
 
    private void CalContrib() {  
        nHalfDots = (int) ((double) width * support / (double) scaleWidth);  
        nDots = nHalfDots * 2 + 1;  
        try {  
            contrib = new double[nDots];  
            normContrib = new double[nDots];  
            tmpContrib = new double[nDots];  
        } catch (Exception e) {  
            System.out.println("init   contrib,normContrib,tmpContrib" + e);  
        }  
 
        int center = nHalfDots;  
        contrib[center] = 1.0;  
 
        double weight = 0.0;  
        int i = 0;  
        for (i = 1; i <= center; i++) {  
            contrib[center + i] = Lanczos(i, width, scaleWidth, support);  
            weight += contrib[center + i];  
        }  
 
        for (i = center - 1; i >= 0; i--) {  
            contrib[i] = contrib[center * 2 - i];  
        }  
 
        weight = weight * 2 + 1.0;  
 
        for (i = 0; i <= center; i++) {  
            normContrib[i] = contrib[i] / weight;  
        }  
 
        for (i = center + 1; i < nDots; i++) {  
            normContrib[i] = normContrib[center * 2 - i];  
        }  
    } // end of CalContrib()  
 
    // 处理边缘  
    private void CalTempContrib(int start, int stop) {  
        double weight = 0;  
 
        int i = 0;  
        for (i = start; i <= stop; i++) {  
            weight += contrib[i];  
        }  
 
        for (i = start; i <= stop; i++) {  
            tmpContrib[i] = contrib[i] / weight;  
        }  
 
    } // end of CalTempContrib()  
 
    private int GetRedValue(int rgbValue) {  
        int temp = rgbValue & 0x00ff0000;  
        return temp >> 16;  
    }  
 
    private int GetGreenValue(int rgbValue) {  
        int temp = rgbValue & 0x0000ff00;  
        return temp >> 8;  
    }  
 
    private int GetBlueValue(int rgbValue) {  
        return rgbValue & 0x000000ff;  
    }  
 
    private int ComRGB(int redValue, int greenValue, int blueValue) {  
 
        return (redValue << 16) + (greenValue << 8) + blueValue;  
    }  
 
    // 行水平滤波  
    private int HorizontalFilter(BufferedImage bufImg, int startX, int stopX,  
            int start, int stop, int y, double[] pContrib) {  
        double valueRed = 0.0;  
        double valueGreen = 0.0;  
        double valueBlue = 0.0;  
        int valueRGB = 0;  
        int i, j;  
 
        for (i = startX, j = start; i <= stopX; i++, j++) {  
            valueRGB = bufImg.getRGB(i, y);  
 
            valueRed += GetRedValue(valueRGB) * pContrib[j];  
            valueGreen += GetGreenValue(valueRGB) * pContrib[j];  
            valueBlue += GetBlueValue(valueRGB) * pContrib[j];  
        }  
 
        valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),  
                Clip((int) valueBlue));  
        return valueRGB;  
 
    } // end of HorizontalFilter()  
 
    // 图片水平滤波  
    private BufferedImage HorizontalFiltering(BufferedImage bufImage, int iOutW) {  
        int dwInW = bufImage.getWidth();  
        int dwInH = bufImage.getHeight();  
        int value = 0;  
        BufferedImage pbOut = new BufferedImage(iOutW, dwInH,  
                BufferedImage.TYPE_INT_RGB);  
 
        for (int x = 0; x < iOutW; x++) {  
 
            int startX;  
            int start;  
            int X = (int) (((double) x) * ((double) dwInW) / ((double) iOutW) + 0.5);  
            int y = 0;  
 
            startX = X - nHalfDots;  
            if (startX < 0) {  
                startX = 0;  
                start = nHalfDots - X;  
            } else {  
                start = 0;  
            }  
 
            int stop;  
            int stopX = X + nHalfDots;  
            if (stopX > (dwInW - 1)) {  
                stopX = dwInW - 1;  
                stop = nHalfDots + (dwInW - 1 - X);  
            } else {  
                stop = nHalfDots * 2;  
            }  
 
            if (start > 0 || stop < nDots - 1) {  
                CalTempContrib(start, stop);  
                for (y = 0; y < dwInH; y++) {  
                    value = HorizontalFilter(bufImage, startX, stopX, start,  
                            stop, y, tmpContrib);  
                    pbOut.setRGB(x, y, value);  
                }  
            } else {  
                for (y = 0; y < dwInH; y++) {  
                    value = HorizontalFilter(bufImage, startX, stopX, start,  
                            stop, y, normContrib);  
                    pbOut.setRGB(x, y, value);  
                }  
            }  
        }  
 
        return pbOut;  
 
    } // end of HorizontalFiltering()  
 
    private int VerticalFilter(BufferedImage pbInImage, int startY, int stopY,  
            int start, int stop, int x, double[] pContrib) {  
        double valueRed = 0.0;  
        double valueGreen = 0.0;  
        double valueBlue = 0.0;  
        int valueRGB = 0;  
        int i, j;  
 
        for (i = startY, j = start; i <= stopY; i++, j++) {  
            valueRGB = pbInImage.getRGB(x, i);  
 
            valueRed += GetRedValue(valueRGB) * pContrib[j];  
            valueGreen += GetGreenValue(valueRGB) * pContrib[j];  
            valueBlue += GetBlueValue(valueRGB) * pContrib[j];  
            // System.out.println(valueRed+"->"+Clip((int)valueRed)+"<-");  
            //     
            // System.out.println(valueGreen+"->"+Clip((int)valueGreen)+"<-");  
            // System.out.println(valueBlue+"->"+Clip((int)valueBlue)+"<-"+"-->");  
        }  
 
        valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),  
                Clip((int) valueBlue));  
        // System.out.println(valueRGB);  
        return valueRGB;  
 
    } // end of VerticalFilter()  
 
    private BufferedImage VerticalFiltering(BufferedImage pbImage, int iOutH) {  
        int iW = pbImage.getWidth();  
        int iH = pbImage.getHeight();  
        int value = 0;  
        BufferedImage pbOut = new BufferedImage(iW, iOutH,  
                BufferedImage.TYPE_INT_RGB);  
 
        for (int y = 0; y < iOutH; y++) {  
 
            int startY;  
            int start;  
            int Y = (int) (((double) y) * ((double) iH) / ((double) iOutH) + 0.5);  
 
            startY = Y - nHalfDots;  
            if (startY < 0) {  
                startY = 0;  
                start = nHalfDots - Y;  
            } else {  
                start = 0;  
            }  
 
            int stop;  
            int stopY = Y + nHalfDots;  
            if (stopY > (int) (iH - 1)) {  
                stopY = iH - 1;  
                stop = nHalfDots + (iH - 1 - Y);  
            } else {  
                stop = nHalfDots * 2;  
            }  
 
            if (start > 0 || stop < nDots - 1) {  
                CalTempContrib(start, stop);  
                for (int x = 0; x < iW; x++) {  
                    value = VerticalFilter(pbImage, startY, stopY, start, stop,  
                            x, tmpContrib);  
                    pbOut.setRGB(x, y, value);  
                }  
            } else {  
                for (int x = 0; x < iW; x++) {  
                    value = VerticalFilter(pbImage, startY, stopY, start, stop,  
                            x, normContrib);  
                    pbOut.setRGB(x, y, value);  
                }  
            }  
 
        }  
 
        return pbOut;  
 
    } // end of VerticalFiltering()  
 
    int Clip(int x) {  
        if (x < 0)  
            return 0;  
        if (x > 255)  
            return 255;  
        return x;  
    }  

 

分享到:
评论

相关推荐

    批量图片合并器完美版

    图片合并器 完美版 如遇到运行错误,请 安装 Microsoft .NET Framework 2.0 Microsoft .NET Framework 2.0 下载地址: http://www.skycn.com/soft/43774.html 本软件可以进行批量合并图片的工作,没有功能限制...

    图片合并转换为PDF文件

    由于工作中有同事需要把多张图片合并为一个PDF文件,在网上下载的软件或者要收费或者有病毒,因此空闲时间用C#写了一个小工具合并图片为PDF文件。 采用比较便于普通用户开箱即用的.NET 2.0框架(windows7自带),...

    [C#、WinForm、.Net] 多个图片合并,Image 合并

    [C#、WinForm、.Net] 多个图片合并,Image 合并,详情见文件内容

    易语言图片合并 拼接工具.exe

    图片合并工具 图片拼接工具 将图片上下拼接或者将图片左右拼接导出 软件由易语言开发 方便日常图片处理

    PHP多张图片合并成一张图片合并成九宫格图片.zip

    PHP多张图片合并成一张图片合并成,也可以合并九宫格图片,附带图片,效果图片可以自行运行PHP文件即可生成

    霄鹞图片合并转PDF助手 v3.3.zip

    霄鹞图片合并转PDF助手是由霄鹞软件工作室开发的一款专门将大量图片文件合并输出到一个PDF文件中的应用软件。该软件界面简洁、易用,合并转换速度快,运行稳定,特别适合将扫描的书籍图片文件制作成PDF格式的电子书...

    UTCOOL(图片合并工具)V1.0中文绿色版

    图片合并工具(UTCOOL)是一款轻巧、绿色,完全免费的图片合并工具,它支持把5张图片合并,并且可以保存到电脑中的任意位置。还可以自定义图片宽度和间隔。 图片合并工具使用方法:首先复制一张图片(网页上的也可以...

    KingPictureMerge(图片合并工具)V3.0.0免费绿色版

    King Picture Merge是一款支持批量操作的图片合并工具,可以快速将文件夹中的图片,按照指定的数量、合并方式、保存类型等进行拼接合并,合并后的图片大小统一,有需要的用户赶紧来下载吧! 【软件功能】 1、绿色...

    Java将图片合并为视频

    Java将图片合并为视频的项目文件 下载依赖包是会比较慢,请在网络好的环境下载 依赖包下载好后,直接编译即可运行

    c#图片合并器

    可将任意文件打成压缩包后与任意图片合并,双击显示图片,改后缀后变成压缩包

    用java把2个tiff或图片合并成一个tiff或图片

    java写的读取2个tiff文件或图片,合并成一个图片 可以修改图片所在位置

    小巧的图片合并工具

    小巧的图片合并工具,图片合成软件用于拼合多张图片成一张,支持水平拼合,垂直拼合,多行拼合三种组合方式。rn当图片大小不一致时,采用最大的图片的大小作合并标准。图片合成软件绿色免费,方便大家使用。

    C#实现的全景图拼接(两张图片合并成一张图片源程序)

    C#实现的全景图拼接(两张图片合并成一张图片源程序) 这个一个图形学处理中的全景图拼接程序,用的是C#写的,使用vs2005

    C#多张图片合并成一张

    多张图片垂直合并成1张图片,使用VS2013开发

    批量图片合并工具(C#源代码)

    批量图片合并(拼接)C# 源码下载 使用工具:Microsoft Visual Studio 2010

    将多个png图片合并成一个png图片

    通过快速轮动播放来实现,少则几帧,多则几十帧,为了方便管理图片和减少图片文件总的大小,往往需要把这些帧的图像合并到一个文件中-----即把N个大小和格式完全相同的png图片排列合并为一个大的png图片。

    图片合并器 0.0.5.rar

    本软件可以进行批量合并图片的工作,没有功能限制,完全免费,只有【图片合并器.exe】 【Interop.Scripting.dll】2个文件,绝对绿色,如发现有其他文件,请小心。

    图片合并器

    图片合并器

    多张图片合并

    多张图片完美合并 图片路径数量任意配置 完美解决坐标越界错误!

    图片合并工具

    图片合并工具,可以横向合并图片也可以纵向合并图片。操作简单,直接拖拽需要合并的图片进工具里。

Global site tag (gtag.js) - Google Analytics