#include "ltwrappr.h"
virtual L_INT LBuffer::StartResize(nOldWidth, nOldHeight, nNewWidth, nNewHeight)
L_INT nOldWidth; |
original width of the image |
L_INT nOldHeight; |
original height of the image |
L_INT nNewWidth; |
new width for the image |
L_INT nNewHeight; |
new height for the image |
Sets up information for the LBuffer::Resize function.
Parameter |
Description |
nOldWidth |
The original width of the image. |
nOldHeight |
The original height of the image. |
nNewWidth |
The new width for the image. |
nNewHeight |
The new height for the image. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
Functions: |
|
Topics: |
|
|
L_INT LBuffer__StartResizeExample()
{
L_INT nRet;
LBitmapBase LeadBitmap,TmpBitmap;
LBuffer LeadBuffer;
L_INT nNewHeight;
L_INT nOldHeight;
L_INT nNewWidth;
L_INT nOldWidth;
L_INT i,n,nDestRow ;
L_INT CopyWidth, CopyHeight;
nRet =TmpBitmap.Load (MAKE_IMAGE_PATH(TEXT("image1.cmp"))) ;
if(nRet !=SUCCESS)
return nRet;
nOldHeight = TmpBitmap.GetHeight () ;
nOldWidth = TmpBitmap.GetWidth ();
nNewHeight = nOldHeight * 2;
nNewWidth = nOldWidth * 2;
L_INT nBufferSize = max( TmpBitmap.GetBytesPerLine (), nNewWidth* 3);
nRet =LeadBuffer.Reallocate (nBufferSize);
if(nRet !=SUCCESS)
return nRet;
nRet =LeadBitmap.Create (nNewWidth, nNewHeight,24, TmpBitmap.GetColorOrder (), NULL, TYPE_CONV) ;
if(nRet !=SUCCESS)
return nRet;
// Initialize the resize process
nRet =LeadBuffer.StartResize(nOldWidth,nOldHeight,nNewWidth,nNewHeight);
if(nRet !=SUCCESS)
return nRet;
// Initialize the destination row number
nDestRow = 0;
// Use Resize to process each row in the bitmap
nRet =LeadBitmap.Access ();
if(nRet !=SUCCESS)
return nRet;
nRet =TmpBitmap.Access ();
if(nRet !=SUCCESS)
return nRet;
for(i=0; i < TmpBitmap.GetHeight (); i++)
{
nRet =(L_INT)TmpBitmap.GetRow (&LeadBuffer, i);
if(nRet < 1)
return nRet;
nRet =LeadBuffer.Resize (i, TmpBitmap.GetBitsPerPixel (), &CopyWidth, &CopyHeight);
if(nRet < 1)
return nRet;
// Output as many or as few rows as Resize supplies
for(n=0; n < CopyHeight; n++)
{
nRet =(L_INT)LeadBitmap.PutRow (LeadBuffer, nDestRow);
if(nRet < 1)
return nRet;
nDestRow++;
}
}
nRet =LeadBitmap.Release ();
if(nRet !=SUCCESS)
return nRet;
nRet =TmpBitmap.Release();
if(nRet !=SUCCESS)
return nRet;
// End the resize process
nRet =LeadBuffer.StopResize ();
if(nRet !=SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.