graphics2d图片旋转后出现黑边

2019-05-08 17:53:38

graphics2d图片旋转后出现黑边,问题找到了

  1. 首先设置背景为透明色


        

res = g2.getDeviceConfiguration().createCompatibleImage(rect_des., rect_des., Transparency.);
        g2.dispose();
        g2 = res.createGraphics();


2.如果是输出图片,一定要输出png格式,这个就不讲了

    

// 生成图片
   ImageIO.write(res, "PNG", os);


  • 2018-01-01 10:50:49

    仿QQ长按弹出功能菜单

    android app普遍常用的弹出上下文菜单是列表式的。QQ列表,在上方弹出冒泡效果菜单,如图