public void drawComponents(BufferedImage canvas, boolean drawCorner)
    {
        if (_components == null)
            findComponents();
            
        BufferedImage image = new BufferedImage(_width, _height, BufferedImage.TYPE_INT_RGB);
        
        for (int x = 0; x < _width; x++)
        for (int y = 0; y < _height; y++)
            image.setRGB(x, y, 0xffffff);
        
        // draw connected components      
        for (ConnectedComponent cc : _components)
            cc.draw(image, true, drawCorner);
        
        canvas.createGraphics().drawImage(image, 0, 0, null);
    }