How do you resize a screenshot? (Say, not fullscreen resolution, but half the screen resolution)
Is there a way to antialias the resized screenshot?
How do you resize a screenshot? (Say, not fullscreen resolution, but half the screen resolution)
Is there a way to antialias the resized screenshot?
Source: http://jon-martin.com/?p=114
private Texture2D ScaleTexture(Texture2D source,int targetWidth,int targetHeight) {
Texture2D result=new Texture2D(targetWidth,targetHeight,source.format,true);
Color[] rpixels=result.GetPixels(0);
float incX=((float)1/source.width)*((float)source.width/targetWidth);
float incY=((float)1/source.height)*((float)source.height/targetHeight);
for(int px=0; px<rpixels.Length; px++) {
rpixels[px] = source.GetPixelBilinear(incX*((float)px%targetWidth),
incY*((float)Mathf.Floor(px/targetWidth)));
}
result.SetPixels(rpixels,0);
result.Apply();
return result;
}