Esempio n. 1
0
 /// <summary>
 /// Creates a new <see cref="PdfiumBitmap"/>. Unmanaged memory is allocated which must
 /// be freed by calling <see cref="Dispose"/>.
 /// </summary>
 /// <param name="width">The width of the new bitmap.</param>
 /// <param name="height">The height of the new bitmap.</param>
 /// <param name="hasAlpha">A value indicating wheter the new bitmap has an alpha channel.</param>
 /// <remarks>
 /// A bitmap created with this overload always uses 4 bytes per pixel.
 /// Depending on <paramref name="hasAlpha"/> the <see cref="Format"/> is then either
 /// <see cref="BitmapFormats.BGRA"/> or <see cref="BitmapFormats.BGRx"/>.
 /// </remarks>
 public PdfiumBitmap(int width, int height, bool hasAlpha, bool forceAlphaChannel = false)
     : this(Pdfium.FPDFBitmap_Create(width, height, hasAlpha))
 {
     _forceAlphaChannel = forceAlphaChannel;
     FillRectangle(0, 0, width, height, 0xFFFFFFFF);
 }