fn create_empty_bitmap_handle(
        &self,
        width: i32,
        height: i32,
        format: i32,
    ) -> Result<FPDF_BITMAP, PdfiumError> {
        let handle = self.bindings.FPDFBitmap_CreateEx(
            width,
            height,
            format,
            null_mut(),
            0, // Not relevant because Pdfium will create the buffer itself.
        );

        if handle.is_null() {
            if let Some(error) = self.bindings.get_pdfium_last_error() {
                Err(PdfiumError::PdfiumLibraryInternalError(error))
            } else {
                // This would be an unusual situation; a null handle indicating failure,
                // yet Pdfium's error code indicates success.

                Err(PdfiumError::PdfiumLibraryInternalError(
                    PdfiumInternalError::Unknown,
                ))
            }
        } else {
            Ok(handle)
        }
    }
/// Returns a raw FPDF_BITMAP handle to an empty bitmap with the given width and height.
Returns a raw FPDF_BITMAP handle to an empty bitmap with the given width and height.
Returns a raw FPDF_BITMAP handle to an empty bitmap with the given width and height .
fn create_empty_bitmap_handle(
        &self,
        width: i32,
        height: i32,
        format: i32,
    ) -> Result<FPDF_BITMAP, PdfiumError> {
        let handle = self.bindings.FPDFBitmap_CreateEx(
            width,
            height,
            format,
            null_mut(),
            0, // Not relevant because Pdfium will create the buffer itself.
        );
        if handle.is_null() {
            if let Some(error) = self.bindings.get_pdfium_last_error() {
                Err(PdfiumError::PdfiumLibraryInternalError(error))
            } else {
                // This would be an unusual situation; a null handle indicating failure,
                // yet Pdfium's error code indicates success.
                Err(PdfiumError::PdfiumLibraryInternalError(
                    PdfiumInternalError::Unknown,
                ))
            }
        } else {
            Ok(handle)
        }
    }
fn create_empty_bitmap_handle ( & self , width : i32 , height : i32 , format : i32 , ) -> Result < FPDF_BITMAP , PdfiumError > { let handle = self . bindings . FPDFBitmap_CreateEx ( width , height , format , null_mut ( ) , 0 , // Not relevant because Pdfium will create the buffer itself. ) ; if handle . is_null ( ) { if let Some ( error ) = self . bindings . get_pdfium_last_error ( ) { Err ( PdfiumError :: PdfiumLibraryInternalError ( error ) ) } else { // This would be an unusual situation; a null handle indicating failure, // yet Pdfium's error code indicates success. Err ( PdfiumError :: PdfiumLibraryInternalError ( PdfiumInternalError :: Unknown , ) ) } } else { Ok ( handle ) } }
Returns a raw FPDF_BITMAP handle to an empty bitmap with the given width and height.
Returns a raw FPDF_BITMAP handle to an empty bitmap with the given width and height .
&self
width
i32
height
i32
format
i32
&self
width
i32
height
i32
format
i32