首页 > 编程知识 正文

手机片分辨辨率,怎么修改片分辩率

时间:2023-05-03 16:50:16 阅读:270982 作者:3822

根据untiy的 Sexpixel 方法   先获取原图的像素点颜色  写入到新的texture2D上   下面示范是将一张1920*1080的图   重写为384+216的图  缩小1/5

public Texture2D t2d;Texture2D texture = new Texture2D(384, 216, TextureFormat.RGBA32, true); for (int i = 0; i < texture.height; i++)//压缩图片 { for (int j = 0; j < texture.width; j++) { Color color = t2d.GetPixel(j * 5, i * 5); texture.SetPixel(j, i, color); } } texture.Apply(); byte[] imagesst = texture.EncodeToJPG();File.WriteAllBytes(filepathsst + "/" + lengthpicCam.ToString() + ".jpg", imagesst);

 

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。