LVectorBase::Realize

#include "ltwrappr.h"

virtual L_INT LVectorBase::Realize(pBitmap, bEraseBkgnd=TRUE)

virtual L_INT LVectorBase::Realize(&BitmapBase, bEraseBkgnd=TRUE)

pBITMAPHANDLE pBitmap;

/* pointer to a bitmap handle */

LBitmapBase &BitmapBase;

/* pointer to an LBitmapBase object */

L_BOOL bEraseBkgnd;

/* flag that indicates whether to erase the background */

Draws the specified vector into the specified LEAD bitmap handle.

Parameter

Description

pBitmap

Pointer to a bitmap handle, into which the vector will be drawn.

BitmapBase

Pointer to an LBitmapBase object that references the vector to be drawn into pBitmap.

bEraseBkgnd

Flag that indicates whether or not to erase the background rectangle when realizing the vector to the bitmap. Possible values are:

 

Value

Meaning

 

TRUE

The background rectangle will be erased when the vector image is realized to the bitmap.

 

FALSE

The background rectangle will not be erased.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function draws the specified vector into the specified bitmap handle.

The bitmap handle should be allocated before calling this function.

If hDC is NULL, this function will assume that the vector is already attached to a window, and will draw it to the window DC.

The background color used to erase the rectangle where the vector image is to be rendered can be set with LVectorBase::SetBackgroundColor.

This function will use the current camera and current view port of the vector handle to do the necessary projection onto the surface of the DC.

Note: For the OpenGL engine, the background color will always be used to erase the entire image before drawing, regardless of the view port.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::Paint, LVectorBase::AttachToWindow, LVectorBase::SetCamera, LVectorBase::SetViewport, LVectorBase::SetBackgroundColor

Topics:

Vector Images: Realizing a Vector to a Bitmap

Example

This is an example for LVectorBase::Realize(pBitmap, bEraseBkgnd=TRUE)

//LVectorBase::Realize( pBITMAPHANDLE pBitmap, L_BOOL bEraseBkgnd = TRUE);
//Example21
L_VOID Example21(HWND hWnd)
{
   BITMAPHANDLE bitmapHandle;
   RECT rect;
   LVectorBase Vector;
   
   Vector.Load(TEXT("test.dxf"));
   Vector.AttachToWindow(hWnd);
   
   L_INITBITMAP(&bitmapHandle, sizeof(BITMAPHANDLE), 400,400,24);
   L_ALLOCATEBITMAP(&bitmapHandle, TYPE_CONV);
   GetClientRect(hWnd, &rect);
   Vector.SetViewport(&rect);
   Vector.Realize(&bitmapHandle,TRUE);
   L_SAVEBITMAP(TEXT("d:\\erase.cmp"), &bitmapHandle, FILE_CMP, 24, 2, NULL);
}

 

This is an example for LVectorBase::Realize(&BitmapBase, bEraseBkgnd=TRUE):

//Example22

L_VOID Example22(HWND hWnd)
{
   RECT rect;
   LBitmapBase BitmapBase(400,400,24);
   LVectorBase Vector;
   
   Vector.Load(TEXT("test.dxf"));
   Vector.AttachToWindow(hWnd);
   GetClientRect(hWnd, &rect);
   Vector.SetViewport(&rect);
   Vector.Realize(BitmapBase,TRUE);
   BitmapBase.SetFileName(TEXT("d:\\erase.cmp"));
   BitmapBase.Save(FILE_CMP,24,2);
}