Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
CalculateConvertSize Method
See Also 
Leadtools Namespace > RasterBufferConverter Class : CalculateConvertSize Method




inWidth
Width in pixels of the input image data.
inBitsPerPixel
BitsPerPixel of the input image data.
outWidth
Width in pixels of the desired output image data.
outBitsPerPixel
BitsPerPixel of the desired output image data.
Calculates the size required for output buffer.

Syntax

Visual Basic (Declaration) 
Public Shared Function CalculateConvertSize( _
   ByVal inWidth As Integer, _
   ByVal inBitsPerPixel As Integer, _
   ByVal outWidth As Integer, _
   ByVal outBitsPerPixel As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim inWidth As Integer
Dim inBitsPerPixel As Integer
Dim outWidth As Integer
Dim outBitsPerPixel As Integer
Dim value As Integer
 
value = RasterBufferConverter.CalculateConvertSize(inWidth, inBitsPerPixel, outWidth, outBitsPerPixel)
C# 
public static int CalculateConvertSize( 
   int inWidth,
   int inBitsPerPixel,
   int outWidth,
   int outBitsPerPixel
)
Managed Extensions for C++ 
public: static int CalculateConvertSize( 
   int inWidth,
   int inBitsPerPixel,
   int outWidth,
   int outBitsPerPixel
) 
C++/CLI 
public:
static int CalculateConvertSize( 
   int inWidth,
   int inBitsPerPixel,
   int outWidth,
   int outBitsPerPixel
) 

Parameters

inWidth
Width in pixels of the input image data.
inBitsPerPixel
BitsPerPixel of the input image data.
outWidth
Width in pixels of the desired output image data.
outBitsPerPixel
BitsPerPixel of the desired output image data.

Return Value

The size in bytes of the required output buffer.

Example

This example loads an image at 24 bits per pixel, and creates a new image at 4 bits per pixel, and uses the Convert method to convert data from 24 bits per pixel to 4 bits per pixel.

Remarks

You can use this method to calculate the required size of the output buffer for image data conversions.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also