コード例 #1
0
 public static void ResizeToPowerOfTwo(TextureContent texture)
 {
     foreach (MipmapChain chain in texture.Faces)
     {
         for (int i = 0; i < chain.Count; i++)
         {
             BitmapContent source = chain[i];
             int           width  = RoundUpToPowerOfTwo(source.Width);
             int           height = RoundUpToPowerOfTwo(source.Height);
             if ((width != source.Width) || (height != source.Height))
             {
                 chain[i] = ConvertBitmap(source, source.GetType(), width, height);
             }
         }
     }
 }