Rectangle imageRect = img.getBounds();
if(type == 0){
gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
x+1, (rect.height-imageRect.height)/2-16, imageRect.width, imageRect.height);
}else if(type == 1){
gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
x+3, (rect.height-imageRect.height)/2-16, imageRect.width, imageRect.height);
}else
gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
x+3, (rect.height-imageRect.height)/2-16, imageRect.width, imageRect.height);
x += imageRect.width + 5;