public void loadImage() { try { File OrignalImage = new File("c:\\images\\2.jpg"); img = ImageIO.read(OrignalImage); } catch (Exception e) { } } public void createBufferedImages() { bufferedimageSrc = new BufferedImage(img.getWidth(this),img.getHeight(this),BufferedImage.TYPE_INT_RGB); bufferedimg = bufferedimageSrc.createGraphics(); bufferedimg.drawImage(img, 0, 0, this); bufferedimageDest = new BufferedImage(bufferedimageSrc.getWidth(this),bufferedimageSrc.getHeight(this),BufferedImage.TYPE_INT_RGB); bufferedimage = bufferedimageSrc; } public void greyimage() { if(gray) { Imgproc.cvtColor(src, dst, Imgproc.COLOR_RGB2GRAY); What I have tried: i used Method to covert the buffered to mat but still its not working the distnation image on the graphics public void update(Graphics g) { g.clearRect(0, 0, getWidth(), getHeight()); paintComponent(g); } public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.drawImage(bufferedimage , 0, 0, this); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)