Exemple #1
0
 /// <summary>
 /// Creates of blank template with the dimensions of the this <see cref="Image"/> and specified bit depth.
 /// </summary>
 /// <param name="dst">The destination <see cref="Image"/>. Can be <b>null</b>.</param>
 /// <param name="width">The destination <see cref="Image"/> width, in pixels.</param>
 /// <param name="height">The destination <see cref="Image"/> height, in pixels.</param>
 /// <param name="bitsPerPixel">The destination <see cref="Image"/> color depth, in number of bits per pixel.</param>
 /// <returns>
 /// The destination <see cref="Image"/>.
 /// </returns>
 /// <remarks>
 /// <para>If <paramref name="dst"/> is <b>null</b> the method creates new destination <see cref="Image"/> with specified dimensions.</para>
 /// <para>Conversely, the <paramref name="dst"/> is reallocated to the specified dimensions.</para>
 /// </remarks>
 public Image CreateTemplate(Image dst, int width, int height, int bitsPerPixel)
 {
     if (dst == null || dst == this)
     {
         return(new Image(width, height, bitsPerPixel, this));
     }
     else
     {
         dst.Reallocate(width, height, bitsPerPixel, this.HorizontalResolution, this.VerticalResolution, this.Transform);
         return(dst);
     }
 }