No, it is not correct. You are drawing the empty image contents onto itself, 
which is why you are getting a black rectangle. What you need to is draw the 
header into the buffered image. You also need to clip and translate the 
graphics context before you draw the header so you get the right cell.

On Sep 30, 2011, at 8:51 AM, prophe wrote:

> I do:
> 
>       @Override
>       public Visual getRepresentation() {
> 
>                       Bounds headerBounds = getHeaderBounds(selectedIndex);
>                       BufferedImage bImg = new 
> BufferedImage(headerBounds.width,
> headerBounds.height, BufferedImage.TYPE_INT_RGB);
>               
>                       Graphics2D graphics =  bImg.createGraphics();
>                       paint(graphics);
>                       
>                       graphics.drawImage(bImg, 0, 0, null); 
>       
>                       Picture picture = new Picture(bImg); 
> 
>               
>               return picture;
>       }
> Can you tell me is my code right or  wrong?
> 
> But always have an error while I try to slide column header:
> 
> 
> 
> 
> -----
> Thank you!
> --
> View this message in context: 
> http://apache-pivot-users.399431.n3.nabble.com/Replace-column-in-table-view-tp3375080p3382269.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply via email to