Introduction

The LEADTOOLS DigitalPaint Class Library provides dynamic link library (DLL) functions to let you incorporate DigitalPaint capabilities into your Windows applications. The DigitalPaint features are available in the Raster Pro and above toolkits.

The DigitalPaint tools provide the functions necessary for to write a painting program or any painting related application.

The painting output can be painted to a device context (DC), a bitmap, or both. In addition, there LEADTOOLS DigitalPaint provides the option of color restriction, using an optional restriction palette.

The DigitalPaint tools consist of five groups that represent five different paint abilities. Each of these "groups" has group specific functions. These groups are:

Paintbrush group.

Shape group.

Region group.

Fill group.

Text group.

Every group has its own features that will enable the user to manipulate the results of that group.

Paintbrush group

The LEADTOOLS DigitalPaint paintbrush has most of the features found in any artistic painting program. The resulting paintbrush will be translated and scaled automatically for the device context and/or the bitmap, using user-defined transformation settings.

Shape group

The LEADTOOLS DigitalPaint shape group removes some of the Windows Class Library programming when drawing shapes. In addition, shapes may be painted with varying degrees of opacity, or with a paper texture, or with a gradient background, etc. The resulting shapes will be translated and scaled automatically for the device context and/or the bitmap, using user-defined transformation settings.

The following shapes can be drawn: Line, Rectangle, Rounded rectangle, Ellipse, Polygon, Polybezier.

Region group

The region group has the ability to create regions ranging from simple to very complex (many of them are not supported by Windows). The DigitalPaint toolkit also includes the ability to scale a region, which is not supported directly by Windows. The resulting regions will be translated and scaled automatically for the device context (DC) and/or the bitmap, using user-defined transformation settings.

The following shapes can be used to create regions: Rectangle, Rounded rectangle, Ellipse and Polygon.

The following fill methods can be used to create regions: Surface, Border and Color Replacement.

Fill group

LEADTOOLS DigitalPaint gives the user the most complete area filling solutions in both the method of filling and the features of filling. The resulting filled area will be translated and scaled automatically for the device context (DC) and/or the bitmap, using user-defined transformation settings. The fill group supports the following filling methods: Surface, Border and Color replace.

Surface fill method

Fills an area, starting at a specified point and continuing in all directions, that contains a specified color. A tolerance range can also be set to accept colors very close in value to the specified color.

Border fill method

Fills an area, starting at a specified point and continuing in all directions until finding a specified color. A tolerance range can also be set to stop filling when colors very close in value to the specified color are found.

Color replace

Replaces every pixel using the current fill settings.

Text group

This group includes comprehensive text drawing features that can be found in any painting program. The resulting text will be translated and scaled automatically for the device context (DC) and/or the bitmap, using user-defined transformation settings.

The toolkit comes in WIN32 editions so that it can support development of software applications for any of the following environments:

Windows 4.x NT
Windows 95
Windows 98
Windows 2000


Example Programs

The following example programs are in separate EXAMPLES subdirectories (such as C:\LEAD14\EXAMPLES\DLL\PAINT). The executable files for these examples were compiled with Document/Medical capabilities. To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical toolkit. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical capabilities.

Note:

You can run the example programs on your system by clicking the appropriate buttons in online help. If you try to run an example program that is not on your system, an error message will appear.

CLRST DEMO

CLRST DEMO uses pull-down menus to demonstrate most of the LEADTOOLS DigitalPaint features in one application. This program was compiled using a Microsoft compiler.


Version History

Current version: | 14.5
Last update: | October 26, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Version 12.1


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS DigitalPaint Tools Class Library has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS DigitalPaint Tools Class Library has changed from Version 13 as follows:

LEADTOOLS DigitalPaint Tools Class Library now supports UNICODE.


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS DigitalPaint Tools Class Library has not changed from Version 12.1.


Version 12.1

This is the first version of the LEADTOOLS DigitalPaint Tools Class Library. The rest of this topic lists the new functions:

Low-Level DigitalPaint Functions

LRasterPaint::ApplyText

LRasterPaint::BrushLineTo

LRasterPaint::BrushMoveTo

LRasterPaint::DrawShapeEllipse

LRasterPaint::DrawShapeLine

LRasterPaint::DrawShapePolyBezier

LRasterPaint::DrawShapePolygon

LRasterPaint::DrawShapeRectangle

LRasterPaint::DrawShapeRoundRect

LRasterPaint::FillBorder

LRasterPaint::FillColorReplace

LRasterPaint::FillSurface

LRasterPaint::Free

LRasterPaint::GetClipRgn

LRasterPaint::GetDCExtents

LRasterPaint::GetProperty

LRasterPaint::GetTransformation

LRasterPaint::Initialize

LRasterPaint::IsValid

LRasterPaint::OffsetClipRgn

LRasterPaint::PickColor

LRasterPaint::LRasterPaint

LRasterPaint::~LRasterPaint

LRasterPaint::RegionBorder

LRasterPaint::RegionColor

LRasterPaint::RegionEllipse

LRasterPaint::RegionPolygon

LRasterPaint::RegionRect

LRasterPaint::RegionRoundRect

LRasterPaint::RegionScale

LRasterPaint::RegionSurface

LRasterPaint::RegionTranslate

LRasterPaint::SetClipRgn

LRasterPaint::SetDCExtents

LRasterPaint::SetMetrics

LRasterPaint::SetProperty

LRasterPaint::SetTransformation

Common Dialogs Functions

LRasterDialog::DoModalBrush

LRasterDialog::DoModalFill

LRasterDialog::DoModalRegion

LRasterDialog::DoModalShape

LRasterDialog::DoModalText

PaintWindow Functions

LRasterPaintWindow::LRasterPaintWindow

LRasterPaintWindow::~LRasterPaintWindow

LRasterPaintWindow::CanRedo

LRasterPaintWindow::CanUndo

LRasterPaintWindow::Copy

LRasterPaintWindow::CreateToolbar

LRasterPaintWindow::Cut

LRasterPaintWindow::Delete

LRasterPaintWindow::Free

LRasterPaintWindow::FreeToolbar

LRasterPaintWindow::GetBitmap

LRasterPaintWindow::GetPaintBrush

LRasterPaintWindow::GetPaintFill

LRasterPaintWindow::GetPaintShape

LRasterPaintWindow::GetPaintRegion

LRasterPaintWindow::GetPaintText

LRasterPaintWindow::GetToolbar

LRasterPaintWindow::HandlePalette

LRasterPaintWindow::Initialize

LRasterPaintWindow::IsValid

LRasterPaintWindow::Paste

LRasterPaintWindow::Print

LRasterPaintWindow::Redo

LRasterPaintWindow::Repaint

LRasterPaintWindow::SelectAll

LRasterPaintWindow::SelectNone

LRasterPaintWindow::SetBitmap

LRasterPaintWindow::SetPaintBrush

LRasterPaintWindow::SetPaintFill

LRasterPaintWindow::SetPaintRegion

LRasterPaintWindow::SetPaintShape

LRasterPaintWindow::SetPaintText

LRasterPaintWindow::SetToolbar

LRasterPaintWindow::SetToolbarPosition

LRasterPaintWindow::SetWndHandle

LRasterPaintWindow::ShowToolbar

LRasterPaintWindow::Undo


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.
Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.
OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
Home page: http://www.leadtools.com


Programming with LEADTOOLS DigitalPaint

The following topics provide a systematic approach to understanding how to program with the LEADTOOLS DigitalPaint Class Library.

General

Unlocking DigitalPaint Features

Low-Level DigitalPaint

Initializing and Freeing DigitalPaint Handles

Setting DigitalPaint Properties

Setting General DigitalPaint Information

Painting with DigitalPaint

Setting a DigitalPaint Clipping Region

Using the Painting Common Dialogs

High-Level DigitalPaint

Using the LRasterPaintWindow Class

Setting DigitalPaint Properties in the LRasterPaintWindow Class


Unlocking DigitalPaint Features

The LEADTOOLS DigitalPaint Features are included in the LEADTOOLS Digital Paint products. The DigitalPaint features are shipped with the LEADTOOLS products, however they are locked. To use the DigitalPaint functions, LSettings::UnlockSupport must be called with the key found on the Unlock Certificate, included in your product packaging. (

LSettings::UnlockSupport (L_SUPPORT_DIGITALPAINT, "Unlock Certificate key") tells the package to unlock support for the DigitalPaint functions and passes the key for verification.


Initializing and Freeing DigitalPaint Handles

The LEADTOOLS Digital Paint products uses the LRasterPaint object's internal PAINTHANDLE structure as a working area for the painting functions. This handle must be initialized, by calling LRasterPaint::Initialize, before calling other DigitalPaint functions. LRasterPaint::Initialize initializes the paint handle, making it valid. To determine whether a paint handle is valid, call LRasterPaint::IsValid. When the paint handle is no longer needed, it should be freed by calling LRasterPaint::Free.

The following code sample gives an example of initializing a paint handle.

The toolkit uses the LRasterPaint class for the DigitalPaint functions. The user must initiate the DigitalPaint class object before using any of the class functions.

LRasterPaint Paint;

// initiate the Paint toolkit.
if ( SUCCESS != Paint.Initialize () )
{
return FALSE ;
}

Initializing the PAINTHANDLE sets all internal states (properties, clipping region, transformations…etc.) to their default values.

The following code sample checks the validity of a paint handle and, if valid, frees that paint handle. Freeing the paint handle should be done when the paint handle is no longer needed.

if ( SUCCESS == Paint.IsValid () )
{
Paint.Free () ;
}

Once LRasterPaint::Free has been called, the LRasterPaint object's handle is no longer valid. LRasterPaint::Initialize must be called again to initialize the paint handle and make it valid.

Once the LRasterPaint object's handle is initialized, certain paint information should be set. For more information on setting this paint information, refer to Setting DigitalPaint Properties and Setting General DigitalPaint Information.

To check the validity of the LRasterPaint object's handle before performing any operation on it, use the LRasterPaint::IsValid function. The LRasterPaint class object becomes valid after initializing it using the LRasterPaint::Initialize function and becomes invalid after calling the LRasterPaint::Free function.


Setting DigitalPaint Properties

LEADTOOLS DigitalPaint provides several types of painting abilities, including:

painting using a paintbrush

painting shapes

painting a region

filling an area with paint

painting text

Each of these is considered a paint "group" and each group has its own set of DigitalPaint properties that can be set. The values set for these properties control the paint results. For example, these properties determine:

whether the user draws a line or an ellipse.

whether the paintbrush contains color or an image.

how quickly the paint in the paintbrush will fade, if at all.

the shape of the region to paint.

the color to use when filling an area.

the text to paint.

etc.

Each group of properties has a group-specific structure used for getting or setting the properties. These structures are given below:

PAINTBRUSH

PAINTSHAPE

PAINTREGION

PAINTFILL

PAINTTEXT

Every structure has the dwMask field that will let the user specify the valid fields within the structure. In addition, there are default values for the members of each structure, which will be used if the user does not set DigitalPaint properties.

To get the current properties for a group, call LRasterPaint::GetProperty. This function requires the paint group to get, and a pointer to the appropriate group-specific structure. LRasterPaint::GetProperty will update the group-specific structure with the current property values.

To set the properties for a group, call LRasterPaint::SetProperty. This function requires the paint group to set, and a pointer to the appropriate group-specific structure. The structure should contain valid data for setting the properties.

The following is a simple example for setting the shape group properties. (It assumes the paint handle has been initialized.):

//The paint shape structure that will be used to set the shape properties
PAINTSHAPE shape ;

//Set the desired shape properties using the field masks
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BACKGROUNDSTYLE |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERWIDTH |
PSF_BORDERENDCAP |
PSF_GRADIENTSTYLE |
PSF_GRADIENTSTARTCOLOR |
PSF_GRADIENTENDCOLOR |
PSF_GRADIENTSTEPS ;

shape.nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_GRADIENT;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderWidth = 10 ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.nGradientStyle = PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_L ;
shape.crGradientStartColor = RGB ( 255, 192, 0 ) ;
shape.crGradientEndColor = RGB ( 0, 0, 255 ) ;
shape.uGradientSteps = 255 ;

//Set the paint shape group properties
// Assume Paint was constructed from LRasterPaint class
Paint.SetProperty ( PAINT_GROUP_SHAPE, &shape ) ;

This example uses the constant PAINT_GROUP_SHAPE to identify the group that will be set. The toolkit has the following group constants:

PAINT_GROUP_BRUSH

PAINT_GROUP_SHAPE

PAINT_GROUP_REGION

PAINT_GROUP_FILL

PAINT_GROUP_TEXT

In addition to setting the Digitalpaint properties, other information should be set before actually painting. This includes:

the device context to use for display.

an optional handle to a bitmap to use as a painting canvas.

an optional restriction palette to limit the paint colors displayed or painted on the canvas.

These properties are referred to as the DigitalPaint metrics. For more information, refer to Setting General DigitalPaint Information.


Setting General DigitalPaint Information

Several of the DigitalPaint functions provided by LEADTOOLS require additional information, referred to here as DigitalPaint metrics. This information includes:

the Windows device context (DC), such as a screen, used as a display surface.

an optional handle to a bitmap. This bitmap will be used as a painting canvas.

an optional restriction palette to limit the paint colors displayed or painted on the canvas.

These properties can be set using the LRasterPaint::SetMetrics function.

Several of the DigitalPaint functions take a DC as an argument, but can actually paint to a DC and/or a bitmap. If the user supplies only a DC through the function arguments, then the toolkit will paint only to that DC. If the user passes NULL for the DC, but has set a bitmap through the LRasterPaint::SetMetrics function, the painting function will paint only to the bitmap. If the user sets a bitmap and passes a valid DC to a DigitalPaint function, the DigitalPaint function will paint to both the DC and the bitmap. The bitmap can be changed or removed as desired.

The restriction palette controls the colors available to the following groups:

Brush.

Shape.

Fill.

Text.

If a restriction palette is set using this function, then the colors painted to the device context and/or the bitmap are limited to the colors available in the palette. Therefore, if the user tries to paint a color value of RGB(255, 0, 0), which is red, but is using a grayscale restriction palette, the toolkit uses the nearest color to red in the supplied palette. If the color restriction palette is set to NULL, the toolkit will not perform any color restriction.

In addition to the DigitalPaint metrics, other general DigitalPaint information should be set before beginning to paint. This information includes transformation information and device context (DC) boundary information.

The transformation information is used for translating from external coordinates, such as mouse position, to the device context (DC) and/or bitmap coordinates. The current transformation information can be obtained by calling LRasterPaint::GetTransformation. To set the transformation information, call LRasterPaint::SetTransformation.

The device context boundaries should also be set before painting. They should also be updated any time the client area of the display window is resized. To determine the current device context boundaries, call LRasterPaint::GetDCExtents. To set or change the device context boundaries, call LRasterPaint::SetDCExtents.

Once the general DigitalPaint information has been set, painting can begin. For more information on painting, refer to Painting with DigitalPaint.


Setting a DigitalPaint Clipping Region

Clipping is used by the LRasterPaint class to limit the output to a user-defined region. This can be done using the LRasterPaint::SetClipRgn function. To get the last clipping region set, call LRasterPaint::GetClipRgn. To offset a clipping region, call LRasterPaint::OffsetClipRgn.

L_INT OnPaintShape ( HWND hWnd )
{
LRasterPaint Paint ;
HDC hDC ;
HRGN hClipRgn ;
RECT rcShapeRect ;

/* Initiate the Paint toolkit */
if ( SUCCESS != Paint.Initialize( ) )
{
return FAILURE ;
}

/* Get device context to draw on */
hDC = GetDC ( hWnd ) ;

/*Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;

/*Use the current shape properties to draw an ellipse to DC (hDC) */
Paint.DrawShapeEllipse ( hDC, &rcShapeRect ) ;

hClipRgn = CreateRectRgn ( 120, 20, 200, 100 ) ;

/*Set painting clip region */
Paint.SetClipRgn ( hClipRgn ) ;

/*Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 110, 10, 210, 110 ) ;

/*Use the current shape properties to draw an ellipse to DC (hDC) */
Paint.DrawShapeEllipse ( hDC, &rcShapeRect ) ;

/*Delete the clip region */
DeleteObject ( ( HRGN ) hClipRgn ) ;

/*Release the device context */
ReleaseDC ( hWnd, hDC ) ;

/* Free the paint tools class object */
Paint.Free ( ) ;

return SUCCESS ;
}


Using the DigitalPaint Common Dialogs

LEADTOOLS DigitalPaint provides a number of functions for displaying dialogs. The DigitalPaint Common Dialogs provide an easier way to enter or change painting settings. The functions for displaying the dialogs are:

LRasterDialog::DoModalBrush

LRasterDialog::DoModalFill

LRasterDialog::DoModalShape

LRasterDialog::DoModalRegion

LRasterDialog::DoModalText

The following example shows the use of a DigitalPaint Common Dialog.

// This example will display the brush common dialog

L_VOID BrushDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
LRasterDialog lRstDlg ;
L_TCHAR * ppszTouchImage [ ] = { TEXT("Image 0"), TEXT("Image 1"), TEXT("Image 2"), TEXT("Image 3"), TEXT("Image 4") } ;
PAINTDLGBRUSHINFO DlgBrushInfo ;

if ( bUseDef == TRUE )
{
DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_INITUSEDEFAULT | PAINT_DLG_BRUSH_SHOWALL ;
}
else
{
DlgBrushInfo.nSize = sizeof ( PAINTDLGBRUSHINFO ) ;
DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_SHOWTOUCHCONTENT |
PAINT_DLG_BRUSH_SHOWTOUCHCOLOR |
PAINT_DLG_BRUSH_SHOWTOUCHIMAGE |
PAINT_DLG_BRUSH_SHOWDIAMETER |
PAINT_DLG_BRUSH_SHOWHARDNESS |
PAINT_DLG_BRUSH_SHOWSPACING |
PAINT_DLG_BRUSH_SHOWOPACITY |
PAINT_DLG_BRUSH_SHOWTRANSPARENTCOLOR |
PAINT_DLG_BRUSH_SHOWDEFAULT ;

DlgBrushInfo.pszTitle = TEXT("Lead Brush Common Dialog ") ;
DlgBrushInfo.nContentsType = PAINT_TOUCH_CONTENTS_COLOR;
DlgBrushInfo.crColor = RGB ( 255, 0, 0 ) ;
DlgBrushInfo.ppszTouchImage = ppszTouchImage ;
DlgBrushInfo.uTouchImageCount = 5 ;
DlgBrushInfo.nActiveTouchImageItem = 1 ;
DlgBrushInfo.crTransparentColor = RGB(0,0,0);
DlgBrushInfo.nDiameter = 15 ;
DlgBrushInfo.nHardnessValue = 75 ;
DlgBrushInfo.nSpacing = 10 ;
DlgBrushInfo.nOpacity = 10 ;

}
lRstDlg.DoModalBrush ( hWnd, &DlgBrushInfo ) ;

return ;

}


Painting With DigitalPaint

LEADTOOLS DigitalPaint provides support for a number of painting abilities. These include:

painting using a paintbrush

painting shapes

painting a region

filling an area with paint

painting text

Several functions are provided for implementing each of these painting abilities. For more information about a specific painting ability, refer to the following:

Painting with a Brush

Painting a Shape

Creating a Region

Filling an Area

Painting Text


Painting With a Brush

The LEADTOOLS LRasterPaint class provides the following functions for painting with a brush:

LRasterPaint::BrushMoveTo

LRasterPaint::BrushLineTo

These functions require:

an optional windows device context.

X coordinate of a point.

Y coordinate of a point.

The LRasterPaint::BrushMoveTo function paints a single brush touch using the current brush group properties at the required position. The LRasterPaint::BrushLineTo function paints a series of brush touches (a brush stroke) from the point set by the LRasterPaint::BrushMoveTo function, to the position set by the LRasterPaint::BrushLineTo function. If LRasterPaint::BrushMoveTo is not called before calling LRasterPaint::BrushLineTo, the LRasterPaint::BrushLineTo function will use the default (0, 0) as the starting point for the line.

These functions will draw brush touches and strokes based on the current brush properties. To determine the current brush properties, call LRasterPaint::GetProperty. To set or change the current brush properties, call LRasterPaint::SetProperty. For more information on the brush properties, refer to the PAINTBRUSH structure.

Before painting a brush touch or a brush stroke, set the DigitalPaint metrics using the LRasterPaint::SetMetrics function.

Any transformation information should be set, using the LRasterPaint::SetTransformation function before calling any brush or other painting function. To get the current transformation information, call LRasterPaint::GetTransformation.

The following example sets the brush properties, moves the paintbrush to a certain point and then paints a brush stroke. It assumes the paint handle has been initialized and the window handle is valid:

HDC hDC;
PAINTBRUSH brush;

/* Get device context to draw on */
hDC = GetDC ( hWnd ) ;

/* Set the required paintbrush properties */
brush.nSize = sizeof ( PAINTBRUSH ) ;
brush.dwMask = PBF_DIAMETER |
PBF_TOUCH |
PBF_SPACING ;
brush.nDiameter = 20 ;
brush.Touch.crColor = RGB ( 255, 0, 0 ) ;
brush.nSpacing = 25 ;

/* Set the new paintbruch properties */
// Assume Paint was constructed from LRasterPaint class

Paint.SetProperty ( PAINT_GROUP_BRUSH, &brush ) ;

/* Use the current paintbruch properties to draw a paintbrush stroke to DC (hDC) */
Paint.BrushMoveTo ( hDC, 10, 10 ) ;
Paint.BrushLineTo ( hDC, 100, 100 ) ;

/* Release the device context */
ReleaseDC ( hWnd, hDC ) ;


Painting a Shape

The LEADTOOLS LRasterPaint class provides the following functions for painting a shape:

LRasterPaint::DrawShapeEllipse

LRasterPaint::DrawShapeLine

LRasterPaint::DrawShapePolyBezier

LRasterPaint::DrawShapePolygon

LRasterPaint::DrawShapeRectangle

LRasterPaint::DrawShapeRoundRect

These functions require:

an optional windows device context.

the coordinates used to paint the shape.

These functions will draw shapes based on the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

Before painting a shape, set the DigitalPaint metrics using the LRasterPaint::SetMetrics function.

Any transformation information should be set, using the LRasterPaint::SetTransformation function before calling any shape or other painting function. To get the current transformation information, call LRasterPaint::GetTransformation.

The following example sets the shape properties, sets the DigitalPaint metrics and paints a line. It assumes the paint handle has been initialized and the bitmap handle is valid:

PAINTSHAPE shape;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP ;
shape.nBorderWidth = 10 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DASHDOT ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;

/* Set the new shape properties */
// Assume Paint was constructed from LRasterPaint class
Paint.SetProperty ( PAINT_GROUP_SHAPE, &shape ) ;

/*Select the bitmap into the paint class object*/
Paint.SetMetrics ( NULL, &hLeadBitmap, NULL ) ;

/* Use the current shape properties to draw a line to the currently selected bitmap*/
Paint.DrawShapeLine ( hDC, 10, 10, 200, 200 ) ;


Creating a Region

The LEADTOOLS LRasterPaint class provides the following functions for creating a region:

LRasterPaint::RegionRect

LRasterPaint::RegionRoundRect

LRasterPaint::RegionEllipse

LRasterPaint::RegionPolygon

LRasterPaint::RegionSurface

LRasterPaint::RegionBorder

LRasterPaint::RegionColor

These functions require:

an optional windows device context.

the necessary data used to control the region creation.

a pointer to a region handle to be updated with the resulting region.

These functions will create regions based on the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

The resulting region can be scaled or translated with the LRasterPaint::RegionScale or LRasterPaint::RegionTranslate functions.

Before creating a region, set the DigitalPaint metrics using the LRasterPaint::SetMetrics function.

The following example creates a rectangular region using the current region properties and the current transformations. It assumes the Digitalpaint class object has been initialized and the window handle is valid:

/* Get the device context */
hDC = GetDC ( hWnd ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcRegion, 10, 10, 100, 100 ) ;

/* Use the current region properties and the current painting
transformations to create a rectangular region */
// Assume Paint was constructed from LRasterPaint class
Paint.RegionRect ( hDC, &rcRegion, &hRgn ) ;


Filling an Area

The LEADTOOLS LRasterPaint class provides the following functions for filling an area:

LRasterPaint::FillSurface

LRasterPaint::FillBorder

LRasterPaint::FillColorReplace

These functions require:

an optional windows device context.

the necessary information used to control the filling action.

These functions will fill areas based on the current fill properties. To determine the current fill properties, call LRasterPaint::GetProperty. To set or change the current fill properties, call LRasterPaint::SetProperty. For more information on the fill properties, refer to the PAINTFILLstructure.

The filling functions use different methods to fill an area. The LRasterPaint::FillSurface function fills an area, starting at a specified point and continuing in all directions, that contains a specified color, falling within some tolerance range. The upper and lower tolerances are set in the PAINTFILL structure. The LRasterPaint::FillBorder function fills an area, starting at a specified point and continuing in all directions, until it finds a specified color, falling within some tolerance range. The LRasterPaint::FillColorReplace will replace every pixel using the current fill properties.

Any transformation information should be set, using the LRasterPaint::SetTransformation function before calling any fill or other painting function. To get the current transformation information, call LRasterPaint::GetTransformation.

For selecting a color from a specific point, call LRasterPaint::PickColor.

The following example sets the device context boundaries, sets the fill properties, sets the DigitalPaint metrics properties and then performs a color replacement. It assumes the paint handle has been initialized, and the window handle and lead bitmap handle are valid:

HDC hDC ;
PAINTFILL fill ;
RECT rcDCExtents ;

/* Get device context to draw on */
hDC = GetDC ( hWnd ) ;

/* Get the destination DC dimensions */
GetClientRect ( hWnd, &rcDCExtents ) ;

/* Set the toolkit user DC extents */
// Assume Paint was constructed from LRasterPaint class
Paint.SetDCExtents ( &rcDCExtents ) ;

/* Set the required fill properties */
fill.nSize = sizeof ( PAINTFILL ) ;
fill.dwMask = PFF_STYLE ;
fill.nStyle = PAINT_FILL_STYLE_GRADIENT ;

/* Set the new fill properties */
Paint.SetProperty ( PAINT_GROUP_FILL, &fill ) ;

/*Select the bitmap into the paint class object*/
Paint.SetMetrics ( NULL, &hLeadBitmap, NULL ) ;

/* Fill the target area in the DC (hDC) and the currently selected bitmap*/
Paint.FillColorReplace ( hDC, RGB ( 255, 0, 0 ) ) ;

/* Release the device context */
ReleaseDC ( hWnd, hDC ) ;

This example uses the function LRasterPaint::SetDCExtents. This function is essential in filling the desired area. The user should define the boundaries of the DC supplied to the fill function. The supplied dimensions will be in pixels. To get the DC boundaries previously set, call the LRasterPaint::GetDCExtents function.


Painting Text

The LEADTOOLS LRasterPaint class provides the following function for painting text:

LRasterPaint::ApplyText

This function requires:

an optional windows device context.

the bounding rectangle in which to paint the text.

This function will paint text based on the current text properties. To determine the current text properties, call LRasterPaint::GetProperty. To set or change the current text properties, call LRasterPaint::SetProperty. For more information on the text properties, refer to the PAINTTEXT structure.

Any transformation information should be set, using the LRasterPaint::SetTransformation function before calling any text or other painting function. To get the current transformation information, call LRasterPaint::GetTransformation.

The following example sets the text properties and paints some text. It assumes the DigitalPaint class object has been initialized and the window handle is valid:

HDC hDC ;
PAINTTEXT text ;
RECT rcText ;
LOGFONT lf ;
HFONT hFont ;

/* Get device context to draw on */
hDC = GetDC ( hWnd ) ;

/* Set the required text font properties */
lf.lfHeight = 48 ;
lf.lfWidth = 0 ;
lf.lfEscapement = 0 ;
lf.lfOrientation = 0 ;
lf.lfWeight = FW_NORMAL ;
lf.lfItalic = FALSE ;
lf.lfUnderline = FALSE ;
lf.lfStrikeOut = FALSE ;
lf.lfCharSet = ANSI_CHARSET ;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS ;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS ;
lf.lfQuality = DEFAULT_QUALITY ;
lf.lfPitchAndFamily = FF_DONTCARE ;
lstrcpy(lf.lfFaceName, TEXT("Times New Roman"));

/* Create the desired text font */
hFont = CreateFontIndirect ( &lf ) ;

/* Set the desired text properties */
text.nSize = sizeof ( PAINTTEXT ) ;
text.dwMask = PTF_TEXT | PTF_FONT | PTF_TRANSFORMINFO ;
text.pszText = TEXT("LEAD") ;
text.hFont = hFont ;
text.TransformInfo.nRotate = 45 ;

/* Set the new text properties */
// Assume Paint was constructed from LRasterPaint class
Paint.SetProperty ( PAINT_GROUP_TEXT, &text ) ;

/* Set the target text drawing box coordinates with respect to the DC dimensions */
SetRect ( &rcText, 10, 10, 200, 200 ) ;

/*Use the current text properties and the current transformations properties to draw the text to the DC */
Paint.ApplyText ( hDC, &rcText ) ;

/* Release the device context */
ReleaseDC ( hWnd, hDC ) ;


Using the LRasterPaintWindow Class

For low-level DigitalPaint, LEAD provides the LAutomation, LContainer and LToolbar classes, in addition to the LRasterPaint class, to allow the user to customize his or her DigitalPaint application. These classes allow the user to provide low-level automation, container and toolbar support.

For those users who wish to program DigitalPaint applications at a higher level, LEADTOOLS DigitalPaint provides the LRasterPaintWindow class. This class can be used only as a window.

The LRasterPaintWindow class provides some automation, container and toolbar support that keeps the user from having to work with the lower level LAutomation, LContainer and LToolbar classes. To further understand the low-level automation, container and toolbar support, refer to the following help files in the LEAD/HELP directory:

Ltautlibn.hlp

Lttblibn.hlp

To use the LRasterPaintWindow (or any derived) class as a Window in an application, a window must be created and then the newly created window handle assigned to an LRasterPaintWindow (or derived) object. After that, the class object will do all of the processing required to handle the Window messages that the window will receive, including those relating to displaying images. To assign a window handle to an LRasterPaintWindow object, call LRasterPaintWindow::SetWndHandle.

Once the window has been created, the internal automation handle must be initialized by calling LRasterPaintWindow::Initialize. This handle must be initialized before calling many of the LRasterPaintWindow functions. Once initialized by calling LRasterPaintWindow::Initialize, the internal automation handle is "valid". It will remain valid until LRasterPaintWindow::Free is called to free the internal automation and container handles. The container handle is initialized when a bitmap is attached to the class object by calling LRasterPaintWindow::SetBitmap. To determine whether these internal handles are valid, call LRasterPaintWindow::IsValid.

The internal container handle references the container for the LRasterPaintWindow window. A container can be attached to a window. The window to which a container is attached is said to "own" that container. After attaching the container to a window, the container becomes responsible for collecting and transforming the coordinates of any selected objects in the container. The LRasterPaintWindow class contains the following function for determining whether the container handle is valid:

LRasterPaintWindow::IsValid

The LRasterPaintWindow class provides support for using a DigitalPaint toolbar with the class object. The DigitalPaint toolbar supported by this class is an automation toolbar, which automatically handles all buttons and function calls. The LRasterPaint Window class provides functions for creating, positioning, displaying and freeing the DigitalPaint toolbar. These are listed below:

LRasterPaintWindow::CreateToolbar

LRasterPaintWindow::FreeToolbar

LRasterPaintWindow::SetToolbarPosition

LRasterPaintWindow::ShowToolbar

In addition, the LRasterPaintWindow class provides the LRasterPaintWindow::GetToolbar and LRasterPaintWindow::SetToolbar for getting and setting the toolbar handle.

Before painting, a bitmap must be attached to the LRasterPaintWindow object by calling LRasterPaintWindow::SetBitmap. This bitmap will be displayed in the LRasterPaintWindow window and is the bitmap on which painting will occur. To get the bitmap currently attached to the LRasterPaintWindow class object, call LRasterPaintWindow::GetBitmap. The entire bitmap, and all objects painted on the bitmap can be selected or deselected by calling LRasterPaintWindow::SelectAll and LRasterPaintWindow::SelectNone, respectively.

At this point, painting can begin. Items can be painted using the DigitalPaint toolbar and the default paint properties.

LEADTOOLS provides a number of functions for determining the current paint properties and for setting new values for the paint properties. For more information on this, please refer to the Setting DigitalPaint Properties in the LRasterPaintWindow Class.

LEADTOOLS also provides the LRasterDialog class for displaying dialogs used to change the paint properties. For more information on this topic, refer to Using the DigitalPaint Common Dialogs.

In addition to painting capabilities, the LRasterPaintWindow class includes functions for several other capabilities, including redoing and undoing operations, printing paint data, and editing paint data by cutting, pasting, copying and deleting. These functions are listed here:

Undoing and Redoing Paint Operations

LRasterPaintWindow::CanRedo

LRasterPaintWindow::CanUndo

LRasterPaintWindow::Redo

LRasterPaintWindow::Undo

Editing DigitalPaint Data

LRasterPaintWindow::Copy

LRasterPaintWindow::Cut

LRasterPaintWindow::Delete

LRasterPaintWindow::Paste

Printing DigitalPaint Data

LRasterPaintWindow::Print

To let the paint window handle palette changes based on messages received, call LRasterPaintWindow::HandlePalette.

To repaint all or part of the class object's window, call LRasterPaintWindow::Repaint.


Setting DigitalPaint Properties in the LRasterPaintWindow Class

LEADTOOLS DigitalPaint provides several types of painting abilities, including:

painting using a paintbrush

painting shapes

painting a region

filling an area with paint

painting text

Each of these is considered a paint "group" and each group has its own set of DigitalPaint properties that can be set. The values set for these properties control the paint results. For example, these properties determine:

whether the user draws a line or an ellipse.

whether the paintbrush contains color or an image.

how quickly the paint in the paintbrush will fade, if at all.

the shape of the region to paint.

the color to use when filling an area.

the text to paint.

etc.

Each group of properties has a group-specific structure used for getting or setting the properties. These structures are given below:

PAINTBRUSH

PAINTSHAPE

PAINTREGION

PAINTFILL

PAINTTEXT

Every structure has the dwMask field that will let the user specify the valid fields within the structure. In addition, there are default values for the members of each structure, which will be used if the user does not set paint properties.

To get the current properties for a specific group, use one of the functions listed below. Each function returns a pointer to a group-specific structure that is updated with the current properties.

LRasterPaintWindow::GetPaintBrush

LRasterPaintWindow::GetPaintFill

LRasterPaintWindow::GetPaintRegion

LRasterPaintWindow::GetPaintShape

LRasterPaintWindow::GetPaintText

To set the properties for a specific group, use one of the functions listed below. Each function requires a pointer to the appropriate group-specific structure. The structure should contain valid data for setting the properties.

LRasterPaintWindow::SetPaintBrush

LRasterPaintWindow::SetPaintFill

LRasterPaintWindow::SetPaintRegion

LRasterPaintWindow::SetPaintShape

LRasterPaintWindow::SetPaintText


Files To Be Included With Your Application

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation. The following subdirectory is created:

REDIST\

Redistributable DigitalPaint files.

Note: | You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.
Note: | You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions. Most files in the table are optional. 32-bit DLLs are listed. These files are referred to as "Redistributables" in the License Agreement.

Please note that LTKRN and LTWVC are required for ALL Class Library applications. For more information on LTKRN, LTWVC, and other files for the Main Class Library, refer to Files To Be Included With Your Application .

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTPNT | LEADTOOLS DigitalPaint. The header file is LTPNT.H. Also requires LTKRN, LTIMG, LTDIS and LTEFX. For Automated DigitalPaint, LTCON, LTAUT and LTTLB are also required. For information on LTIMG, LTDIS and LTEFX, refer to Files To Be Included With Your Application , in the Main API help file. For information on LTAUT and LTCON, refer to Files To Be Included With Your Application , in the Automation API help file. For information on LTTLB, refer to Files To Be Included With Your Application , in the Toolbar API help file. | DLL: LTPNT14N.DLL Library: LTPNT_N.LIB. | DLL: LTPNT14NU.DLL Library: LTPNT_NU.LIB. | DLL: LTPNT14E.DLL Library: LTPNT_E.LIB. | DLL: LTPNT14EU.DLL Library: LTPNT_EU.LIB.
LTPDG | LEADTOOLS DigitalPaint Common Dialogs. The header file is LTPDG.H. | DLL: LTPDG14N.DLL Library: LTPDG_N.LIB. | DLL: LTPDG14E.DLL Library: LTPDG_E.LIB. | DLL: LTPDG14NU.DLL Library: LTPDG_NU.LIB. | DLL: LTPDG14EU.DLL Library: LTPDG_EU.LIB.


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

ACROBAT | LEADTOOLS manuals in the PDF format, which you can view and print using Adobe Acrobat. These files are optional and are available when installing from the CD-ROM.
BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\OCX | One subdirectory for each example ActiveX program.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
INCLUDE\CLASSLIB | Header files for the Class Library
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


LRasterPaint

Description

The LRasterPaint class provides low-level DigitalPaint functions for implementing painting applications.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTPNT

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

Class Members


LRasterPaint::Class Members

Constructors / Destructors

Painting Shapes and Text

Fill an area

Initializing and Freeing the Paint Handle

Working with the DC

Paint Properties

Working with Regions

Transformation

Offset

Getting and Setting General Information

Return to LRasterPaint

Constructors / Destructors

LRasterPaint::LRasterPaint

LRasterPaint::~LRasterPaint

Painting Shapes and T ext

LRasterPaint::ApplyText

LRasterPaint::BrushLineTo

LRasterPaint::BrushMoveTo

LRasterPaint::DrawShapeEllipse

LRasterPaint::DrawShapeLine

LRasterPaint::DrawShapePolyBezier

LRasterPaint::DrawShapePolygon

LRasterPaint::DrawShapeRectangle

LRasterPaint::DrawShapeRoundRect

Fill an area

LRasterPaint::FillBorder

LRasterPaint::FillColorReplace

LRasterPaint::FillSurface

Initializing and Freeing the Paint Handle

LRasterPaint::Free

LRasterPaint::Initialize

Working with the DC

LRasterPaint::GetDCExtents

LRasterPaint::SetDCExtents

Paint Properties

LRasterPaint::GetProperty

LRasterPaint::SetProperty

Working with Regions

LRasterPaint::RegionBorder

LRasterPaint::RegionColor

LRasterPaint::RegionEllipse

LRasterPaint::RegionPolygon

LRasterPaint::RegionRect

LRasterPaint::RegionRoundRect

LRasterPaint::RegionScale

LRasterPaint::RegionSurface

LRasterPaint::GetClipRgn

LRasterPaint::SetClipRgn

Transformation

LRasterPaint::GetTransformation

LRasterPaint::SetTransformation

Offset

LRasterPaint::OffsetClipRgn

LRasterPaint::RegionTranslate

Getting and Setting General Information

LRasterPaint::IsValid

LRasterPaint::PickColor

LRasterPaint::SetMetrics


LRasterDialog

Description

The LRasterDialog class provides DigitalPaint functions that provide support for the DigitalPaint common dialogs.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTPDG

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

Class Members


LRasterDialog::Class Members

Common dialog

Return to LRasterDialog

Common dialog

LRasterDialog::DoModalBrush

LRasterDialog::DoModalFill

LRasterDialog::DoModalRegion

LRasterDialog::DoModalShape

LRasterDialog::DoModalText


LRasterPaintWindow

Description

The LRasterPaintWindow class provides high-level DigitalPaint functions for creating painting applications.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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

Class Members


LRasterPaintWindow::Class Members

Constructors / Destructors

Working with the Window Functions

Set / Get Paint Shape Properties

Set / Get Paintbrush Properties

Set / Get Paint Region Properties

Set / Get Paint Fill Properties

Set / Get Paint Text Properties

Working with the Toolbar

Undoing and Redoing Operations

Editing and Printing

Miscellaneous

Return to LRasterPaintWindow

Constructors / Destructors

LRasterPaintWindow::LRasterPaintWindow

LRasterPaintWindow::~LRasterPaintWindow

Working with the Window Functions

LRasterPaintWindow::SetWndHandle

LRasterPaintWindow::SetBitmap

LRasterPaintWindow::GetBitmap

LRasterPaintWindow::Repaint

LRasterPaintWindow::HandlePalette

Set / Get Paintbrush Properties

LRasterPaintWindow::SetPaintBrush

LRasterPaintWindow::GetPaintBrush

Set / Get Paint Shape Properties

LRasterPaintWindow::SetPaintShape

LRasterPaintWindow::GetPaintShape

Set / Get Paint Region Properties

LRasterPaintWindow::SetPaintRegion

LRasterPaintWindow::GetPaintRegion

Set / Get Paint Fill Properties

LRasterPaintWindow::SetPaintFill

LRasterPaintWindow::GetPaintFill

Set / Get Paint Text Properties

LRasterPaintWindow::SetPaintText

LRasterPaintWindow::GetPaintText

Working with the Toolbar

LRasterPaintWindow::CreateToolbar

LRasterPaintWindow::FreeToolbar

LRasterPaintWindow::SetToolbarPosition

LRasterPaintWindow::ShowToolbar

LRasterPaintWindow::SetToolbar

LRasterPaintWindow::GetToolbar

Undoing and Redoing Operations

LRasterPaintWindow::CanRedo

LRasterPaintWindow::CanUndo

LRasterPaintWindow::Redo

LRasterPaintWindow::Undo

Editing and Printing

LRasterPaintWindow::Cut

LRasterPaintWindow::Copy

LRasterPaintWindow::Paste

LRasterPaintWindow::Delete

LRasterPaintWindow::Print

Miscellaneous

LRasterPaintWindow::Initialize

LRasterPaintWindow::Free

LRasterPaintWindow::IsValid

LRasterPaintWindow::SelectNone

LRasterPaintWindow::SelectAll


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
Suite 400,
1201 Greenwood Cliff,
Charlotte, NC 28204

Before calling technical support, please look in the online documentation and the example programs for an answer to your question.


DigitalPaint Function Groups

DigitalPaint Functions

LRasterPaint Class Members

LRasterDialog Class Members

LRasterPaintWindow Class Members


Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Paint Data Types

PAINTALIGNMENT

PAINTBRUSH

PAINTFILL

PAINTFILLGRADIENTSTYLE

PAINTFILLSTYLE

PAINTGROUP

PAINTHANDLE

PAINTHARDNESS

PAINTHARDNESSDISTRBTYPE

PAINTREGION

PAINTSHAPE

PAINTSHAPEBACKSTYLE

PAINTSHAPEBORDERBRUSHSTYLE

PAINTSHAPEBORDERENDCAP

PAINTSHAPEBORDERSTYLE

PAINTSHAPEGRADIENTSTYLE

PAINTTEXT

PAINTTEXTBACKSTYLE

PAINTTEXTBORDERBRUSHSTYLE

PAINTTOUCH

PAINTTOUCHCONTENTS

PAINTTOUCHSHAPE

PAINTTRANSFORM

PAINTXFORM

Common Dialog Data Types

PAINTDLGBRUSHINFO

PAINTDLGFILLINFO

PAINTDLGREGIONINFO

PAINTDLGSHAPEINFO

PAINTDLGTEXTINFO

Structures Used with Input and Output Functions

WINDOWS Structures


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type | Definition and Usage
L_BITFIELD | Defined as L_UINT; used as a bit field.
L_BOOL | Defined as L_UINT; used as a boolean value.
L_CHAR | Defined as char; used as a signed 8-bit integer.
L_DOUBLE | Defined as double; used as a double precision floating point number.
L_FLOAT | Defined as float; used as a floating point number.
L_INT | Defined as int; used as a signed integer, 16-bits or larger.
L_INT16 | Defined as short; used as a signed 16-bit integer.
L_INT32 | Defined as long; used as a signed 32-bit integer.
L_UCHAR | Defined as unsigned char; used as an unsigned 8-bit integer.
L_UINT | Defined as unsigned; used as an unsigned integer, 16-bits or larger.
L_UINT16 | Defined as unsigned short; used as an unsigned 16-bit integer.
L_UINT32 | Defined as unsigned long; used as an unsigned 32-bit integer.
L_VOID | Defined as void; used as a void.
L_COMP | Defined as L_UINT; used as a handle to a computer
L_MEDIA | Defined as L_VOID L_FAR *; used as a void pointer
L_TCHAR | Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and datatypes:

Keyword | Definition and Usage
L_FAR | Defined as nothing; used as a placeholder.
L_HUGE | Defined as nothing; used as a placeholder.
L_EXPORT | Defined as nothing; used as a placeholder.
L_PASCAL | Defined as nothing; used as a placeholder.
EXT_FUNCTION | Defined as WINAPI; used as an attribute for all toolkit functions.
pEXT_FUNCTION | Defined as EXT_FUNCTION L_FAR *; used as an attribute when defining pointers to toolkit functions.
EXT_CALLBACK | Defined as _cdecl L_FAR; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK L_FAR *; used as an attribute when defining pointers to toolkit callback functions.


VECTORPOINT

typedef struct _VECTORPOINT
{
L_DOUBLE x;
L_DOUBLE y;
L_DOUBLE z;

} VECTORPOINT, L_FAR *pVECTORPOINT;

The VECTORPOINT structure holds information about a point.

Member | Description
x | X coordinate of the point.
y | Y coordinate of the point.
z | Z coordinate of the point.


WINDOWS Structures

BITMAPINFO

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure, please refer to the Microsoft SDK documentation for BITMAPINFO.

COLORREF

COLORREF is a Windows data type. For further information concerning COLORREF, please refer to the Microsoft SDK documentation.

DWORD

DWORD is a Windows data type, 32 bit unsigned int. For further information concerning DWORD, please refer to the Microsoft SDK documentation.

HANDLE

Handle is a standard Windows structure. For further information concerning HANDLE, please refer to the Microsoft SDK documentation or your compiler's documentation.

HDC

HDC is a standard Windows structure. For further information concerning HDC, please refer to the Microsoft SDK documentation or your compiler's documentation.

HGLOBAL

HGLOBAL is a standard Windows data type. For further information concerning HGLOBAL, please refer to the Microsoft SDK documentation or your compiler's documentation.

HPALETTE

HPALETTE is a standard Windows data type. For further information concerning HPALETTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

HRGN

HRGN is a standard Windows data type. For further information concerning HRGN, please refer to the Microsoft SDK documentation or your compiler's documentation.

HWND

HWND is a standard Windows data type. For further information concerning HWND, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPARAM

LPARAM is a standard Windows structure. For further information concerning LPARAM, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPBYTE

LPBYTE is a standard Windows data type. For further information concerning LPBYTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPPOINT

LPPOINT is a standard Windows structure. For further information concerning LPPOINT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPRECT

LPRECT is a standard Windows structure. For further information concerning LPRECT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPSTR

LPSTR is a standard Windows data type. For further information concerning LPSTR, please refer to the Microsoft SDK documentation or your compiler's documentation.

OPENFILENAME

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for OPENFILENAME.

UINT

UINT is a standard Windows structure. For further information concerning UINT, please refer to the Microsoft SDK documentation or your compiler's documentation.

WPARAM

WPARAM is a standard Windows structure. For further information concerning WPARAM, please refer to the Microsoft SDK documentation or your compiler's documentation.


PAINTALIGNMENT

typedef enum
{
//Valid values for horizontal alignment are:
PAINT_ALIGNMENT_LEFT = 0X01,
PAINT_ALIGNMENT_HCENTER = 0X02,
PAINT_ALIGNMENT_RIGHT = 0X04,

//Valid values for vertical alignment are:
PAINT_ALIGNMENT_TOP = 0X08,
PAINT_ALIGNMENT_VCENTER = 0X10,
PAINT_ALIGNMENT_BOTTOM = 0X20

} PAINTALIGNMENT ;

The PAINTALIGNMENT enumeration type contains options for aligning painted text.

Comments

A value from each category (horizontal and vertical) may be combined using the bitwise OR operator (|).


PAINTBRUSH

typedef struct _PAINTBRUSH
{
L_INT nSize;
L_UINT32 dwMask;
PAINTTOUCH Touch;
L_INT nDiameter;
PAINTHARDNESS Hardness;
L_INT nSpacing;
L_INT nDensity;
L_INT nOpacity;
L_INT nFadeOutRate;
pBITMAPHANDLE pTexture;
} PAINTBRUSH, L_FAR *pPAINTBRUSH;

The PAINTBRUSH structure holds information about the paintbrush.

Member | Description
nSize | Size of this structure.
dwMask | Flags that indicate which structure members contain valid information. Possible values are:
 | Value | Meaning
 | PBF_ALL | All fields contain valid data.
 | PBF_TOUCH | The Touch field contains valid data.
 | PBF_DIAMETER | The nDiameter field contains valid data.
 | PBF_HARDNESS | The Hardness field contains valid data.
 | PBF_SPACING | The nSpacing field contains valid data.
 | PBF_DENSITY | The nDensity field contains valid data.
 | PBF_OPACITY | The nOpacity field contains valid data.
 | PBF_FADEOUTRATE | The nFadeOutRate field contains valid data.
 | PBF_TEXTURE | The pTexture field contains valid data.
 | These values can be combined using the bit-wise OR operator (|).
Touch | Structure that contains information about the touch properties. For more information on these properties, refer to PAINTTOUCH.
nDiameter | Value indicating the diameter of the brush, in pixels. Valid values are between 1 and 200.
Hardness | Structure that contains information about the hardness of the brush. For more information, refer to PAINTHARDNESS.
nSpacing | Indicates the spacing of the discrete drops of the paintbrush, or how frequently the brush tip touches the painting surface during a stroke. When the spacing is 30, this means that the brush tip will touch the painting surface once every 30 pixels. Valid values are between (1-1000).
nDensity | Value indicating the amount of paint the brush applies with each stroke. Increasing the density of the brush is comparable to increasing the number of bristles in the brush. With more bristles, more paint is applied in a stroke. Similarly, decreasing the density decreases the number of bristles in the brush. With fewer bristles, less paint is applied in a stroke. Valid values are 1 to 100 and represent a percentage. A value of 100% results in the surface being completely covered with paint. A value of 1% results in very little paint being applied to the surface.
nOpacity | Value indicating the transparency of the brush touch when combined with the painting canvas. Valid values are between (0-255). A color or an image with an opacity of 255 is transparent. A color or an image with an opacity of 0 is completely opaque (solid).
nFadeOutRate | Value indicating the rate at which the brush contents will fade (become more transparent). Valid values are between (0-10000). 0 means no fade-out will occur. Other values (1-10000) will increase the transparency of the brush contents every nSpacing pixels, until total fade-out is reached.
pTexture | Pointer to the bitmap handle that references the bitmap used to simulate paper texture. This makes it appears as if the painting is done on paper having that texture. The BITMAPHANDLE pointer should still be valid after setting this field.

Comments

The default values for this structure are:

nSize = sizeof (PAINTBRUSH)
Touch.nContentsType = PAINT_TOUCH_CONTENTS_COLOR
Touch.crColor = RGB(0, 0, 0)
Touch.nShape = PAINT_TOUCH_SHAPE_CIRCLE
Touch.pBitmap = NULL
Touch.crTransparentColor = RGB(0, 0, 0)
nDiameter = 1
Hardness.nDistributionType = PAINT_HARDNESS_DISTRB_TYPE_0
Hardness.nValue = 1
nSpacing = 1
nDensity = 100
nOpacity = 0
nFadeOutRate = 0
pTexture = NULL

pPAINTBRUSH is a pointer to a PAINTBRUSH structure.


PAINTFILL

typedef struct _PAINTFILL
{
L_INT nSize;
L_UINT32 dwMask;
PAINTFILLSTYLE nStyle;
COLORREF crSolidFillColor;
pBITMAPHANDLE pBackgroundTileBitmap;
PAINTFILLGRADIENTSTYLE nGradientStyle;
COLORREF crGradientStartColor;
COLORREF crGradientEndColor;
L_UINT uGradientSteps;
COLORREF crUpperTolerance;
COLORREF crLowerTolerance;
L_INT nOpacity;
pBITMAPHANDLE pTexture;
} PAINTFILL, L_FAR *pPAINTFILL;

The PAINTFILL structure holds information used to fill an area.

Member | Description
nSize | Size of this structure.
dwMask | Flags that indicate which structure members contain valid information. Possible values are:
 | Value | Meaning
 | PFF_ALL | All the fields contain valid data.
 | PFF_STYLE | The nStyle field contains valid data.
 | PFF_SOLIDFILLCOLOR | The crSolidFillColor field contains valid data.
 | PFF_BACKGROUNDTILEBITMAP | The pBackgroundTileBitmap field contains valid data.
 | PFF_GRADIENTSTYLE | The nGradientStyle field contains valid data.
 | PFF_GRADIENTSTARTCOLOR | The crGradientStartColor field contains valid data.
 | PFF_GRADIENTENDCOLOR | The crGradientEndColor field contains valid data.
 | PFF_GRADIENTSTEPS | The uGradientSteps field contains valid data.
 | PFF_UPPERTOLERANCE | The crUpperTolerance field contains valid data.
 | PFF_LOWERTOLERANCE | The crLowerTolerance field contains valid data.
 | PFF_OPACITY | The nOpacity field contains valid data.
 | PFF_TEXTURE | The pTexture field contains valid data.
 | The values can be combined using the bit-wise OR operator ( | )
nStyle | An enumerated type that indicates the fill style. For a list of possible values, refer to PAINTFILLSTYLE.
crSolidFillColor | COLORREF value that specifies the color to use when nStyle is PAINT_FILL_STYLE_SOLID.
pBackgroundTileBitmap | Pointer to the bitmap handle referencing the bitmap to be used for filling, when nStyle is PAINT_FILL_STYLE_TILEDIMAGE. The BITMAPHANDLE pointer, should still be valid after setting this field.
nGradientStyle | An enumerated type that indicates the background gradient fill style. For a list of possible values, refer to PAINTFILLGRADIENTSTYLE.
crGradientStartColor | The COLORREF value that specifies the color to use as the starting color for the gradient fill.
crGradientEndColor | The COLORREF value that specifies the color to use as the ending color for the gradient fill.
uGradientSteps | Number of gradient fill steps. Valid values are 2 to 255.
crUpperTolerance | COLORREF value that contains the amount of upper variance allowed from the selected color. Valid values are between 0 and 255.
crLowerTolerance | COLORREF value that contains the amount of lower variance allowed from the selected color. Valid values are between 0 and 255.
nOpacity | Value indicating the transparency of the fill when combined with the painting canvas. Valid values are 0 to 255. A color or an image with an opacity of 255 is transparent. A color or an image with an opacity of 0 is completely opaque (solid).
pTexture | Pointer to the bitmap handle referencing the bitmap that will simulate paper texture. This gives the appearance of painting on paper having that texture. The BITMAPHANDLE pointer, should still be valid after setting this field.

Comments

The default values for this structure are:

nSize = sizeof (PAINTFILL)
nStyle = PAINT_FILL_STYLE_SOLID
crSolidFillColor = RGB (255, 255, 255)
pBackgroundTileBitmap = NULL
nGradientStyle = PAINT_FILL_GRADIENT_STYLE_RECTANGLE_TO_C
nGradientStartColor = RGB (0, 0, 0)
nGradientEndColor = RGB (255, 255, 255)
uGradientSteps = 255
crUpperTolerance = RGB (0, 0, 0)
crLowerTolerance = RGB (0, 0, 0)
nOpacity = 0
pTexture = NULL

pPAINTFILL is a pointer to a PAINTFILL structure.


PAINTFILLGRADIENTSTYLE

typedef enum
{
PAINT_FILL_GRADIENT_STYLE_NONE,
PAINT_FILL_GRADIENT_STYLE_LINE_L_TO_R = 1000,
PAINT_FILL_GRADIENT_STYLE_LINE_R_TO_L = 1001,
PAINT_FILL_GRADIENT_STYLE_LINE_T_TO_B = 1002,
PAINT_FILL_GRADIENT_STYLE_LINE_B_TO_T = 1003,
PAINT_FILL_GRADIENT_STYLE_LINE_LT_TO_RB = 1004,
PAINT_FILL_GRADIENT_STYLE_LINE_LB_TO_RT = 1005,
PAINT_FILL_GRADIENT_STYLE_LINE_RT_TO_LB = 1006,
PAINT_FILL_GRADIENT_STYLE_LINE_RB_TO_LT = 1007,
PAINT_FILL_GRADIENT_STYLE_LINE2_L_AND_R_TO_C = 1008,
PAINT_FILL_GRADIENT_STYLE_LINE2_C_TO_L_AND_R = 1009,
PAINT_FILL_GRADIENT_STYLE_LINE2_T_AND_B_TO_C = 1010,
PAINT_FILL_GRADIENT_STYLE_LINE2_C_TO_T_AND_B = 1011,
PAINT_FILL_GRADIENT_STYLE_LINE2_LT_AND_RB_TO_C = 1012,
PAINT_FILL_GRADIENT_STYLE_LINE2_C_TO_LT_AND_RB = 1013,
PAINT_FILL_GRADIENT_STYLE_LINE2_RT_AND_LB_TO_C = 1014,
PAINT_FILL_GRADIENT_STYLE_LINE2_C_TO_RT_AND_LB = 1015,

PAINT_FILL_GRADIENT_STYLE_ANGLE_TO_LT = 2000,
PAINT_FILL_GRADIENT_STYLE_ANGLE_TO_LB = 2001,
PAINT_FILL_GRADIENT_STYLE_ANGLE_TO_RT = 2002,
PAINT_FILL_GRADIENT_STYLE_ANGLE_TO_RB = 2003,
PAINT_FILL_GRADIENT_STYLE_ANGLE_FROM_LT = 2004,
PAINT_FILL_GRADIENT_STYLE_ANGLE_FROM_LB = 2005,
PAINT_FILL_GRADIENT_STYLE_ANGLE_FROM_RT = 2006,
PAINT_FILL_GRADIENT_STYLE_ANGLE_FROM_RB = 2007,

PAINT_FILL_GRADIENT_STYLE_RECTANGLE_TO_C = 3000,
PAINT_FILL_GRADIENT_STYLE_RECTANGLE_FROM_C = 3001,

PAINT_FILL_GRADIENT_STYLE_ELLIPSE_TO_C = 4000,
PAINT_FILL_GRADIENT_STYLE_ELLIPSE_FROM_C = 4001,

PAINT_FILL_GRADIENT_STYLE_CONE_FROM_L = 5000,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_R = 5001,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_T = 5002,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_B = 5003,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_LT = 5004,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_LB = 5005,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_RT = 5006,
PAINT_FILL_GRADIENT_STYLE_CONE_FROM_RB = 5007,

} PAINTFILLGRADIENTSTYLE, *pPAINTFILLGRADIENTSTYLE;

The PAINTFILLGRADIENTSTYLE enumerated type contains options for the background gradient fill style. These are the possible values for the nGradientStyle member of the PAINTFILL structure.


PAINTFILLSTYLE

typedef enum
{
PAINT_FILL_STYLE_SOLID,
PAINT_FILL_STYLE_GRADIENT,
PAINT_FILL_STYLETILEDIMAGE
} PAINTFILLSTYLE, *pPAINTFILLSTYLE;

The PAINTFILLSTYLE enumerated type contains options for the fill style used to fill an area. These are the possible values for the nStyle member of the PAINTFILL structure.


PAINTGROUP

typedef enum
{
PAINT_GROUP_BRUSH,
PAINT_GROUP_SHAPE,
PAINT_GROUP_REGION,
PAINT_GROUP_FILL,
PAINT_GROUP_TEXT
} PAINTGROUP ;

An enumeration type that determines the current paint group.

Comments

Each paint group represents a set of properties for a specific painting ability. For example, the paint group indicated by PAINT_GROUP_BRUSH represents the set of properties for the paintbrush. These properties are set using the PAINTBRUSH structure. Each paint group and its associated structure is given below:

Value | Meaning
PAINT_GROUP_BRUSH | Represents the paintbrush properties found in the PAINTBRUSH structure.
PAINT_GROUP_SHAPE | Represents the shape properties found in the PAINTSHAPE structure.
PAINT_GROUP_REGION | Represents the region properties found in the he PAINTREGION structure.
PAINT_GROUP_FILL | Represents the fill properties found in the PAINTFILL structure.
PAINT_GROUP_TEXT | Represents the text properties found in the PAINTTEXT structure.


PAINTHANDLE

The PAINTHANDLE structure serves as a working area for the painting functions. The user can initialize the paint handle at the start of program and save it in a variable. The paint handle can then be used with any LEAD DigitalPaint tools function. When the paint handle is no longer needed, the user can free it. Therefore, the user doesn’t have to initialize the paint handle and free it every time it is used.


PAINTHARDNESS

typedef struct _PAINTHARDNESS
{
PAINTHARDNESSDISTRBTYPE nDistributionType;
L_INT nValue;
} PAINTHARDNESS, L_FAR *pPAINTHARDNESS;

PAINTHARDNESS structure contains information used to control the sharpness of the brush edges.

Member | Description
nDistributionType | An enumerated type that indicates how the color will be distributed throughout the brush cross-section. For a list of possible values, refer to PAINTHARDNESSDISTRBTYPE.
nValue | Value indicating the hardness of the brush. Valid values are 1 to 100. The larger the value, the harder the brush.

Comments

The harder the brush, the more defined the edges of paint will be. With nValue set to 100, the paint stroke has sharply defined edges. As the hardness decreases, the brush edge softens.

pPAINTHARDNESS is a pointer to a PAINTHARDNESS structure.


PAINTHARDNESSDISTRBTYPE

typedef enum
{
PAINT_HARDNESS_DISTRB_TYPE_0
} PAINTHARDNESSDISTRBTYPE, *pPAINTHARDNESSDISTRBTYPE;

The PAINTHARDNESSDISTRBTYPE enumerated type contains options that describe the hardness distribution throughout a paintbrush.


PAINTREGION

typedef struct _PAINTREGION
{
L_INT nSize;
L_UINT32 dwMask;
COLORREF crUpperTolerance;
COLORREF crLowerTolerance;
L_INT nRoundRectEllipseWidth;
L_INT nRoundRectEllipseHeight;
} PAINTREGION, L_FAR *pPAINTREGION;

The PAINTREGION structure holds information used for creating a region.

Member | Description
nSize | Size of this structure.
dwMask | Flags that indicate which members contain valid information for the structure. Possible values are:
 | Value | Meaning
 | PRF_ALL | All the fields contain valid data..
 | PRF_UPPERTOLERANCE | The crUpperTolerance field contains valid data.
 | PRF_LOWERTOLERANCE | The crLowerTolerance field contains valid data.
 | PRF_ROUNDRECTELLIPSEWIDTH | The nRoundRectEllipseWidth field contains valid data.
 | PRF_ROUNDRECTELLIPSEHEIGHT | The nRoundRectEllipseHeight field contains valid data.
 | The values can be combined using the bit-wise OR operator ( | )
crUpperTolerance | COLORREF value that contains the amount of upper variance allowed from the selected color. Valid values are between 0 and 255. The values of R, G and B will be used to check the tolerance.
crLowerTolerance | COLORREF value that contains the amount of lower variance allowed from the selected color. Valid values are between 0 and 255. The values of R, G and B will be used to check the tolerance.
nRoundRectEllipseWidth | Value indicating the width, in pixels, of the ellipse used to create a round rectangle region. Valid values are 0 to 500.
nRoundRectEllipseHeight | Value indicating the height, in pixels, of the ellipse used to create a round rectangle region. Valid values are 0 to 500.

Comments

The default values for this structure are:

nSize = sizeof (PAINTREGION)
crUpperTolerance = RGB (0, 0, 0)
crLowerTolerance = RGB (0, 0, 0)
nRoundRectEllipseWidth = 0
nRoundRectEllipseHeight = 0

pPAINTREGION is a pointer to a PAINTREGION structure.


PAINTSHAPE

typedef struct _PAINTSHAPE
{
L_INT nSize;
L_UINT32 dwMask;
PAINTSHAPEBACKSTYLE nBackgroundStyle;
COLORREF crBackgroundColor;
pBITMAPHANDLE pBackgroundTileBitmap;
PAINTSHAPEBORDERSTYLE nBorderStyle;
L_INT nBorderWidth;
PAINTSHAPEBORDERBRUSHSTYLE nBorderBrushStyle;
COLORREF crBorderColor;
HBITMAP hBorderTileBitmap;
PAINTSHAPEGRADIENTSTYLE nGradientStyle;
COLORREF crGradientStartColor;
COLORREF crGradientEndColor;
L_UINT uGradientSteps;
PAINTSHAPEBORDERENDCAP nBorderEndCap;
L_INT nRoundRectEllipseWidth;
L_INT nRoundRectEllipseHeight;
L_INT nOpacity;
pBITMAPHANDLE pTexture;
} PAINTSHAPE, L_FAR *pPAINTSHAPE;

The PAINTSHAPE structure holds information about shapes.

Member | Description
nSize | Size of this structure.
dwMask | Flags that indicate which structure members contain valid information. Possible values are:
 | Value | Meaning
 | PSF_ALL | All the fields contain valid data.
 | PSF_BACKGROUNDSTYLE | The nBackgroundStyle field contains valid data.
 | PSF_BACKGROUNDCOLOR | The crBackgroundColor field contains valid data.
 | PSF_BACKGROUNDTILEBITMAP | The pBackgroundTileBitmap field contains valid data.
 | PSF_BORDERSTYLE | The nBorderStyle field contains valid data.
 | PSF_BORDERWIDTH | The nBorderWidth field contains valid data.
 | PSF_BORDERBRUSHSTYLE | The nBorderBrushStyle field contains valid data.
 | PSF_BORDERCOLOR | The crBorderColor field contains valid data.
 | PSF_BORDERTILEBITMAP | The hBorderTileBitmap field contains valid data.
 | PSF_GRADIENTSTYLE | The nGradientStyle field contains valid data.
 | PSF_GRADIENTSTARTCOLOR | The crGradientStartColor field contains valid data.
 | PSF_GRADIENTENDCOLOR | The crGradientEndColor field contains valid data.
 | PSF_GRADIENTSTEPS | The uGradientSteps field contains valid data.
 | PSF_BORDERENDCAP | The nBorderEndCap field contains valid data.
 | PSF_ROUNDRECTELLIPSEWIDTH | The nRoundRectEllipseWidth field contains valid data.
 | PSF_ROUNDRECTELLIPSEHEIGHT | The nRoundRectEllipseHeight field contains valid data.
 | PSF_OPACITY | The nOpacity field contains valid data.
 | PSF_TEXTURE | The pTexture field contains valid data.
 | The values can be combined using the bitwise OR operator ( | )
nBackgroundStyle | An enumerated type that indicates the shape's background style. For a list of possible values, refer to PAINTSHAPEBACKSTYLE.
crBackgroundColor | The COLORREF value that specifies the color to use for the shape's background color, when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_OPAQUE.
pBackgroundTileBitmap | Pointer to the bitmap handle referencing the bitmap to be used for the shape's background, when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_TILEDIMAGE. The BITMAPHANDLE pointer should still be valid after setting this field.
nBorderStyle | An enumerated type that indicates the shape's border style. For a list of possible values, refer to PAINTSHAPEBORDERSTYLE.
nBorderWidth | Value indicating the shape's border width, in pixels. Valid values are 1 to 100.
nBorderBrushStyle | Value indicating the brush style to be used to draw the shape's border. For a list of possible values, refer to PAINTSHAPEBORDERBRUSHSTYLE.
crBorderColor | The COLORREF value that specifies the color to be used to draw the shape's border.
hBorderTileBitmap | Specifies the DDB to be used to draw the shape's border. The DDB, should still be valid after setting this field.
nGradientStyle | Specifies the shape's background gradient type when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_GRADIENT. For a list of possible values, refer to PAINTSHAPEGRADIENTSTYLE.
crGradientStartColor | The COLORREF value that specifies the color to use as the starting color for the background gradient fill.
crGradientEndColor | The COLORREF value that specifies the color to use as the ending color for the background gradient fill.
uGradientSteps | Number of gradient color steps. Valid values are 2 to 255.
nBorderEndCap | An enumerated type that indicates how the ends of lines will be drawn. For a list of possible values, refer to PAINTSHAPEBORDERENDCAP.
nRoundRectEllipseWidth | Value indicating the width, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.
nRoundRectEllipseHeight | Value indicating the height, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.
nOpacity | Value indicating the transparency of the shape when combined with the painting canvas. Valid values are 0 to 255. A color or an image with an opacity of 255 is transparent a color or an image with an opacity of 0 is completely opaque (solid).
pTexture | Pointer to the bitmap handle that references the bitmap used to simulate paper texture. This makes it appear as if the painting is done on paper having that texture. The BITMAPHANDLE pointer should still be valid after setting this field.

Comments

The default values for this structure are:

nSize = sizeof (PAINTSHAPE)
nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_OPAQUE
crBackgroundColor = RGB (255, 255, 255)
pBackgroundTileBitmap = NULL
nBorderStyle = PAINT_SHAPE_BORDER_STYLE_SOLID
nBorderWidth = 1
nBorderBrushStyle = PAINT_SHAPE_BORDER_BRUSH_STYLE_COLOR
crBorderColor = RGB (0,0,0)
hBorderTileBitmap = NULL
nGradientStyle = PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_TO_C
crGradientStartColor = RGB (0,0,0)
crGradientEndColor = RGB (255, 255, 255)
uGradientSteps = 255
nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_SQUARE
nRoundRectEllipseWidth = 0
nRoundRectEllipseHeight = 0
nOpacity = 0
pTexture = NULL

pPAINTSHAPE is a pointer to a PAINTSHAPE structure.


PAINTSHAPEBACKSTYLE

typedef enum
{
PAINT_SHAPE_BACK_STYLE_TRANSPARENT,
PAINT_SHAPE_BACK_STYLE_OPAQUE,
PAINT_SHAPE_BACK_STYLE_TILEDIMAGE,
PAINT_SHAPE_BACK_STYLE_GRADIENT
} PAINTSHAPEBACKSTYLE, *pPAINTSHAPEBACKSTYLE;

The PAINTSHAPEBACKSTYLE enumerated type contains options for the background style of a shape. These are the possible values for the nBackgroundStyle member of the PAINTSHAPE structure.


PAINTSHAPEBORDERBRUSHSTYLE

typedef enum
{
PAINT_SHAPE_BORDER_BRUSH_STYLE_COLOR,
PAINT_SHAPE_BORDER_BRUSH_STYLE_PATTERN
} PAINTSHAPEBORDERBRUSHSTYLE, *pPAINTSHAPEBORDERBRUSHSTYLE;

The PAINTSHAPEBORDERBRUSHSTYLE enumerated type contains options for the border brush style of a shape. These are the possible values for the nBorderBrushStyle member of the PAINTSHAPE structure.


PAINTSHAPEBORDERENDCAP

typedef enum
{
PAINT_SHAPE_BORDER_ENDCAP_ROUND,
PAINT_SHAPE_BORDER_ENDCAP_SQUARE,
PAINT_SHAPE_BORDER_ENDCAP_FLAT
} PAINTSHAPEBORDERENDCAP, *pPAINTSHAPEBORDERENDCAP;

The PAINTSHAPEBORDERENDCAP enumerated type contains options for the border endcap of a shape. These are the possible values for the nBorderEndCap member of the PAINTSHAPE structure.

Comments

These values determine the shape of the ends of lines.


PAINTSHAPEBORDERSTYLE

typedef enum
{
PAINT_SHAPE_BORDER_STYLE_SOLID,
PAINT_SHAPE_BORDER_STYLE_DASH,
PAINT_SHAPE_BORDER_STYLE_DOT,
PAINT_SHAPE_BORDER_STYLE_DASHDOT,
PAINT_SHAPE_BORDER_STYLE_DASHDOTDOT
PAINT_SHAPE_BORDER_STYLE_DASHDOTDOTDOT
PAINT_SHAPE_BORDER_STYLE_DASH_GAP
PAINT_SHAPE_BORDER_STYLE_DOT_GAP
PAINT_SHAPE_BORDER_STYLE_DASHDOT_GAP
PAINT_SHAPE_BORDER_STYLE_DASHDOTDOT_GAP
PAINT_SHAPE_BORDER_STYLE_DASHDOTDOTDOT_GAP
PAINT_SHAPE_BORDER_STYLE_TRANSPARENT
} PAINTSHAPEBORDERSTYLE, *pPAINTSHAPEBORDERSTYLE;

The PAINTSHAPEBORDERSTYLE enumerated type contains options for the border style of a shape. These are the possible values for the nBorderStyle member of the PAINTSHAPE structure.


PAINTSHAPEGRADIENTSTYLE

typedef enum
{
PAINT_SHAPE_GRADIENT_STYLE_NONE,
PAINT_SHAPE_GRADIENT_STYLE_LINE_L_TO_R = 1000,
PAINT_SHAPE_GRADIENT_STYLE_LINE_R_TO_L = 1001,
PAINT_SHAPE_GRADIENT_STYLE_LINE_T_TO_B = 1002,
PAINT_SHAPE_GRADIENT_STYLE_LINE_B_TO_T = 1003,
PAINT_SHAPE_GRADIENT_STYLE_LINE_LT_TO_RB = 1004,
PAINT_SHAPE_GRADIENT_STYLE_LINE_LB_TO_RT = 1005,
PAINT_SHAPE_GRADIENT_STYLE_LINE_RT_TO_LB = 1006,
PAINT_SHAPE_GRADIENT_STYLE_LINE_RB_TO_LT = 1007,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_L_AND_R_TO_C = 1008,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_C_TO_L_AND_R = 1009,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_T_AND_B_TO_C = 1010,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_C_TO_T_AND_B = 1011,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_LT_AND_RB_TO_C = 1012,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_C_TO_LT_AND_RB = 1013,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_RT_AND_LB_TO_C = 1014,
PAINT_SHAPE_GRADIENT_STYLE_LINE2_C_TO_RT_AND_LB = 1015,

PAINT_SHAPE_GRADIENT_STYLE_ANGLE_TO_LT = 2000,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_TO_LB = 2001,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_TO_RT = 2002,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_TO_RB = 2003,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_FROM_LT = 2004,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_FROM_LB = 2005,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_FROM_RT = 2006,
PAINT_SHAPE_GRADIENT_STYLE_ANGLE_FROM_RB = 2007,

PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_TO_C = 3000,
PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_FROM_C = 3001,

PAINT_SHAPE_GRADIENT_STYLE_ELLIPSE_TO_C = 4000,
PAINT_SHAPE_GRADIENT_STYLE_ELLIPSE_FROM_C = 4001,

PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_L = 5000,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_R = 5001,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_T = 5002,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_B = 5003,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_LT = 5004,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_LB = 5005,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_RT = 5006,
PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_RB = 5007,

} PAINTSHAPEGRADIENTSTYLE, *pPAINTSHAPEGRADIENTSTYLE;

The PAINTSHAPEGRADIENTSTYLE enumerated type contains options for the gradient background style of a shape. These are the possible values for the nGradientStyle member of the PAINTSHAPE structure.


PAINTTEXT

typedef struct _PAINTEXT
{
L_INT nSize;
L_UINT32 dwMask;
LPTSTR pszText;
HFONT hFont;
PAINTTEXTBORDERBRUSHSTYLE nBorderBrushStyle;
L_INT nBorderWidth;
COLORREF crBorderColor;
PAINTTEXTBACKSTYLE nBackgroundStyle;
COLORREF crBackgroundColor;
pBITMAPHANDLE pBackgroundTileBitmap;
PAINTALIGNMENT nAlignment;
L_INT nOpacity;
pBITMAPHANDLE pTexture;
PAINTTRANSFORM TransformInfo;
} PAINTEXT, L_FAR *pPAINTEXT;

The PAINTTEXT structure contains information for drawing text.

Member | Description
nSize | Size of this structure.
dwMask | Flags that indicate which structure members contain valid information. Possible values are:
 | Value | Meaning
 | PTF_ALL | All the fields contain valid data.
 | PTF_TEXT | The pszText field contains valid data.
 | PTF_FONT | The hFont field contains valid data.
 | PTF_BORDERBRUSHSTYLE | The nBorderBrushStyle field contains valid data.
 | PTF_BORDERWIDTH | The nBorderWidth field contains valid data.
 | PTF_BORDERCOLOR | The crBorderColor field contains valid data.
 | PTF_BACKGROUNDSTYLE | The nBackgroundStyle field contains valid data.
 | PTF_BACKGROUNDCOLOR | The crBackgroundColor field contains valid data.
 | PTF_BACKGROUNDTILEBITMAP | The pBackgroundTileBitmap field contains valid data.
 | PTF_ALIGNMENT | The nAlignment field contains valid data.
 | PTF_OPACITY | The nOpacity field contains valid data.
 | PTF_TEXTURE | The pTexture field contains valid data.
 | PTF_TRANSFORMINFO | The TransformInfo field contains valid data.
 | The values can be combined using the bit-wise OR operator ( | ).
pszText | Character string that contains the string to be drawn. The toolkit will copy this string to its internal data.
hFont | The font used to paint the text. This font should be a true type font. The toolkit will not copy this handle. Therefore, this font handle should still be valid after setting this field.
nBorderBrushStyle | An enumerated type that indicates the text border (outline) style. For a list of possible values, refer to PAINTTEXTBORDERBRUSHSTYLE.
nBorderWidth | Value that indicates the width or the text border, in pixels. Valid values are 1 to 100.
crBorderColor | The COLORREF value that specifies the color to use to draw the text border (outline).
nBackgroundStyle | An enumerated type that indicates the text background style. For a list of possible values, refer to PAINTTEXTBACKSTYLE.
crBackgroundColor | The COLORREF value that specifies the color to use for filling the text background when nBackgroundStyle is PAINT_TEXT_BACK_STYLE_OPAQUE.
pBackgroundTileBitmap | Pointer to the bitmap handle referencing the bitmap used to fill the text background when nBackgroundStyle is PAINT_TEXT_BACK_STYLE_TILEDIMAGE. The BITMAPHANDLE pointer should still be valid after setting this field.
nAlignment | An enumerated type that indicates text alignment. For a list of possible values, refer to PAINTALIGNMENT.
nOpacity | Value that indicates the transparency of the text when combined with the painting canvas. Valid values are 0 to 255. A color or an image with nOpacity of 255 is transparent. A color or an image with nOpacity of 0 is completely opaque (solid).
pTexture | Pointer to the bitmap handle referencing the bitmap that will simulate paper texture. Using a paper texture gives the appearance of painting on paper having that texture. The BITMAPHANDLE pointer should still be valid after setting this field.
TransformInfo | Structure that contains information used to transform the text output.
 | The nRotate structure field of TransformInfo will effect the text output result only when the nAlignment field is: (PAINT_ALIGNMENT_HCENTER | PAINT_ALIGNMENT_VCENTER )
 | Otherwise, the toolkit will consider nRotate to be 0.

Comments

The default values for this structure are:

nSize = sizeof (PAINTTEXT)
pszText = NULL
hFont = NULL
nBorderBrushStyle = PAINT_TEXT_BORDER_BRUSH_STYLE_COLOR
nBorderWidth = 1
crBorderColor = RGB (0, 0, 0)
nBackgroundStyle = PAINT_TEXT_BACK_STYLE_OPAQUE
crBackgroundColor = RGB (255, 255, 255)
pBackgroundTileBitmap = NULL
nAlignment = PAINT_ALIGNMENT_HCENTER|PAINT_ALIGNMENT_VCENTER
nOpacity = 0
pTexture = NULL
TransformInfo.nRotate = 0
TransformInfo.Scale.cx = 100
TransformInfo.Scale.cy = 100


PAINTTEXTBACKSTYLE

typedef enum
{
PAINT_TEXT_BACK_STYLE_TRANSPARENT,
PAINT_TEXT_BACK_STYLE_OPAQUE,
PAINT_TEXT_BACK_STYLE_TILEDIMAGE,
} PAINTTEXTBACKSTYLE ;

An enumeration type that determines the current text background style.


PAINTTEXTBORDERBRUSHSTYLE

typedef enum
{
PAINT_TEXT_BORDER_BRUSH_STYLE_TRANSPARENT,
PAINT_TEXT_BORDER_BRUSH_STYLE_COLOR,
} PAINTTEXTBORDERBRUSHSTYLE ;

An enumeration type that determines the current text border brush style.


PAINTTOUCH

typedef struct _PAINTTOUCH
{
PAINTTOUCHSHAPE nShape;
PAINTTOUCHCONTENTS nContentsType;
COLORREF crColor;
pBITMAPHANDLE pBitmap;
COLORREF crTransparentColor;
} PAINTTOUCH, L_FAR *pPAINTTOUCH;

The PAINTTOUCH structure contains information about a single paintbrush touch on the painting canvas. A paintbrush stroke is constructed from multiple paintbrush touches.

Member | Description
nShape | An enumeration type that controls the shape of the cross-section (tip) of the brush. For a list of possible values, refer to PAINTTOUCHSHAPE.
nContentsType | An enumeration type that indicates the contents of the paintbrush. For a list of possible values, refer to PAINTTOUCHCONTENTS.
crColor | The COLORREF value that specifies the color to use for the paintbrush when nContentsType is PAINT_TOUCH_CONTENTS_COLOR.
pBitmap | Pointer to the bitmap handle that references the bitmap that contains the paintbrush image when nContentsType is PAINT_TOUCH_CONTENTS_IMAGE. The BITMAPHANDLE pointer should still be valid after setting this field.
crTransparentColor | The COLORREF value that specifies the transparent color of the paintbrush image.

Comments

pPAINTTOUCH is a pointer to a PAINTTOUCH structure.


PAINTTOUCHCONTENTS

typedef enum PAINTTOUCHCONTENTS
{
PAINT_TOUCH_CONTENTS_COLOR,
PAINT_TOUCH_CONTENTS_IMAGE
} PAINTTOUCHCONTENTS, *pPAINTTOUCHCONTENTS;

The PAINTTOUCHCONTENTS enumerated type contains possible contents values for the nContentsType member of the PAINTTOUCH structure. This value represents the contents of a paintbrush.


PAINTTOUCHSHAPE

typedef enum PAINTTOUCHSHAPE
{
PAINT_TOUCH_SHAPE_CIRCLE
} PAINTTOUCHSHAPE, *pPAINTTOUCHSHAPE;

The PAINTTOUCHSHAPE enumerated type contains possible shape values for the nShape member of the PAINTTOUCH structure.


PAINTTRANSFORM

typedef struct _PAINTTRANSFORM
{
L_INT nRotate;
SIZE Scale;
} PAINTTRANSFORM, L_FAR * pPAINTTRANSFORM

The PAINTTRANSFORM structure contains information used to transform (scale and rotate) coordinates.

Member | Description
nRotate | Rotation angle. The angle is in degrees using anti clockwise direction.
Scale | Scaling factor.
 | cx will be used to scale the coordinates in the horizontal direction.
 | cy will be used to scale the coordinates in the vertical direction.
 | For example
 | Value | Meaning
 | 100 | The same dimensions.
 | 110 | 1.1 times the original dimensions
 | 120 | 1.2 times the original dimensions.
 | 10000 | 100 times larger than the original dimensions.
 | 99 | 0.99 times the original dimensions.
 | 98 | 0.98 times the original dimensions.
 | 1 | 0.01 times the original dimensions.


PAINTXFORM

typedef struct _PAINTXFORM
{
L_INT nZoom;
L_INT nXOffset;
L_INT nYOffset;
} PAINTXFORM, L_FAR* pPAINTXFORM;

The PAINTXFORM structure provides data for translating from the external coordinates, such as mouse position, to the device context (DC) or bitmap coordinates.

Member | Description
nZoom | The zooming factor that will be used by the toolkit to scale the user input. Valid values are between 1 and 10000. For example
 | Value | Meaning
 | 100 | The same dimensions.
 | 110 | 1.1 times the original dimensions
 | 120 | 1.2 times the original dimensions.
 | 10000 | 100 times larger than the original dimensions.
 | 99 | 0.99 times the original dimensions.
 | 98 | 0.98 times the original dimensions.
 | 1 | 0.01 times the original dimensions.
nXOffset | The X offset of the external representation of the DC or Bitmap.
nYOffset | The Y offset of the external representation of the DC or Bitmap.

Comments

When assigning an external representation to the toolkit, every point (Xa, Ya) in the an external representation is transformed by the toolkit to the point (Xc, Yc) by using the following steps:

1.

Add offsets:

Xb = Xa + nXOffset
Yb = Ya + nYOffset

2.

Multiply by scalars:

Xc = MulDiv (Xb, nZoom, 100 ) ;
Yc = MulDiv ( Yb, nZoom, 100 ) ;

pPAINTXFORM is a pointer to a PAINTXFORM structure.


PAINTDLGBRUSHINFO

typedef struct _PAINTDLGBRUSHINFO
{
L_INT nSize;
L_INT32 dwFlags;
L_TCHAR *pszTitle;
PAINTTOUCHCONTENTS nContentsType;
COLORREF crColor;
L_TCHAR ** ppszTouchImage;
L_UINT uTouchImageCount;
L_INT nActiveTouchImageItem;
COLORREF crTransparentColor;
L_INT nDiameter;
L_INT nHardnessValue;
L_INT nSpacing;
L_INT nDensity;
L_INT nOpacity;
L_INT nFadeOutRate;
L_TCHAR ** ppszPaperTexture;
L_UINT uPaperTextureCount;
L_INT nActivePaperTextureItem;

} PAINTDLGBRUSHINFO, L_FAR *pPAINTDLGBRUSHINFO;

The PAINTDLGBRUSHINFO structure contains information about the paintbrush properties dialog.

Member | Description
nSize | Size of this structure.
dwFlags | User interface flags for dialog. Determines the layout and action of the dialog. Possible values are:
 | Setting | Description
 | PAINT_DLG_BRUSH_SHOWALL | [0x00000001] show all controls
 | PAINT_DLG_BRUSH_SHOWTOUCHCONTENT | [0x00000002] show touch contents control
 | PAINT_DLG_BRUSH_SHOWTOUCHCOLOR | [0x00000004] show touch color control
 | PAINT_DLG_BRUSH_SHOWTOUCHIMAGE | [0x00000008] show touch image control
 | PAINT_DLG_BRUSH_SHOWDIAMETER | [0x00000010] show diameter control
 | PAINT_DLG_BRUSH_SHOWHARDNESS | [0x00000020] show hardness control
 | PAINT_DLG_BRUSH_SHOWSPACING | [0x00000040] show spacing control
 | PAINT_DLG_BRUSH_SHOWOPACITY | [0x00000080] show opacity control
 | PAINT_DLG_BRUSH_SHOWDENSITY | [0x00000100] show density control
 | PAINT_DLG_BRUSH_SHOWFADEOUTRATE | [0x00000200] show fadeout rate control
 | PAINT_DLG_BRUSH_SHOWTEXTURE | [0x00000400] show texture control
 | PAINT_DLG_BRUSH_SHOWDEFAULT | [0x00000800] show Default control
 | PAINT_DLG_BRUSH_INITUSEDEFAULT | [0x00001000] use the default values to initialize the dialog control.
 | PAINT_DLG_BRUSH_SHOWTRANSPARENTCOLOR | [0x00002000] show transparent color control.
pszTitle | Character string containing the dialog box caption text.
nContentsType | An enumeration type that represents the contents of the paintbrush. For a list of possible values, refer to PAINTTOUCHCONTENTS.
crColor | COLORREF value that specifies the paintbrush color when the nContentsType is PAINT_TOUCH_CONTENTS_COLOR.
ppszTouchImage | Array of strings containing the names of the images used to fill the touch image combo box.
uTouchImageCount | Number of strings used to fill the touch image combo box.
nActiveTouchImageItem | Index to the current image selected in the touch image combo box. This is a zero-based index.
crTransparentColor | This value represents the transparent color of the paintbrush image.
nDiameter | Value indicating the size of the brush in pixels. Valid values are between 1 and 200.
nHardnessValue | Value indicating the hardness of the brush. Valid values are between 1 and 100.
nSpacing | Value indicating how often the paintbrush tip touches the surface during a paint stroke. When the spacing is 30 this means that the brush tip will touch the painting surface once every 30 pixels. Valid values are between 1 and 1000.
nDensity | Value indicating the amount of paint the brush applies with each stroke. Increasing the density of the brush is comparable to increasing the number of bristles in the brush. With more bristles, more paint is applied in a stroke. Similarly, decreasing the density decreases the number of bristles in the brush. With fewer bristles, less paint is applied in a stroke. Valid values are 1 to 100 and represent a percentage. A value of 100% results in the surface being completely covered with paint. A value of 1% results in very little paint being applied to the surface.
nOpacity | Value indicating the transparency of the brush touch when combined with the painting canvas. Valid values are between 0 and 255. A color or an image with an opacity of 255 is transparent. A color or an image with an opacity of 0 is completely opaque (solid).
nFadeOutRate | Value indicating the rate at which the brush contents will fade (become more transparent). Valid values are between 0 and 10000. 0 means no fadeout will occur. Other values (1-10000) will increase transparency every nSpacing pixels until total transparency is reached.
ppszPaperTexture | Array of strings containing the names of the images used to fill the paper texture combo box.
uPaperTextureCount | Number of strings in the paper texture array.
nActivePaperTextureItem | Index of the current image selected in the paper texture combo box. This is a zero-based index.

Comment

The image below shows the paintbrush properties dialog:

When the uTouchImageCount field value is 0 or when the ppszTouchImage field value is NULL the following values are automatically set:

ppszTouchImage = NULL
uTouchImageCount = 0
nActiveTouchImageItem = -1

The nActivePaperTextureItem field value will be –1 when the user selects "none" from the paper texture combo box.

When the value of the nActivePaperTextureItem is set to –1, the current selection in the paper texture combo box will be "none".

When the user presses the default button, the dialog box will reset to the default values, for all fields, except nActiveTouchImageItem. The nActiveTouchImageItem value will be the value it was before the last call to the Dialog box.


PAINTDLGFILLINFO

typedef struct _PAINTDLGFILLINFO
{
L_INT nSize;
L_INT32 dwFlags;
L_TCHAR * pszTitle;
PAINTFILLSTYLE nStyle;
COLORREF crSolidFillColor
L_TCHAR ** ppszBackgroundTileBitmap;
L_UINT uBackgroundTileBitmapCount;
L_INT nActiveBackgroundTileBitmapItem;
PAINTFILLGRADIENTSTYLE nGradientStyle;
COLORREF crGradientStartColor;
COLORREF crGradientEndColor;
L_UINT uGradientSteps;
COLORREF crUpperTolerance;
COLORREF crLowerTolerance;
L_INT nOpacity;
L_TCHAR ** ppszPaperTexture;
L_UINT uPaperTextureCount;
L_INT nActivePaperTextureItem;

} PAINTDLGFILLINFO, L_FAR *pPAINTDLGFILLINFO ;

The PAINTDLGFILLINFO structure contains information about the fill properties dialog.

Member | Description
nSize | Size of this structure.
dwFlags | User interface flags for the dialog. Determines the layout and action of the dialog. Possible values are:
 | Setting | Description
 | PAINT_DLG_FILL_SHOWALL | [0x00000001] show All controls
 | PAINT_DLG_FILL_SHOWSTYLE | [0x00000002] show Style control
 | PAINT_DLG_FILL_SHOWSOLIDFILLCOLOR | [0x00000004] show Solid fill color control
 | PAINT_DLG_FILL_SHOWBKGRNDTILE | [0x00000008] show Background tile control
 | PAINT_DLG_FILL_SHOWGRADIENTSTYLE | [0x00000010] show Gradient style control
 | PAINT_DLG_FILL_SHOWGRADIENTDIRECTION | [0x00000020] show Gradient direction control
 | PAINT_DLG_FILL_SHOWGRADIENTPREVIEW | [0x00000040] show Gradient preview control
 | PAINT_DLG_FILL_SHOWGRADIENTSTARTCOLOR | [0x00000080] show Gradient start color control
 | PAINT_DLG_FILL_SHOWGRADIENTENDCOLOR | [0x00000100] show Gradient end color control
 | PAINT_DLG_FILL_SHOWGRADIENTSTEPS | [0x00000200] show Gradient steps control
 | PAINT_DLG_FILL_SHOWLOWERTOLERANCE | [0x00000400] show Lower tolerance control
 | PAINT_DLG_FILL_SHOWUPPERTOLERANCE | [0x00000800] show Upper tolerance control
 | PAINT_DLG_FILL_SHOWOPACITY | [0x00001000] show Opacity control
 | PAINT_DLG_FILL_SHOWTEXTURE | [0x00002000] show Paper texture control
 | PAINT_DLG_FILL_SHOWDEFAULT | [0x00004000] show Default control
 | PAINT_DLG_FILL_INITUSEDEFAULT | [0x00008000] use the initial default values for the dialog control
pszTitle | Character string containing the Dialog box caption text.
nStyle | An enumerated type indicating the fill style. For a list of possible values, refer to PAINTFILLSTYLE.
crSolidFillColor | COLORREF value containing the fill color to use when nStyle is PAINT_FILL_STYLE_SOLID.
ppszBackgroundTileBitmap | Array of strings containing the names of the images used to fill the background tile bitmap combo box.
uBackgroundTileBitmapCount | Number of strings in ppszBackgroundTileBitmap.
nActiveBackgroundTileBitmapItem | Index of the image currently selected in the background tile combo box. This is a zero-based index.
nGradientStyle | An enumerated type that represents the background gradient fill style. For a list of possible values, refer to PAINTFILLGRADIENTSTYLE.
crGradientStartColor | COLORREF value that specifies the color that will start the background gradient fill.
crGradientEndColor | COLORREF value that specifies the color that will end the background gradient fill.
uGradientSteps | Number of gradient fill steps. Valid values are between 2 and 255.
crUpperTolerance | COLORREF value that contains the amount of upper variance allowed from the selected color. Valid values are between 0 and 255.
crLowerTolerance | COLORREF value that contains the amount of lower variance allowed from the selected color. Valid values are between 0 and 255.
nOpacity | Value indicating the transparency of the fill when combined with the painting canvas. Valid values are 0 to 255. A color or an image with an opacity of 255 is transparent. A color or an image with an opacity of 0 is completely opaque (solid).
ppszPaperTexture | Array of strings containing the names of the images used to fill the paper texture combo box.
uPaperTextureCount | Number of strings in ppszPaperTexture.
nActivePaperTextureItem | Index of the currently selected image in the paper texture combo box. This is a zero-based index.

Comments

An image of the Fill dialog can be seen below.

When the uBackgroundTileBitmapCount field value is set to 0 or when the ppszBackgroundTileBitmap field value is set to NULL, the structure members shown below will automatically be set to the following values:

ppszBackgroundTileBitmap = NULL
uBackgroundTileBitmapCount = 0
nActiveBackgroundTileBitmapItem = -1

The nActivePaperTextureItem field value will be –1 when the user selects "none" from the paper texture combo box.

When the value of the nActivePaperTextureItem is set to –1, the current selection in the paper texture combo box will be "none".

When the user presses the default button, the dialog box will reset to the default values, for all fields, except nActiveBackgroundTileBitmapItem. The nActivebackgroundTileBitmapItem will be the value it was before the last call to the Dialog box.


PAINTDLGREGIONINFO

typedef struct _PAINTDLGREGIONINFO
{
L_INT nSize;
L_INT32 dwFlags;
L_TCHAR * pszTitle;
COLORREF crUpperTolerance;
COLORREF crLowerTolerance;
L_INT nRoundRectEllipseWidth;
L_INT nRoundRectEllipseHeight;

} PAINTDLGREGIONINFO, L_FAR *pPAINTDLGREGIONINFO ;

The PAINTDLGREGIONINFO structure contains information about the Region dialog.

Member | Description
nSize | Size of this structure.
dwFlags | User interface flags for the dialog. Determines the layout and action of the dialog. Possible values are:
 | Setting | Description
 | PAINT_DLG_REGION_SHOWALL | [0x00000001] show all controls
 | PAINT_DLG_REGION_SHOWLOWERTOLERANCE | [0x00000002] show Lower tolerance control
 | PAINT_DLG_REGION_SHOWUPPERTOLERANCE | [0x00000004] show Upper tolerance control
 | PAINT_DLG_REGION_SHOWELLIPSEWIDTH | [0x00000008] show Ellipse width control
 | PAINT_DLG_REGION_SHOWELLIPSEHEIGHT | [0x00000010] show Ellipse height control
 | PAINT_DLG_REGION_SHOWDEFAULT | [0x00000020] show Default control
 | PAINT_DLG_REGION_INITUSEDEFAULT | [0x00000040] use the initial default values for the dialog control
pszTitle | Character string containing the Dialog box caption text.
crUpperTolerance | COLORREF value that contains the amount of upper variance allowed from the selected color. Valid values are between 0 and 255. The values of R, G and B will be used to check the tolerance.
crLowerTolerance | COLORREF value that contains the amount of lower variance allowed from the selected color. Valid values are between 0 and 255. The values of R, G and B will be used to check the tolerance.
nRoundRectEllipseWidth | Value indicating the width, in pixels, of the ellipse used to create a round rectangle region. Valid values are 0 to 500.
nRoundRectEllipseHeight | Value indicating the height, in pixels, of the ellipse used to create a round rectangle region. Valid values are 0 to 500.

Comments

An image of the Region dialog can be seen below.


PAINTDLGSHAPEINFO

typedef struct _PAINTDLGSHAPEINFO
{
L_INT nSize;
L_INT32 dwFlags;
L_TCHAR * pszTitle;
PAINTSHAPEBACKSTYLE nBackgroundStyle;
COLORREF crBackgroundColor;
L_TCHAR ** ppszBackgroundTileBitmap;
L_UINT uBackgroundTileBitmapCount;
L_INT nActiveBackgroundTileBitmapItem;
PAINTSHAPEBORDERSTYLE nBorderStyle;
L_INT nBorderWidth;
PAINTSHAPEBORDERBRUSHSTYLE nBorderBrushStyle;
COLORREF crBorderColor;
L_TCHAR ** pszBorderTileBitmap;
L_UINT uBorderTileBitmapCount;
L_INT nActiveBorderTileBitmapItem;
PAINTSHAPEGRADIENTSTYLE nGradientStyle;
COLORREF crGradientStartColor;
COLORREF crGradientEndColor;
L_UINT uGradientSteps;
PAINTSHAPEBORDERENDCAP nBorderEndCap;
L_INT nRoundRectEllipseWidth;
L_INT nRoundRectEllipseHeight;
L_INT nOpacity;
L_TCHAR ** ppszPaperTexture;
L_UINT uPaperTextureCount;
L_INT nActivePaperTextureItem;

} PAINTDLGSHAPEINFO, L_FAR *pPAINTDLGSHAPEINFO ;

The PAINTDLGSHAPEINFO structure contains information about the Shape dialog.

Member | Description
nSize | Size of this structure.
dwFlags | User interface flags for the dialog. Determines the layout and action of the dialog. Possible values are:
 | Setting | Description
 | PAINT_DLG_SHAPE_SHOWALL | [0x00000001] show all controls
 | PAINT_DLG_SHAPE_SHOWBKGRNDSTYLE | [0x00000002] show Background style control
 | PAINT_DLG_SHAPE_SHOWBKOPAQUECOLOR | [0x00000004] show the opaque color control.
 | PAINT_DLG_SHAPE_SHOWGRADIENTSTYLE | [0x00000008] show Gradient style control.
 | PAINT_DLG_SHAPE_SHOWGRADIENTDIRECTION | [0x00000010] show Gradient direction control
 | PAINT_DLG_SHAPE_SHOWGRADIENTSTARTCOLOR | [0x00000020] show Gradient start color control
 | PAINT_DLG_SHAPE_SHOWGRADIENTENDCOLOR | [0x00000040] show Gradient end color control
 | PAINT_DLG_SHAPE_SHOWGRADIENTPREVIEW | [0x00000080] show Gradient preview control
 | PAINT_DLG_SHAPE_SHOWGRADIENTSTEPS | [0x00000100] show Gradient steps control
 | PAINT_DLG_SHAPE_SHOWBKGRNDTILE | [0x00000200] show Background tile control
 | PAINT_DLG_SHAPE_SHOWOPACITY | [0x00000400] show Opacity control.
 | PAINT_DLG_SHAPE_SHOWBORDERSTYLE | [0x00000800] show Border style control.
 | PAINT_DLG_SHAPE_SHOWBORDERWIDTH | [0x00001000] show Border width control.
 | PAINT_DLG_SHAPE_SHOWBORDERBRUSHSTYLE | [0x00002000] show Border brush style control.
 | PAINT_DLG_SHAPE_SHOWBORDERCOLOR | [0x00004000] show Border color control
 | PAINT_DLG_SHAPE_SHOWBORDERPATTERN | [0x00008000] show Border pattern control
 | PAINT_DLG_SHAPE_SHOWENDCAP | [0x00010000] show End cap control
 | PAINT_DLG_SHAPE_SHOWELLIPSEWIDTH | [0x00020000] show Ellipse width control
 | PAINT_DLG_SHAPE_SHOWELLIPSEHEIGHT | [0x00040000] show Ellipse height control
 | PAINT_DLG_SHAPE_SHOWTEXTURE | [0x00080000] show Paper texture control
 | PAINT_DLG_SHAPE_SHOWDEFAULT | [0x00100000] show Default control
 | PAINT_DLG_SHAPE_INITUSEDEFAULT | [0x00200000] use the initial default values for the dialog control
pszTitle | Character string containing the Dialog box caption text.
nBackgroundStyle | An enumerated type that indicates the background style. For a list of possible values, refer to PAINTSHAPEBACKSTYLE.
crBackgroundColor | COLORREF value that specifies the color to be used to fill the shape when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_OPAQUE.
ppszBackgroundTileBitmap | Array of strings containing the names of the images used to fill the background tile bitmap combo box.
uBackgroundTileBitmapCount | Number of strings in ppszBackgroundTileBitmap.
nActiveBackgroundTileBitmapItem | Index of the image currently selected in the paper texture combo box.
nBorderStyle | An enumerated type that indicates the border style. For a list of possible values, refer to PAINTSHAPEBORDERSTYLE.
nBorderWidth | Value indicating the width of the border, in pixels. Valid values are 1 to 100.
nBorderBrushStyle | An enumerated type that indicates the brush style used to draw the shape's border. For a list of possible values, refer to PAINTSHAPEBORDERBRUSHSTYLE.
crBorderColor | COLORREF value that specifies the color used to draw the shape's border.
ppszBorderTileBitmap | Array of strings containing the names of the images used to fill the border tile bitmap combo box.
uBorderTileBitmapCount | Number of strings in ppszBorderTileBitmap.
nActiveBorderTileBitmapItem | Index of the image currently selected in the background tile combo box.
nGradientStyle | An enumerated type that indicates the shape's background gradient fill style. For a list of possible values, refer to PAINTSHAPEGRADIENTSTYLE.
crGradientStartColor | COLORREF value that specifies the color that will start the background gradient fill.
crGradientEndColor | COLORREF value that specifies the color that will end the background gradient fill.
uGradientSteps | Number of gradient color steps. Valid values are 2 to 255.
nBorderEndCap | An enumerated type that indicates how the ends of lines will be drawn. For a list of possible values, refer to PAINTSHAPEBORDERENDCAP.
nRoundRectEllipseWidth | Value indicating the width, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.
nRoundRectEllipseHeight | Value indicating the height, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.
nOpacity | Value indicating the transparency of the shape when combined with the painting canvas. Valid values are 0 to 255. A color or an image with an opacity of 255 is transparent a color or an image with an opacity of 0 is completely opaque (solid).
ppszPaperTexture | Array of strings containing the names of the images used to fill the paper texture combo box.
uPaperTextureCount | Number of strings in ppszPaperTexture.
nActivePaperTextureItem | Index of the currently selected image in the paper texture combo box.

Comments

An image of the Shape dialog can be seen below.

When the uBackgroundTileBitmapCount field value is set to 0 or when the ppszBackgroundTileBitmap field value is set to NULL, the structure members shown below will automatically be set to the following values:

ppszBackgroundTileBitmap= NULL
uBackgroundTileBitmapCount= 0
nActiveBackgroundTileBitmapItem = -1

When the uBorderTileBitmapCount field value is set to 0 or when the ppszBorderTileBitmap field value is set to NULL, the structure members shown below will automatically be set to the following values:

ppszBorderTileBitmap = NULL
uBorderTileBitmapCount = 0
nActiveBorderTileBitmapItem = -1

The nActivePaperTextureItem field value will be –1 when the user selects "none" from the paper texture combo box.

When the value of the nActivePaperTextureItem is set to –1, the current selection in the paper texture combo box will be "none".

When the user presses the default button, the dialog box will reset to the default values, for all fields, except nActiveBackgroundTileBitmapItem. The nActiveBorderTileBitmapItem value will be the value it was before the last call to the Dialog box.


PAINTDLGTEXTINFO

typedef struct _PAINTDLGTEXTINFO
{
L_INT nSize;
L_INT32 dwFlags;
L_TCHAR * pszTitle;
L_TCHAR * pszText;
LOGFONT logFont;
PAINTTEXTBORDERBRUSHSTYLE nBorderBrushStyle;
L_INT nBorderWidth;
COLORREF crBorderColor;
PAINTTEXTBACKSTYLE nBackgroundStyle;
COLORREF crBackgroundColor;
L_TCHAR ** ppszBackgroundTileBitmap;
L_UINT uBackgroundTileBitmapCount;
L_INT nActiveBackgroundTileBitmapItem;
PAINTALIGNMENT nAlignment;
L_INT nOpacity;
L_TCHAR ** ppszPaperTexture;
L_UINT uPaperTextureCount;
L_INT nActivePaperTextureItem;
PAINTTRANSFORM TransformInfo;

} PAINTDLGTEXTINFO, L_FAR *pPAINTDLGTEXTINFO;

The PAINTDLGTEXTINFO structure contains information about the Text dialog.

Member | Description
nSize | Size of this structure.
dwFlags | User interface flags for the dialog. Determines the layout and action of the dialog. Possible values are:
 | Setting | Description
 | PAINT_DLG_TEXT_SHOWALL | [0x00000001] show all controls
 | PAINT_DLG_TEXT_SHOWTEXT | [0x00000002] show Text control
 | PAINT_DLG_TEXT_SHOWBKGRNDSTYLE | [0x00000004] show Background style control
 | PAINT_DLG_TEXT_SHOWBKGRNDOPAQUECOLOR | [0x00000008] show Background Opaque color control
 | PAINT_DLG_TEXT_SHOWBKGRNDTILE | [0x00000010] show Background tile control
 | PAINT_DLG_TEXT_SHOWBORDERSTYLE | [0x00000020] show Border style control
 | PAINT_DLG_TEXT_SHOWBORDERWIDTH | [0x00000040] show border width control
 | PAINT_DLG_TEXT_SHOWBORDERCOLOR | [0x00000080] show Border color control
 | PAINT_DLG_TEXT_SHOWHORZALIGNMENT | [0x00000100] show Horizontal Alignment control
 | PAINT_DLG_TEXT_SHOWVERTALIGNMENT | [0x00000200] show Vertical Alignment control
 | PAINT_DLG_TEXT_SHOWROTATE | [0x00000400] show Rotate control
 | PAINT_DLG_TEXT_SHOWSCALE | [0x00000800] show Scale control
 | PAINT_DLG_TEXT_SHOWTRUETYPEFONT | [0x00001000] show True type font control
 | PAINT_DLG_TEXT_SHOWOPACITY | [0x00002000] show Opacity control
 | PAINT_DLG_TEXT_SHOWTEXTURE | [0x00004000] show Paper texture control
 | PAINT_DLG_TEXT_SHOWDEFAULT | [0x00008000] show Default control
 | PAINT_DLG_TEXT_INITUSEDEFAULT | [0x00010000] use the initial default values for the dialog control
pszTitle | Character string containing the Dialog box caption text.
pszText | Character string containing the text string to be drawn. The toolkit will copy this string to its internal data.
logFont | Handle to the font used to paint the text. This font should be a true type font. The toolkit will not copy this handle. Therefore, this font handle should still valid after setting this field.
nBorderBrushStyle | An enumerated type that indicates the text border (outline) style. For a list of possible values, refer to PAINTTEXTBORDERBRUSHSTYLE.
nBorderWidth | Value indicating the width of the text border, in pixels. Valid values are 1 to 100.
crBorderColor | COLORREF value that contains the text border (outline) color.
nBackgroundStyle | An enumerated type that indicates the text background style. For a list of possible values, refer to PAINTTEXTBACKSTYLE.
crBackgroundColor | COLORREF value that contains the text background color.
ppszBackgroundTileBitmap | Array of strings containing the names of the images used to fill the background tile bitmap combo box.
uBackgroundTileBitmapCount | Number of strings in ppszBackgroundTileBitmap.
nActiveBackgroundTileBitmapItem | Index of the currently selected image in the background tile combo box.
nAlignment | An enumerated type that indicates text alignment. For a list of possible values, refer to PAINTALIGNMENT.
nOpacity | Value that indicates the transparency of the text when combined with the painting canvas. Valid values are 0 to 255. A color or an image with an opacity of 255 is transparent A color or an image with an opacity of 0 is completely opaque (solid).
ppszPaperTexture | Array of strings containing the names of the images used to fill the paper texture combo box.
uPaperTextureCount | Number of strings in ppszPaperTexture.
nActivePaperTextureItem | Index of the currently selected image in the paper texture combo box.
TransformInfo | Structure that contains information used to transform the text output.
 | The nRotate structure field of TransformInfo will effect the text output result only when the nAlignment field is: (PAINT_ALIGNMENT_HCENTER | PAINT_ALIGNMENT_VCENTER )
 | Otherwise, the toolkit will consider nRotate to be 0.

Comments

An image of the Text dialog can be seen below.

When the uBackgroundTileBitmapCount field value is set to 0 or when the ppszBackgroundTileBitmap field value is set to NULL, the structure members shown below will automatically be set to the following values:

ppszBackgroundTileBitmap = NULL
uBackgroundTileBitmapCount = 0
nActiveBackgroundTileBitmapItem = -1

The nActivePaperTextureItem field value will be –1 when the user selects "none" from the paper texture combo box.

When the value of the nActivePaperTextureItem is set to –1, the current selection in the paper texture combo box will be "none".

When the user presses the default button, the dialog box will reset to the default values, for all fields, except nActiveBackgroundTileBitmapItem. The nActivebackgroundTileBitmapItem field will be the value it was before the last call to the Dialog box.


Return Codes

For a list of all possible error codes for LEADTOOLS DigitalPaint Class Library, refer to LEADTOOLS Class Library Error Codes in the Main Class Library help file.


Using Class Library DigitalPaint Tools

Take the following steps to start a project and to add some code that creates a new paint window.

Note:

This example is for a 32-bit (NT or Windows 9x) environment.

Step 1

1. | Start Visual C++, version 5.
2. | Select the File->New menu option, click the "projects" tab.
3. | Select "MFC AppWizard".
4. | In the Project Name dialog box, enter "Tutorial".
5. | In the Location dialog box, use the examples\classlib\msvc5 directory of your LEAD installation. For example, if you installed LEADTOOLS in c:\ltwin14x, enter c:\ltwin14x\examples\classlib\msvc5\ Click OK.
6. | Choose Multiple Document and click "Next".
7. | The "MFC AppWizard step 2 of 6", appears. Keep the default settings and press the "Next" Button.
8. | The "MFC AppWizard step 3 of 6", appears. Keep the default settings and press the "Next" Button.
9. | The "MFC AppWizard step 4 of 6", appears. Uncheck the "Docking Toolbar" combo box.
10. | Uncheck the "Printing and print preview" combo box and press the "Finish" Button.

Step 2

1. | Choose Project->Settings.
2. | In the "Settings For" drop down box, choose "All Configurations".
3. | Click on the C/C++ tab.
4. | In the "Category" drop down box, choose "Preprocessor".
5. | In the "Additional include directories" dialog box, enter the include\classlib directory of your LEAD installation. For example, if you installed LEADTOOSL in c:\ltwin14x, enter c:\ltiwn14x\include\classlib then Press OK.
6. | Open the Stdafx.h file from the "File View" tab.
7. | Add the following lines before the "//{{AFX_INSERT_LOCATION}}" comment:

#include "ltwrappr.h"
class CTutorialApp;
class CTutorialView;
class CTutorialDoc;
#include "TutorialDoc.h"
#include "TutorialView.h"

The stdafx.h file should be something like this:

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__47B5950A_21D9_11D5_8F4C_0060087C0C73__INCLUDED_)
#define AFX_STDAFX_H__47B5950A_21D9_11D5_8F4C_0060087C0C73__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include "ltwrappr.h"
class CTutorialApp;
class CTutorialView;
class CTutorialDoc;

#include "TutorialDoc.h"
#include "TutorialView.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__47B5950A_21D9_11D5_8F4C_0060087C0C73__INCLUDED_)

Step 3

1. | Click on the "Class View" tab.
2. | Click to open the Tutorial Classes branch.
3. | Click "CTutorialApp", and then double click the CTutorialApp() constructor.
4. | Add the following lines after "//TODO: add construction code here":

LBase::LoadLibraries (LT_PDG|LT_KRN|LT_FIL|LT_DLG|LT_AUT|LT_CON|LT_TLB|LT_DIS);
L_UNLOCKSUPPORT(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
L_UNLOCKSUPPORT(L_SUPPORT_TIFLZW, L_KEY_TIFLZW);
L_UNLOCKSUPPORT(L_SUPPORT_DIGITALPAINT, L_KEY_DIGITALPAINT);

The function should be something like this:

CTutorialApp::CTutorialApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
LBase::LoadLibraries (LT_PDG|LT_KRN|LT_FIL|LT_DLG|LT_AUT|LT_CON|LT_TLB|LT_DIS);
L_UNLOCKSUPPORT(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
L_UNLOCKSUPPORT(L_SUPPORT_TIFLZW, L_KEY_TIFLZW);
L_UNLOCKSUPPORT(L_SUPPORT_DIGITALPAINT, L_KEY_DIGITALPAINT);
}

5. | Click on the "Class View" tab.
6. | Click to open the Tutorial Classes branch.
7. | Right click on "CTutorialApp", and select "Add Member Function&&quot;.
8. | In the Add Member Function Dialog, write "~CTutorialApp( );" on the Function Declaration text box and then press OK.
9. | Add the following lines inside the generated function":

LBase::UnloadLibraries (LT_PDG|LT_KRN|LT_FIL|LT_DLG|LT_AUT|LT_CON|LT_TLB|LT_DIS);

The function should be something like this:

CTutorialApp::~CTutorialApp()
{
LBase::UnloadLibraries
 (LT_PDG|LT_KRN|LT_FIL|LT_DLG|LT_AUT|LT_CON|LT_TLB|LT_DIS);
}

Step 4

1. | Click on the "Class View" tab.
2. | Click to open the Tutorial Classes branch.
3. | Click "CTutorialApp", and then double click the InitInstance() function.
4. | Add the following lines after the call to the ParseCommandLine function:

//Hide the Auto appearance window (View)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

The function should be something like this:

BOOL CTutorialApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

// Change the registry key under which our settings are stored.
// You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_TUTORITYPE,
RUNTIME_CLASS(CTutorialDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTutorialView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

//Hide the Auto appearance window (View)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;

// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}

Step 5

Select Project->Add To Project->Files... and browse to <your LEAD installation directory>\lib\ltwvc_n.lib.

Step 6

1. | Click on the "Class View" tab.
2. | Right click "CTutorialView" and select "Add Member Variable..."
3. | For Variable Type enter LRasterPaintWindow, and for Variable Declaration put m_RasterPntWnd. Leave Access as "Public" and click OK.
4. | Right click "CTutorialView" again and select "Add Member Variable..."
5. | For Variable Type enter LRasterDialog, and for Variable Declaration put m_PaintDialog leave Access as "Public" and click OK.
 | The Class declaration should be something like this:

class CTutorialView : public Cview
{
protected: // create from serialization only
CTutorialView();
DECLARE_DYNCREATE(CTutorialView)
// Attributes
public:
CRstDemoDoc* GetDocument();
// Operations
public:
LRasterPaintWindow m_RasterPntWnd;
LRasterDialog m_PaintDialog;

// Rest of class stuff goes here
}

Step 7

1. | Click on the "Class View" tab.
2. | Right click "CTutorialView" and select "Add Windows Message Handler..."
3. | Select "WM_CREATE" from "New Windows messages/events" list and click "Add and Edit" button.
4. | Add the following line of code before the " return 0;" line:

m_RasterPntWnd.SetWndHandle(m_hWnd);

The function should be something like this:

int CTutorialView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CView::OnCreate(lpCreateStruct) == -1)
return -1;

m_RasterPntWnd. SetWndHandle (m_hWnd);

return 0;
}

Step 8

1. | Click on the "Class View" tab.
2. | Click to open the Tutorial Classes branch.
3. | Click "CMainFrame", and then double click the "OnCreate" function.
4. | Add the following lines before the last "return 0;" line:

LRasterPaintWindow::Initialize();
LRasterPaintWindow::CreateToolbar(&m_LToolbar, m_hWnd, TEXT("Test Toolbar"));
LRasterPaintWindow::SetToolbar(&m_LToolbar);

POINT ptPos = {0, 0};
RECT rcClient;
CMainFrame::GetClientRect(&rcClient);
ptPos.x = rcClient.left + 2;
ptPos.y = rcClient.top + 2;
CMainFrame::ClientToScreen(&ptPos);
LRasterPaintWindow::SetToolbarPosition(&ptPos);
LRasterPaintWindow::ShowToolbar(TRUE);

The function should be something like this:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0(TEXT("Failed to create status bar\n"));
return -1; // fail to create
}

LRasterPaintWindow::Initialize();
LRasterPaintWindow::CreateToolbar(&m_LToolbar, m_hWnd, TEXT("Test Toolbar"));
LRasterPaintWindow::SetToolbar(&m_LToolbar);

POINT ptPos = {0, 0};
RECT rcClient;
CMainFrame::GetClientRect(&rcClient);
ptPos.x = rcClient.left + 2;
ptPos.y = rcClient.top + 2;
CMainFrame::ClientToScreen(&ptPos);
LRasterPaintWindow::SetToolbarPosition(&ptPos);
LRasterPaintWindow::ShowToolbar(TRUE);

return 0;
}

Step 9

1. | Click on the "Class View" tab.
2. | Right click "CMainFrame" and select "Add Windows Message Handler..."
3. | Select "WM_CLOSE" from "New Windows messages/events" list and click "Add and Edit" button.
4. | Add the following line of code before the call to " CMDIFrameWnd::OnClose" function:

LRasterPaintWindow::FreeToolbar (&m_LToolbar);
LRasterPaintWindow::Free ();

The function should be something like this:

void CMainFrame::OnClose()
{
LRasterPaintWindow::FreeToolbar (&m_LToolbar);
LRasterPaintWindow::Free();

CMDIFrameWnd::OnClose();
}

Step 10

1. | Click on the "Class View" tab.
2. | Right click "CMainFrame" and select "Add Member Variable..."
3. | For Variable Type enter LToolbar , and for Variable Declaration put m_LToolbar.
4. | Select Access as "Protected" and click OK.
 | The Class declaration should be something like this:

class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
// Generated message map functions
protected:
LToolbar m_LToolbar;
// rest of stuff goes here
}

Step 11

Handle Save & Update UI for it

1. | Click on the "Class View" tab.
2. | Right click "CTutorialView" and select "Add Windows Message Handler..."
3. | Select "ID_FILE_SAVE" from "Class or object to handle" list
4. | Select "COMMAND" from "New Windows messages/events" list and click "Add and Edit" button.
5. | The "Add Member Function" Dialog appears, write "OnFileSave" as the "Member function name", press OK.
 | Add the following lines of code after the "// TODO" comment line:

LBitmapBase* pLBtmpbase = m_RasterPntWnd.GetBitmap ();

BOOL bFlag = AfxGetMainWnd()->EnableWindow(FALSE);

pLBtmpbase->Dialog()->EnableAutoProcess (TRUE);
L_INT nRetCode = pLBtmpbase->Dialog()->DoModalFileSave;

if(nRetCode!=SUCCESS && nRetCode!=ERROR_DLG_CANCELED)
MessageBox(NULL, TEXT("Can't save to file. See if file is read only."), TEXT("File Save Error")),
B_ICONWARNING | MB_OK);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();

The function should be like this:

void CTutorialView::OnFileSave()
{
// TODO: Add your command handler code here
LBitmapBase* pLBtmpbase = m_RasterPntWnd.GetBitmap();

BOOL bFlag = AfxGetMainWnd()->EnableWindow(FALSE);
pLBtmpbase->Dialog()->EnableAutoProcess(TRUE);
L_INT nRetCode = pLBtmpbase->Dialog()->DoModalFileSave();

if(nRetCode!=SUCCESS && nRetCode!=ERROR_DLG_CANCELED)
MessageBox(NULL, TEXT("Can't save to file. See if file is read only."), TEXT("File Save Error"), MB_ICONWARNING | MB_OK);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();
}

Step 12

1. | Click on the "Class View" tab.
2. | Right click "CTutorialView" and select "Add Windows Message Handler..."
3. | Select "ID_FILE_SAVE" from "Class or object to handle" list
4. | Select "UPDATE_COMMAND_UI" from "New Windows messages/events" and click "Add and Edit" button.
5. | The "Add Member Function" Dialog appears, write " OnUpdateFileSave" as the "Member function name", press OK.
6. | Add the following lines of code after the "// TODO" comment line:

pCmdUI->Enable(m_RasterPntWnd. GetBitmap ()->IsAllocated());

The function should be like this:

void CTutorialView::OnUpdateFileSave(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable(m_RasterPntWnd. GetBitmap ()->IsAllocated());
}

Step 13

Handle Open & Update UI for it

1. | Click on the "Class View" tab.
2. | Right click "CTutorialApp" and select "Add Windows Message Handler..."
3. | Select "ID_FILE_OPEN" from "Class or object to handle" list
4. | Select "COMMAND" from "New Windows messages/events" list and click "Add and Edit" button.
5. | The "Add Member Function" Dialog appear, write "OnFileOpen" as the "Member function name", press OK.
6. | Add the following lines of code after the "// TODO" comment line:

POSITION pos = GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = GetNextDocTemplate(pos);
pDocTemplate->OpenDocumentFile((LPCTSTR)NULL);

The function should be like this:

void CTutorialApp::OnFileOpen()
{
// TODO: Add your command handler code here
POSITION pos = GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = GetNextDocTemplate(pos);
pDocTemplate->OpenDocumentFile((LPCTSTR)NULL);
}

Step 14

1. | Click on the "Class View" tab.
2. | Click to open the "Tutorial Classes" branch.
3. | Click on the "CTutorialDoc" to expand the functions branch.
4. | Double click on the "OnNewDocument" function to view the code.
5. | Place the following code after the // TODO: add reinitialization code here

POSITION pos = GetFirstViewPosition();
CTutorialView* pView = (CTutorialView*) GetNextView(pos);

L_TCHAR szTitle[200] = "[ ";
L_TCHAR szBuff[56]; /* file name */

LBitmapBase LBtmpbase;

BOOL bFlag = AfxGetMainWnd()->EnableWindow(FALSE);

LBtmpbase.Dialog()->EnableAutoProcess (TRUE);

if(LBtmpbase.Dialog()->DoModalFileOpen () == SUCCESS)
{
FILEOPENPARM FileParam;

LBtmpbase.Dialog()->GetFileOpenParameters (&FileParam);

L_INT nBitsPerPixel = FileParam.pBitmap->BitsPerPixel;

if (nBitsPerPixel != 1 && nBitsPerPixel != 4)
if(nBitsPerPixel != 8 && nBitsPerPixel != 16 && nBitsPerPixel != 24)
{
pView->MessageBox(NULL, TEXT("Your image format is not 1,4,8,16 or 24 bits per pixel"), TEXT("Error Opening Image"), MB_ICONWARNING | MB_OK);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();

return FALSE;
}

L_INT nRetCode = pView->m_RasterPntWnd.SetBitmap(&LBtmpbase);

if (nRetCode == SUCCESS)
{
LBtmpbase.Dialog()->GetFileName (szBuff, sizeof(szBuff));

lstrcat(szTitle, szBuff);
lstrcat(szTitle, TEXT(" ]"));

SetTitle(szTitle);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();
return TRUE;
}

pView->MessageBox(NULL, TEXT("Not Supported Format"), TEXT("Error Opening Image "), MB_ICONWARNING | MB_OK);
}

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();
return FALSE;

The function should be like this:

BOOL CTutorialDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;

// TODO: add reinitialization code here
// (SDI documents will reuse this document)

// TODO: Add your command handler code here
POSITION pos = GetFirstViewPosition();
CTutorialView* pView = (CTutorialView*) GetNextView(pos);

L_TCHAR szTitle[200] = "[ ";
L_TCHAR szBuff[56]; /* file name */

LBitmapBase LBtmpbase;

BOOL bFlag = AfxGetMainWnd()->EnableWindow(FALSE);

LBtmpbase.Dialog()->EnableAutoProcess (TRUE);

if(LBtmpbase.Dialog()->DoModalFileOpen () == SUCCESS)
{
FILEOPENPARM FileParam;

LBtmpbase.Dialog()->GetFileOpenParameters (&FileParam);

L_INT nBitsPerPixel = FileParam.pBitmap->BitsPerPixel;

if (nBitsPerPixel != 1 && nBitsPerPixel != 4)
if(nBitsPerPixel != 8 && nBitsPerPixel != 16 && nBitsPerPixel != 24)
{
pView->MessageBox(NULL, TEXT("Your image format is not 1,4,8,16 or 24 bits per pixel"), TEXT("Error Opening Image"), MB_ICONWARNING | MB_OK);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();

return FALSE;
}

L_INT nRetCode = pView->m_RasterPntWnd.SetBitmap (&LBtmpbase);

if (nRetCode == SUCCESS)
{

LBtmpbase.Dialog()->GetFileName (szBuff, sizeof(szBuff));

lstrcat(szTitle, szBuff);
lstrcat(szTitle, TEXT(" ]"));

SetTitle(szTitle);

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();
return TRUE;
}

pView->MessageBox(NULL, TEXT("Non-Supported Format"), TEXT("Error Opening Image "), MB_ICONWARNING | MB_OK);
}

bFlag = AfxGetMainWnd()->EnableWindow(TRUE);
AfxGetMainWnd()->SetActiveWindow();

return FALSE;
}

Step 15

Delete Save As menu Item

Delete New Menu Item

Delete Resent Files Menu Item

1. | Move to the "Resource View" tab.
2. | Double click the "Tutorial resources" to expand the branch.
3. | Double click the "Menu" item from the tree to show the available menus.
4. | Double click on the "IDR_MAINFRAME" item to view the menu.
5. | Select "File"à"New" form the displayed menu bar and press the "Del" key to delete this menu item.
6. | Do the same with the "Recent File" and the Separator menu items.
7. | Now double click on the "IDR_TUTORITYPE" item from the "Resource View" tab to view this menu.
8. | Delete the "Save As", "Recent File" and the Separator menu items from the "File" menu as we did in step (5).

Step 16

Handling Palette Changes

1. | Open the "Tutorial.h" file from the "File View" tab.
2. | Add this define statement after the "#include "resource.h" // main symbols" statement

#define WM_HANDLEPALETTE WM_APP + 0

3. | Click on the "Class View" tab.
4. | Right click "CMainFrame" and select "Add Windows Message Handler..."
5. | Select "WM_PALETTECHANGED" from "New Windows messages/events" list and click "Add and Edit" button.
6. | Add the following lines of code after the " CMDIFrameWnd::OnPaletteChanged(pFocusWnd); " line:

if(pFocusWnd!=NULL)
SendMessageToDescendants(WM_HANDLEPALETTE,(WPARAM)pFocusWnd ->m_hWnd, TRUE);

7. | Right click "CMainFrame" and select "Add Windows Message Handler..."
8. | Select "WM_QUERYNEWPALETTE" from "New Windows messages/events" list and click "Add and Edit" button.
9. | Replace the "return CMDIFrameWnd::OnQueryNewPalette();" statement with the following lines of code:

CMDIChildWnd* pMDIChildWnd = MDIGetActive();

if (pMDIChildWnd!=NULL)
{
CView* pView = pMDIChildWnd->GetActiveView();

if(pView!=NULL)
{
pView->SendMessage(WM_HANDLEPALETTE,0,FALSE);
return TRUE;
}
}
return FALSE;

10. | Right click "CMainFrame" and select "Add Windows Message Handler..."
11. | Select "WM_SYSCOLORCHANGE" from "New Windows messages/events" list and click "Add and Edit" button.
12. | Replace the "CMDIFrameWnd::OnSysColorChange();" statement with the following line of code which actually calls the OnQueryNewPalette() function:

OnQueryNewPalette();

The function should look like this:
void CMainFrame::OnSysColorChange()
{
OnQueryNewPalette();
}

13. | Select "View àClass Wizard".
14. | Select the "CTutorialView" from the "Class name" dropdown list.
15. | Select the "CTutorialView" from the "Object IDs" list.
16. | Select the "OnActivateView" from the "Messages" list and press the "Add Function" button, then press the "Edit Code" button.
17. | Write the following lines of code after the "// TODO: Add your specialized code here and/or call the base class" statement:

if(bActivate==TRUE&&pActivateView==this)
m_RasterPntWnd.HandlePalette (WM_QUERYNEWPALETTE,0,0);

18.

Open the "TutorialView.h" file from the "File View" tab and add the following line before the DECLARE_MESSAGE_MAP() statement:

afx_msg LRESULT OnHandlePalette(WPARAM wParam, LPARAM lParam);

19.

Open the "TutorialView.cpp" file from the "File View" tab and add the following line before the END_MESSAGE_MAP() statement:

ON_MESSAGE(WM_HANDLEPALETTE,OnHandlePalette)

20.

Now add the following lines of code to the end of the "TutorialView.cpp" file:

LRESULT CTutorialView::OnHandlePalette(WPARAM wParam, LPARAM lParam)
{
if(lParam==TRUE)
{
if(m_RasterPntWnd.HandlePalett (WM_PALETTECHANGED, wParam, 0)==FALSE)
m_RasterPntWnd.Repaint();
}
else
{
if(m_RasterPntWnd.HandlePalette(WM_QUERYNEWPALETTE, 0, 0)==FALSE)
m_RasterPntWnd.Repaint();
}

return TRUE;
}

Step 17

Show / Hide the Tool bar

1. | Move to the "Resource View" tab.
2. | Double click the "Tutorial resources" to expand the branch.
3. | Double click the "Menu" item from the tree to show the available menus.
4. | Double click on the "IDR_MAINFRAME" item to view the menu.
5. | Press on the "View" menu to view the menu items.
6. | You will notice that there is only one menu item, which is the "Status Bar", and there is an empty menu item below the previous mentioned menu item.
7. | Right click on this menu item and select "Properties".
8. | In the "Caption" edit box, write the word "&Toolbar" to name the menu and then close the dialog.
9. | Now do the same with the "IDR_TUTORITYPE" menu.
10. | Press View->ClassWizard menu to activate the class wizard.
11. | Select "Message Maps" tab and select " CMainFrame " as the Class name
12. | Select " ID_VIEW_TOOLBAR " from the "Object IDs" list box.
13. | Select "COMMAND" from the Messages list box.
14. | Press "Add Function" button à Press "OK" in the displayed dialog.
15. | Select " OnViewToolbar" from the Member functions list box.
16. | Press the "Edit Code" button
17. | Add the following line of code inside the generated function body:

LRasterPaintWindow::ShowToolbar (!m_LToolbar.IsVisible());

The function should be look like this:

void CMainFrame::OnViewToolBar()
{
LRasterPaintWindow::ShowToolbar(!m_LToolbar.IsVisible());
}

18. | Press View->ClassWizard menu to activate the class wizard.
19. | Select "Message Maps" tab and select " CMainFrame " as the Class name
20 | Select "ID_VIEW_TOOLBAR" from the "Object IDs" list box.
21. | Select "UPDATE_COMMAND_UI" from the Messages list box.
22. | Press "Add Function" button à Press "OK" in the displayed dialog.
23. | Select "OnUpdateViewToolbar" from the Member functions list box.
24. | Press the "Edit Code" button
25. | Add the following line of code inside the generated function body:

pCmdUI->SetCheck(m_LToolbar. IsVisible ());

The function should be look like this:

void CMainFrame::OnUpdateViewToolBar(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(m_LToolbar.IsVisible());
}

The following steps handling the "Show/Hide" of the toolbar from the second menu by making the application goes to the generated code in the Mainframe

1. | Now double click on the "IDR_TUTORITYPE" menu from the "Resource View" tab to view the menu.
2. | Select "ViewàToolbar" from the menu.
3. | Right click on this menu item and select "Class Wizard".
4. | Select the "CMainFrame" from the "Class name" dropdown list".
5. | Select the "COMMAND" item from the "Messages" list à press "Ok".
6. | Repeat the previous steps but select the "UPDATE_COMMAND_UI" item from the "Messages" list then press "OK".

Step 18

Here we will be dealing with one of the paint dialogs, which is the "Brush" dialog:

1. | Move to the "Resource View" tab.
2. | Double click the "Tutorial resources" to expand the branch.
3. | Double click the "Menu" item from the tree to show the available menus.
4. | Double click on the "IDR_TUTORITYPE" item to view the menu.
5. | Drag the empty menu next to the "Help" menu and drops it before the "Help" menu.
6. | Right click on the empty menu and select "Properties".
7. | In the "Caption" edit box enter "Properties" as the menu caption and then close the dialog
8. | A new menu item will appear within the created menu.
9. | Right click on the empty menu item and select "Properties".
10 | In the "Caption" edit box enter "&Brush" as the menu caption and then close the dialog
11. | Press View->ClassWizard menu to activate the class wizard.
12. | Select "Message Maps" tab and select " CMainFrame " as the Class name
13. | Select " ID_PROPERTIES_BRUSH" from the "Object IDs" list box.
14. | Select "COMMAND" from the Messages list box.
15. | Press "Add Function" button à Press "OK" in the displayed dialog.
16. | Select " OnPropertiesBrush" from the Member functions list box.
17. | Press the "Edit Code" button
18. | Add the following line of code inside the generated function body:

CTutorialApp* pTheApp = (CTutorialApp*)AfxGetApp();
PAINTDLGBRUSHINFO BrushDlgInfo;
PAINTBRUSH* pPaintBrush = m_RasterPntWnd.GetPaintBrush ();
L_INT nRetCode;
L_TCHAR* TouchBitmap [ ] = { "Leaf" };
L_TCHAR* TextureBitmap [ ] = { "Texture-00" };

BrushDlgInfo.dwFlags = PAINT_DLG_BRUSH_SHOWALL;
BrushDlgInfo.pszTitle = TEXT("Paintbrush Properties");
BrushDlgInfo.nContentsType = pPaintBrush->Touch.nContentsType;
BrushDlgInfo.crColor = pPaintBrush->Touch.crColor;
BrushDlgInfo.ppszTouchImage = TouchBitmap;
BrushDlgInfo.uTouchImageCount = 1;
BrushDlgInfo.nActiveTouchImageItem = 0;
BrushDlgInfo.nDiameter = pPaintBrush->nDiameter;
BrushDlgInfo.nHardnessValue = pPaintBrush->Hardness.nValue;
BrushDlgInfo.nSpacing = pPaintBrush->nSpacing;
BrushDlgInfo.nDensity = pPaintBrush->nDensity;
BrushDlgInfo.nOpacity = pPaintBrush->nOpacity;
BrushDlgInfo.nFadeOutRate = pPaintBrush->nFadeOutRate;
BrushDlgInfo.ppszPaperTexture = TextureBitmap;
BrushDlgInfo.uPaperTextureCount = 1;
BrushDlgInfo.nActivePaperTextureItem = ((pPaintBrush->pTexture != NULL) ? 0 : -1);

nRetCode = m_PaintDialog.DoModalBrush(m_hWnd, &BrushDlgInfo);

if(nRetCode == SUCCESS)
{
pPaintBrush->nSize = sizeof(PAINTBRUSH);
pPaintBrush->dwMask = PBF_ALL;
pPaintBrush->Touch.nContentsType = BrushDlgInfo.nContentsType;
pPaintBrush->Touch.crColor = BrushDlgInfo.crColor;
pPaintBrush->Touch.nShape = PAINT_TOUCH_SHAPE_CIRCLE;
pPaintBrush->Touch.pBitmap = ((BrushDlgInfo.nActiveTouchImageItem != -1) ? pTheApp->m_LBtmpBrush.GetHandle() : NULL);
pPaintBrush->Touch.crTransparentColor = RGB(0, 0, 0);
pPaintBrush->nDiameter = BrushDlgInfo.nDiameter;
pPaintBrush->Hardness.nDistributionType = PAINT_HARDNESS_DISTRB_TYPE_0;
pPaintBrush->Hardness.nValue = BrushDlgInfo.nHardnessValue;
pPaintBrush->nSpacing = BrushDlgInfo.nSpacing;
pPaintBrush->nDensity = BrushDlgInfo.nDensity;
pPaintBrush->nOpacity = BrushDlgInfo.nOpacity;
pPaintBrush->nFadeOutRate = BrushDlgInfo.nFadeOutRate;
pPaintBrush->pTexture = ((BrushDlgInfo.nActivePaperTextureItem != -1) ? pTheApp->m_LBtmpPaperTexture. GetHandle () : NULL);

m_RasterPntWnd.SetPaintBrush (pPaintBrush);
}
}

19.

Open the "Tutorial.h" file form the "File View" tab and add the following variables declaration after the "Public:" statement:

LBitmapBase m_LBtmpBrush;
LBitmapBase m_LBtmpPaperTexture;

20 | Copy the bitmaps you want to use in the dialog to the "Res" folder in your current directory.
21. | Now move to the "Resource View" tab.
22. | Right click on the "Tutorial resources" and select "Import" item.
23. | In the "Import Resource" dialog move to the "Res" directory where you copied the bitmaps, and select the "BitmapBrush" bitmap à "Import".
24. | Right click on the new added bitmap and select "Properties".
25. | Change the "ID" edit box to "IDB_BITMAP_BRUSH" and close the dialog.
26. | Repeat steps (29-32) to load the second bitmaps and give it the following ID "IDB_PAPER_TEXTURE"
27. | Move to the "Class View" tab.
28. | Right click on the "CTutorialApp" class and select "Add Member Function&".
29. | Enter "void" in the "Function Type" edit box and enter "LoadImages()" statement in the "Function Declaration" edit box à "Press "Ok".
30. | Add the following lines of code to the function body:

DIBSECTION dibsc;
BITMAPHANDLE TempBtmapHandle;

// load paper texture image.
HANDLE hBitmap = LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_PAPER_TEXTURE), IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

GetObject(hBitmap , sizeof (DIBSECTION), &dibsc);

L_CONVERTFROMDIB(&TempBtmapHandle, (LPBITMAPINFO) &dibsc.dsBmih, (L_UCHAR*)dibsc.dsBm.bmBits);

m_LBtmpPaperTexture. SetHandle (&TempBtmapHandle);
m_LBtmpPaperTexture. ChangeViewPerspective (TOP_LEFT);

DeleteObject((HBITMAP) hBitmap);

// load the brush image.
hBitmap = LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_BITMAP_BRUSH), IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

GetObject(hBitmap , sizeof (DIBSECTION), &dibsc);

L_CONVERTFROMDIB(&TempBtmapHandle, (LPBITMAPINFO) &dibsc.dsBmih, (L_UCHAR *)dibsc.dsBm.bmBits);

m_LBtmpBrush.SetHandle(&TempBtmapHandle);
m_LBtmpBrush.ChangeViewPerspective(TOP_LEFT);

DeleteObject((HBITMAP) hBitmap);

31. | Right click on the "CTutorialApp" class and select "Add Member Function&".
32. | Enter "void" in the "Function Type" edit box and enter "FreeImages()" statement in the "Function Declaration" edit box à "Press "Ok".
33. | Add the following lines of code to the function body:

m_LBtmpBrush. Free ();
m_LBtmpPaperTexture.Free();

34.

Add the following statement to the "InitInstance()" function in the "Tutorial.cpp" file before the "return TRUE" statement:

LoadImages();

35.

Add the following statement at the end of the "~CTutorialApp()" function in the "Tutorial.cpp" file

FreeImages();


LRasterPaint::LRasterPaint

#include "ltwrappr.h"

L_VOID LRasterPaint::LRasterPaint(L_VOID)

Constructs and initializes the member variables of the LRasterPaint object.

Returns

None

Comments

This is the constructor for the LRasterPaint class.

Required DLLs and Libraries

LTPNT

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:

LRasterPaint::~LRasterPaint, Class Members

Example

// this will call the default constructor and destructor when it is out of scope

LRasterPaint clsraster;


LRasterPaint::~LRasterPaint

#include "ltwrappr.h"

L_VOID LRasterPaint::~LRasterPaint(L_VOID)

Destroys the class object and frees any allocated variables and memory associated with the object.

Returns

None

Comments

This is the destructor for the LRasterPaint class.

Required DLLs and Libraries

LTPNT

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:

LRasterPaint::LRasterPaint, Class Members

Example

// this will call the default constructor and destructor when it is out of scope
LRasterPaint clsraster;


LRasterPaint::ApplyText

#include "Ltwrappr.h"

L_INT LRasterPaint::ApplyText(UserDC, prcRect)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */

Writes a character string in the specified rectangle.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that contains the bounding rectangle in which to write the text. This rectangle will also be used to align the text.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The text will be drawn using the current text properties. To determine the current text properties, call LRasterPaint::GetProperty. To set or change the current text properties, call LRasterPaint::SetProperty. For more information on the text properties, refer to the PAINTTEXT structure.

The text string and font must be set before calling this function. Otherwise, the function will return an error.

If UserDC is not NULL, the toolkit will paint the text on the specified device context. If UserDC is NULL, the text will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the text will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the text will be drawn to both the device context and the bitmap.

The font handle in the hFont field of the PAINTTEXT structure should still be valid after calling this function.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, Class Members
Topics: | Painting Text

Example

L_INT TextTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
PAINTTEXT text ;
RECT rcText ;
LOGFONT lf ;
HFONT hFont ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the required text font properties */
lf.lfHeight = 48 ;
lf.lfWidth = 0 ;
lf.lfEscapement = 0 ;
lf.lfOrientation = 0 ;
lf.lfWeight = FW_NORMAL ;
lf.lfItalic = FALSE ;
lf.lfUnderline = FALSE ;
lf.lfStrikeOut = FALSE ;
lf.lfCharSet = ANSI_CHARSET ;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS ;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS ;
lf.lfQuality = DEFAULT_QUALITY ;
lf.lfPitchAndFamily = FF_DONTCARE ;
lstrcpy(lf.lfFaceName, TEXT("Times New Roman"));

/* Create the desired text font */
hFont = CreateFontIndirect ( &lf ) ;

/* Get text properties */
rstp.GetProperty (PAINT_GROUP_TEXT, &text ) ;

/* Set the desired text properties */
text.nSize = sizeof ( PAINTTEXT ) ;
text.dwMask = PTF_TEXT | PTF_FONT | PTF_TRANSFORMINFO ;
text.pszText = TEXT("LEAD") ;
text.hFont = hFont ;
text.TransformInfo.nRotate = 45 ;

/* Set the new text properties */
rstp.SetProperty (PAINT_GROUP_TEXT, &text ) ;

/* Set the target text drawing box coordinates with respect to the DC dimensions */
SetRect ( &rcText, 10, 10, 200, 200 ) ;

/* Use the current text properties and the current transformations properties to draw the text to the DC (hDC) */
rstp.ApplyText ( pDC->m_hDC, &rcText ) ;

/* Delete the font object */
DeleteObject ( hFont ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::BrushLineTo

#include "Ltwrappr.h"

L_INT LRasterPaint::BrushLineTo(UserDC, nX, nY)

HDC UserDC; | /* handle to the device context */
L_INT nX; | /* x position */
L_INT nY; | /* y position */

Draws a paintbrush stroke from the current position to the specified point.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
nX | Specifies the x-coordinate of the new position.
nY | Specifies the y-coordinate of the new position.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The current position, which serves as the starting point for this function, is set using the LRasterPaint::BrushMoveTo function. If LRasterPaint::BrushMoveTo is not been called before LRasterPaint::BrushLineTo, the default starting point is (0, 0).

The paintbrush stroke will be drawn using the current paintbrush properties. To determine the current paintbrush properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTBRUSH structure.

If UserDC is not NULL, the toolkit will paint the paintbrush stroke on the specified device context. If UserDC is NULL, the paintbrush stroke will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the paintbrush stroke will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the paintbrush stroke will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::BrushMoveTo, Class Members
Topics: | Painting with a Brush

Example

For an example, refer to LRasterPaint::BrushMoveTo.


LRasterPaint::BrushMoveTo

#include "Ltwrappr.h"

L_INT LRasterPaint::BrushMoveTo(UserDC, nX, nY)

HDC UserDC; | /* handle to the device context */
L_INT nX; | /* x position */
L_INT nY; | /* y position */

Updates the current position of the paintbrush and paints a single brush touch.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
nX | Specifies the x-coordinate of the new position.
nY | Specifies the y-coordinate of the new position.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The paintbrush touch will be drawn using the current paintbrush properties. To determine the current paintbrush properties, call LRasterPaint::GetProperty. To set or change the current paintbrush properties, call LRasterPaint::SetProperty. For more information on the paintbrush properties, refer to the PAINTBRUSH structure.

If UserDC is not NULL, the toolkit will paint the paintbrush touch on the specified device context. If UserDC is NULL, the paintbrush touch will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the paintbrush touch will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the paintbrush touch will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::BrushLineTo, Class Members
Topics: | Painting with a Brush

Example

L_INT PaintbrushTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
PAINTBRUSH brush;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current paintbrush properties */
rstp.GetProperty (PAINT_GROUP_BRUSH, &brush ) ;

/* Set the required paintbrush properties */
brush.nSize = sizeof ( PAINTBRUSH ) ;
brush.dwMask = PBF_DIAMETER |
PBF_TOUCH |
PBF_SPACING ;
brush.nDiameter = 20 ;
brush.Touch.crColor = RGB ( 255, 0, 0 ) ;
brush.nSpacing = 25 ;

/* Set the new paintbruch properties */
rstp.SetProperty (PAINT_GROUP_BRUSH, &brush ) ;

/* Use the current paintbruch properties to draw a paintbruch strock to DC (hDC) */
rstp.BrushMoveTo ( pDC->m_hDC, 10, 10 ) ;
rstp.BrushLineTo ( pDC->m_hDC, 100, 100 ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::DrawShapeEllipse

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapeEllipse(UserDC, prcRect)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */

Draws an ellipse using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the ellipse’s bounding rectangle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The ellipse will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the ellipse on the specified device context. If UserDC is NULL, the ellipse will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the ellipse will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the ellipse will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, Class Members
Topics: | Painting a Shape

Example

L_INT DrawEllipseTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
PAINTSHAPE shape;
RECT rcShape;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP|
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 8 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.crBorderColor = RGB ( 255, 0, 255 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.crBackgroundColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 210, 210 ) ;

/* Use the current shape properties to draw an ellipse */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::DrawShapeLine

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapeLine(UserDC, nStartX, nStartY, nEndX, nEndY)

HDC UserDC; | /* handle to the device context */
L_INT nStartX; | /* x-coordinate of the starting point */
L_INT nStartY; | /* y-coordinate of the starting point */
L_INT nEndX; | /* x-coordinate of the ending point */
L_INT nEndY; | /* y-coordinate of the ending point */

Draws a line between the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
nStartX | Specifies the x-coordinate of the start position, in logical units.
nStartY | Specifies the y-coordinate of the start position, in logical units.
nEndX | Specifies the x-coordinate of the end position, in logical units.
nEndY | Specifies the y-coordinate of the end position, in logical units.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The line will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the line on the specified device context. If UserDC is NULL, the line will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the line will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the line will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, Class Members
Topics: | Painting a Shape

Example

L_INT DrawLineTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
PAINTSHAPE shape;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP ;
shape.nBorderWidth = 10 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DASHDOT ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Use the current shape properties to draw a line to the DC (hDC) */
rstp.DrawShapeLine ( pDC->m_hDC, 10, 10, 200, 200 ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::DrawShapePolyBezier

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapePolyBezier(UserDC, pptPoints, nCount)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoints; | /* pointer to an array of POINT structures */
L_INT nCount; | /* number of points */

Draws a polybezier using the specified points

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoints | Pointer to an array of POINT structures that contain the endpoints and control points of the curve(s).
nCount | Specifies the number of points in the pptPoints array. This value must be one more than three times the number of curves to be drawn, because each Bézier curve requires two control points and an endpoint, and the initial curve requires an additional starting point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The Bézier curve(s) will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the Bézier curve(s) on the specified device context. If UserDC is NULL, the Bézier curve(s) will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the Bézier curve(s) will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the Bézier curve(s) will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, Class Members
Topics: | Painting a Shape

Example

L_INT DrawPolyBezierTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
PAINTSHAPE shape;
POINT ptPolyBezier [5];

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 2 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DASH ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_FLAT ;
shape.crBackgroundColor = RGB ( 255, 255, 192 ) ;

/* set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* set the coordinates with respect to the DC dimensions*/
ptPolyBezier [ 0 ].x = 10 ;
ptPolyBezier [ 0 ].y = 10 ;
ptPolyBezier [ 1 ].x = 150 ;
ptPolyBezier [ 1 ].y = 15 ;
ptPolyBezier [ 2 ].x = 100 ;
ptPolyBezier [ 2 ].y = 160 ;
ptPolyBezier [ 3 ].x = 70 ;
ptPolyBezier [ 3 ].y = 10;
ptPolyBezier [ 4 ].x = 20 ;
ptPolyBezier [ 4 ].y = 20 ;

/* Use the current shape properties to draw a polyBezier to the DC (hDC) */
rstp.DrawShapePolyBezier ( pDC->m_hDC, ptPolyBezier, 4 ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::DrawShapePolygon

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapePolygon(UserDC, pptPoints, nCount)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoints; | /* pointer to an array of POINT structures */
L_INT nCount; | /* number of points */

Draws a polygon using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoints | Pointer to an array of POINT structures that specify the vertices of the polygon.
nCount | Specifies the number of vertices in the array. This value must be greater than 2.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The polygon is closed automatically by drawing a line from the last vertex to the first.

The polygon will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the polygon on the specified device context. If UserDC is NULL, the polygon will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the polygon will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the polygon will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, Class Members
Topics: | Painting a Shape

Example

L_INT DrawPolygonTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
PAINTSHAPE shape ;
POINT ptPolyPoints [ 5 ] ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERCOLOR |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 2 ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.crBackgroundColor = RGB ( 255, 255, 192 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* set the coordinates with respect to the DC dimensions*/
ptPolyPoints [ 0 ].x = 10 ;
ptPolyPoints [ 0 ].y = 10 ;
ptPolyPoints [ 1 ].x = 50 ;
ptPolyPoints [ 1 ].y = 15 ;
ptPolyPoints [ 2 ].x = 100 ;
ptPolyPoints [ 2 ].y = 160 ;
ptPolyPoints [ 3 ].x = 100 ;
ptPolyPoints [ 3 ].y = 100;
ptPolyPoints [ 4 ].x = 20 ;
ptPolyPoints [ 4 ].y = 60 ;

/* Use the current shape properties to draw a polygon to the DC (hDC) */
rstp.DrawShapePolygon ( pDC->m_hDC, ptPolyPoints, 5 ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::DrawShapeRectangle

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapeRectangle(UserDC, prcRect)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */

Draws a rectangle using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the rectangle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The rectangle will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the rectangle on the specified device context. If UserDC is NULL, the rectangle will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the rectangle will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the rectangle will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRoundRect, Class Members
Topics: | Painting a Shape

Example

For an example, refer to LRasterPaint::SetProperty .


LRasterPaint::DrawShapeRoundRect

#include "Ltwrappr.h"

L_INT LRasterPaint::DrawShapeRoundRect(UserDC, prcRect)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */

Draws a rounded rectangle using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the rounded rectangle to be drawn.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The rounded rectangle will be drawn using the current shape properties. To determine the current shape properties, call LRasterPaint::GetProperty. To set or change the current shape properties, call LRasterPaint::SetProperty. For more information on the shape properties, refer to the PAINTSHAPE structure.

If UserDC is not NULL, the toolkit will paint the rounded rectangle on the specified device context. If UserDC is NULL, the rounded rectangle will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the rounded rectangle will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the rounded rectangle will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterDialog::DoModalShape, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, Class Members
Topics: | Painting a Shape

Example

L_INT DrawRoundedRectTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
PAINTSHAPE shape;
RECT rcShape;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_ROUNDRECTELLIPSEWIDTH |
PSF_ROUNDRECTELLIPSEHEIGHT ;

shape.nBorderWidth = 5 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DASH ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_FLAT ;
shape.nRoundRectEllipseWidth = 30 ;
shape.nRoundRectEllipseHeight = 30 ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 200, 200 ) ;

/* Use the current shape properties to draw a rounded rectangle to the DC (hDC) */
rstp.DrawShapeRoundRect ( pDC->m_hDC, &rcShape ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::FillBorder

#include "Ltwrappr.h"

L_INT LRasterPaint::FillBorder(UserDC, pptPoint, crBorderColor)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoint; | /* pointer to a POINT structure */
COLORREF crBorderColor; | /* border color */

Fills an area starting at a specified point and continuing in all directions until finding the specified color.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoint | Pointer to a POINT structure that the toolkit will use as a starting point to fill the area.
crBorderColor | The COLORREF value that specifies the color to use as the filling boundary.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The filling procedure will be carried out using the current fill properties. To determine the current fill properties, call LRasterPaint::GetProperty. To set or change the current fill properties, call LRasterPaint::SetProperty. For more information on the fill properties, refer to the PAINTFILL structure.

Within the PAINTFILL structure, upper and lower tolerance values can be set for the border color specified in crBorderColor. For example, if the border color passed to this function has an RGB value of 40, 40 , 200, and the lower tolerance and upper tolerance set in the PAINTFILL structure are 10, 10, 10, and 5, 5, 5, respectively, then this function will recognize colors from 30, 30, 190 to 45, 45, 205 as the border color.

If UserDC is not NULL, the toolkit will paint on the specified device context. If UserDC is NULL, the toolkit will not paint on a device context.

The images below show an example of the results of calling LRasterPaint::FillBorder.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::SetDCExtents, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::GetDCExtents, LRasterPaint::FillColorReplace, LRasterPaint::FillSurface, LRasterDialog::DoModalFill, Class Members
Topics: | Filling an Area

Example

L_INT FillSurfaceTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
PAINTSHAPE shape ;
RECT rcShape ;
RECT rcDCExtents ;
POINT ptFill ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 8 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.crBorderColor = RGB ( 255, 0, 255 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.crBackgroundColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 210, 210 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Set the fill start point */
ptFill.x = 100 ;
ptFill.y = 100 ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
rstp.SetDCExtents ( &rcDCExtents ) ;

/* Fill the target area */
rstp.FillSurface ( pDC->m_hDC, &ptFill ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::FillColorReplace

#include "Ltwrappr.h"

L_INT LRasterPaint::FillColorReplace(UserDC, crColor)

HDC UserDC; | /* handle to the device context */
COLORREF crColor; | /* the color to be replaced */

Replaces every pixel using the current fill settings.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
crColor | The COLORREF value that specifies the color to be replaced.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The filling procedure will be carried out using the current fill properties. To determine the current fill properties, call LRasterPaint::GetProperty. To set or change the current fill properties, call LRasterPaint::SetProperty. For more information on the fill properties, refer to the PAINTFILL structure.

Within the PAINTFILL structure, upper and lower tolerance values can be set for the color specified in crColor. For example, if the color passed to this function has an RGB value of 40, 40 , 200, and the lower tolerance and upper tolerance set in the PAINTFILL structure are 10, 10, 10, and 5, 5, 5, respectively, then this function will replace colors from 30, 30, 190 to 45, 45, 205.

The images below show an example of the results of calling LRasterPaint::FillColorReplace.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::SetDCExtents, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::GetDCExtents, LRasterPaint::FillBorder, LRasterPaint::FillSurface, LRasterDialog::DoModalFill, Class Members
Topics: | Filling an Area

Example

L_INT FillColorReplaceTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
PAINTSHAPE shape ;
PAINTFILL fill ;
RECT rcShape ;
RECT rcDCExtents ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERCOLOR |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 10 ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.crBackgroundColor = RGB ( 255, 0, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions */
SetRect ( &rcShape, 10, 10, 60, 60 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 100, 10, 150, 60 ) ;
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 60, 60, 95, 95 ) ;
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 10, 100, 60, 150 ) ;
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 100, 100, 150, 150 ) ;
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
rstp.SetDCExtents ( &rcDCExtents ) ;

/* Set the required fill properties */
fill.nSize = sizeof ( PAINTFILL ) ;
fill.dwMask = PFF_STYLE ;
fill.nStyle = PAINT_FILL_STYLE_GRADIENT ;

/* Set the new fill properties */
rstp.SetProperty ( PAINT_GROUP_FILL, &fill ) ;

/* Fill the target area */
rstp.FillColorReplace ( pDC->m_hDC, RGB ( 255, 0, 0 ) ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::FillSurface

#include "Ltwrappr.h"

L_INT LRasterPaint::FillSurface(UserDC, pptPoint)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoint; | /* pointer to a POINT structure */

Fills an area, starting at a specified point and continuing in all directions, that contains a specified color and some tolerance.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoint | Pointer to a POINT structure that the toolkit will use as a starting point to fill the area. This color present at this point will specify the surface color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The filling procedure will be carried out using the current fill properties. To determine the current fill properties, call LRasterPaint::GetProperty. To set or change the current fill properties, call LRasterPaint::SetProperty. For more information on the fill properties, refer to the PAINTFILL structure.

Within the PAINTFILL structure, upper and lower tolerance values can be set for the border color specified in crBorderColor. For example, if the border color passed to this function has an RGB value of 40, 40 , 200, and the lower tolerance and upper tolerance set in the PAINTFILL structure are 10, 10, 10, and 5, 5, 5, respectively, then this function will recognize colors from 30, 30, 190 to 45, 45, 205 as the border color.

If UserDC is not NULL, the toolkit will paint on the specified device context. If UserDC is NULL, the toolkit will not paint on a device context.

The images below show an example of the results of calling LRasterPaint::FillSurface.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::SetDCExtents, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::GetDCExtents, LRasterPaint::FillColorReplace, LRasterPaint::FillBorder, LRasterDialog::DoModalFill, Class Members
Topics: | Filling an Area

Example

L_INT FillSurfaceTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
PAINTSHAPE shape ;
RECT rcShape ;
RECT rcDCExtents ;
POINT ptFill ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 8 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.crBorderColor = RGB ( 255, 0, 255 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.crBackgroundColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 210, 210 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Set the fill start point */
ptFill.x = 100 ;
ptFill.y = 100 ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
rstp.SetDCExtents ( &rcDCExtents ) ;

/* Fill the target area */
rstp.FillSurface ( pDC->m_hDC, &ptFill ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::Free

#include "Ltwrappr.h"

L_INT LRasterPaint::Free(L_VOID)

Frees the class object handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

This function should be called when a class object handle is no longer needed by an application.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::IsValid, LRasterPaint::Initialize, Class Members
Topics: | Initializing and Freeing DigitalPaint Handles

Example

For an example, refer to LRasterPaint::SetProperty .


LRasterPaint::GetClipRgn

#include "Ltwrappr.h"

L_INT LRasterPaint::GetClipRgn(phClipRgn)

pHRGN phClipRgn;

/* pointer to a Windows region handle */

Gets the current clipping region, set using the LRasterPaint::SetClipRgn function.

Parameter | Description
phClipRgn | Pointer to a Windows region handle to be updated with the current clipping region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The phClipRgn parameter is updated with a windows region, which is a snapshot of the current clipping region, used by the toolkit. The user is responsible for deleting this region.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetClipRgn, LRasterPaint::OffsetClipRgn, Class Members
Topics: | Setting a DigitalPaint Clipping Region

Example

L_VOID GetClipRgnTest ( LRasterPaint* pRstp )
{
HRGN hRgn, hClipRgn ;

/* create some region */
hRgn = CreateRectRgn ( 0, 0, 100, 100 ) ;

/* get the current painting tools clip region */
pRstp->GetClipRgn ( &hClipRgn ) ;

/* combine the regions */
CombineRgn ( hRgn, hClipRgn, hRgn, RGN_OR ) ;

/* set the painting tools new clip region */
pRstp->SetClipRgn ( hRgn ) ;

/* delete the regions */
DeleteObject ( ( HRGN ) hRgn ) ;
DeleteObject ( ( HRGN ) hClipRgn ) ;
}


LRasterPaint::GetDCExtents

#include "Ltwrappr.h"

L_INT LRasterPaint::GetDCExtents(prcRect)

LPRECT prcRect;

/* pointer to a RECT structure */

Gets the current Device Context (DC) boundaries, set using the LRasterPaint::SetDCExtents function.

Parameter | Description
prcRect | Pointer to a RECT structure to be updated with the current DC boundary information.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetDCExtents, LRasterPaint::GetTransformation, LRasterPaint::SetTransformation, LRasterPaint::SetMetrics, LRasterPaint::RegionSurface, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::FillSurface, LRasterPaint::FillBorder, LRasterPaint::FillColorReplace, LRasterPaint::PickColor, Class Members
Topics: | Setting General DigitalPaint Information

Example

For an example, refer to LRasterPaint::SetDCExtents.


LRasterPaint::GetProperty

#include "Ltwrappr.h"

L_INT LRasterPaint::GetProperty(nGroup, pProperty)

PAINTGROUP nGroup; | /* pointer to a paint handle */
L_VOID pProperty; | /* pointer to a PAINTXXX structure */

Gets the specified paint properties.

Parameter | Description
nGroup | Indicates the paint properties to get and the structure pointed to by pProperty. Possible values are:
 | Value | Meaning
 | PAINT_GROUP_BRUSH | Gets the Paintbrush properties. pProperty points to a PAINTBRUSH structure.
 | PAINT_GROUP_SHAPE | Gets the Paint shape properties. pProperty points to a PAINTSHAPE structure.
 | PAINT_GROUP_REGION | Gets the Paint region properties. pProperty points to a PAINTREGION structure.
 | PAINT_GROUP_FILL | Gets the Paint fill properties. pProperty points to a PAINTFILL structure.
 | PAINT_GROUP_TEXT | Gets the Paint fill properties. pProperty points to a PAINTTEXT structure.
pProperty | Pointer to a PAINTXXX structure to be updated with the specified property values. The type of structure that this parameter points to is indicated by the nGroup parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

If this function is called after the class object handle is initialized, the default values will be returned. For more information about the default property values, refer to:

PAINTBRUSH

PAINTSHAPE

PAINTREGION

PAINTFILL

PAINTTEXT

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterDialog::DoModalBrush, LRasterDialog::DoModalFill, LRasterDialog::DoModalRegion, LRasterDialog::DoModalShape, LRasterDialog::DoModalText, LRasterPaint::BrushLineTo, LRasterPaint::BrushMoveTo, LRasterPaint::ApplyText, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, Class Members
Topics: | Setting DigitalPaint Properties

Example

/* This example shows the minimum requirements for painting a rectangle shape
using some user defined properties */

L_INT CTest1View::OnPaintShape (CWnd* pWnd)
{
LRasterPaint rstp;
PAINTSHAPE shape ;
CDC* pDC = pWnd->GetDC() ;
RECT rcShapeRect ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/*Set the paint shape group properties */
rstp.GetProperty ( PAINT_GROUP_SHAPE, &shape ) ;

/* Do some check and chang to the required properties*/
if ( PAINT_SHAPE_BORDER_STYLE_SOLID == shape.nBorderStyle )
{
/* Set the desired shape properties using the field masks*/
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERSTYLE |
PSF_BORDERWIDTH |
PSF_BORDERENDCAP ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.nBorderWidth = 10 ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;

/*Set the paint shape group properties */
rstp.SetProperty ( PAINT_GROUP_SHAPE, &shape ) ;
}

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;

/* Use the current shape properties to draw an rectangle*/
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;

// Free the paint tools handle.
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::GetTransformation

#include "Ltwrappr.h"

L_INT LRasterPaint::GetTransformation(pXForm)

pPAINTXFORM pXForm;

/* pointer to a structure */

Gets the toolkit's current transformation information.

Parameter | Description
pXForm | Pointer to a PAINTXFORM structure to be updated with the current painting transformations.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The transformation information is used for translating from external coordinates, such as mouse position, to the device context (DC) and/or bitmap coordinates.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetTransformation, LRasterPaint::GetDCExtents, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, Class Members
Topics: | Setting General DigitalPaint Information

Example

L_INT OnPaintShape ( LRasterPaint &rstp, CWnd* pWnd, LBitmap* pBitmap )
{
CDC* pDC = pWnd->GetDC( ) ;
RECT rcView ;
RECT rcShapeRect ;
PAINTXFORM PntXForm ;

/* Get the Current painting transformations */
rstp.GetTransformation ( &PntXForm ) ;

rcView.left = - PntXForm.nXOffset ;
rcView.top = - PntXForm.nYOffset ;
rcView.right = rcView.left + MulDiv ( pBitmap->GetWidth ( ), PntXForm.nZoom, 100 ) ;
rcView.bottom = rcView.top + MulDiv ( pBitmap->GetHeight ( ), PntXForm.nZoom, 100 ) ;

/* paint the bitmap */
pBitmap->Paint( )->SetDC( pDC->m_hDC );
pBitmap->SetDstRect( &rcView );
pBitmap->Paint( )->PaintDC();

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 150, 150 ) ;

/* Use the current shape properties to draw a rectangle to DC (hDC) */
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;

/* Release the device context */
pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::Initialize

#include "Ltwrappr.h"

L_INT LRasterPaint::Initialize(L_VOID)

Initializes the paint handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

This function must be called before calling any other paint functions.

A paint handle is valid after calling LRasterPaint::Initialize, and will remain valid until LRasterPaint::Free is called.

For every call to LRasterPaint::Initialize there must be a call to LRasterPaint::Free.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::IsValid, LRasterPaint::Free, Class Members
Topics: | Initializing and Freeing DigitalPaint Handles

Example

For an example, refer to LRasterPaint::SetProperty.


LRasterPaint::IsValid

#include "Ltwrappr.h"

L_INT LRasterPaint::IsValid(L_VOID)

Determines the validity of the class object's paint handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The paint handle will be valid after calling LRasterPaint::Initialize, and will remain valid until LRasterPaint::Free is called.

The paint handle is a private member of the LRasterPaint class object. For more information about the paint handle, refer to the PAINTHANDLE structure.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::Initialize, LRasterPaint::Free, Class Members
Topics: | Initializing and Freeing DigitalPaint Handles

Example

L_INT CTest1View::Test ( LRasterPaint rstp, CWnd* pWnd )
{
if ( SUCCESS == rstp.IsValid () )
{
CDC* pDC = pWnd->GetDC();
RECT rcShape;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 150, 150 ) ;

/* Use the current shape properties to draw an ellipse*/
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

pWnd->ReleaseDC( pDC ) ;

}
else
{
pWnd->MessageBox (TEXT("Invalid PAINTHANDLE"), TEXT("Error"), MB_OK ) ;
}

return SUCCESS ;
}


LRasterPaint::OffsetClipRgn

#include "Ltwrappr.h"

L_INT LRsterPaint::OffsetClipRgn(nDX, nDY)

L_INT nDX; | /* horizontal offset */
L_INT nDY; | /* vertical offset */

Offsets the paint-clipping region of the device context (DC) and the bitmap.

Parameter | Description
nDX | The offset in the horizontal direction.
nDY | The offset in the vertical direction.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The toolkit will perform the necessary transformations to the offset values using the current painting transformation set by calling LRasterPaint::SetTransformation function. Therefore, the user should provide the offset values without any transformations.

Required DLLs and Libraries

LTPNT

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: | LrasterPaint::SetClipRgn, LRasterPaint::GetClipRgn, LRasterPaint::SetTransformation, LRasterPaint::GetTransformation, Class Members
Topics: | Setting a DigitalPaint Clipping Region

Example

L_VOID OffsetClipRgnTest ( LRasterPaint* pRstp )
{
HRGN hRgn ;

/* create some region */
hRgn = CreateRectRgn ( 0, 0, 100, 100 ) ;

/* set the painting tools new DC clip region */
pRstp->SetClipRgn ( hRgn ) ;

/* offset the current painting tools clipping region */
/* using the current transformatoin settings */
pRstp->OffsetClipRgn ( 10, 10 ) ;

/* delete the regions */
DeleteObject ( ( HRGN ) hRgn ) ;
}


LRasterPaint::PickColor

#include "Ltwrappr.h"

L_INT LRasterPaint::PickColor(UserDC, nX, nY, pcrDestColor)

HDC UserDC; | /* handle to the device context */
L_INT nX; | /* x-coordinate */
L_INT nY; | /* y-coordinate */
COLORREF * pcrDestColor; | /* pointer to a color */

Gets the color at the specified position.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. . The mapping mode of the device context must be MM_TEXT.
nX | X -coordinate of the position from which to get the color.
nY | Y -coordinate of the position from which to get the color.
pcrDestColor | Pointer to a COLORREF value to be updated with the color at the specified position.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will get the color at the specified position of the bitmap. Otherwise, the toolkit will get the color from the specified position of the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::GetTransformation, LRasterPaint::GetDCExtents, LRasterPaint::FillBorder, LRasterPaint::FillColorReplace, LRasterPaint::FillSurface, Class Members
Topics: | Filling an Area

Example

L_INT PickColorTest ( CWnd* pWnd, LBitmapBase* pLBitmap, L_INT nX, L_INT nY, COLORREF *pcrDestColor )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
HPALETTE hPalette ;
RECT rcSrc, rcDest ;
L_TCHAR buffer [ 80 ] ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

pLBitmap->Paint()->SetDC( pDC->m_hDC );

/* Create restriction palette (if needed) */
pLBitmap->SetPalette( pLBitmap->CreatePaintPalette( pDC->m_hDC ) );

/* Set the bitmap painting coordinates */
SetRect ( &rcSrc, 0, 0, pLBitmap->GetWidth( ), pLBitmap->GetHeight( ) ) ;

CopyRect ( &rcDest, &rcSrc ) ;

/* paint the bitmap */
pLBitmap->Paint()->SetDC( pDC->m_hDC );
pLBitmap->SetSrcRect( &rcSrc );
pLBitmap->SetDstRect( &rcDest );
pLBitmap->Paint()->PaintDC();

/* Set the extents of the DC that we are going to pick the color from */
rstp.SetDCExtents ( &rcDest ) ;

/* Get the color value */
rstp.PickColor ( pDC->m_hDC, nX, nY, pcrDestColor ) ;

/* Display the results */
wsprintf ( buffer,
TEXT("R:%d G:%d B:%d"),
GetRValue ( *pcrDestColor ),
GetGValue ( *pcrDestColor ),
GetBValue ( *pcrDestColor ) ) ;

pWnd->SetWindowText ( buffer ) ;

pLBitmap->Paint()->SetDC(NULL);

/* Release the DC */
pWnd->ReleaseDC( pDC ) ;

/* Delete the font object */
DeleteObject ( (HPALETTE ) hPalette ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

return SUCCESS ;
}


LRasterPaint::RegionBorder

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionBorder(UserDC, pptPoint, crBorderColor, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoint; | /* pointer to an array of POINT structures */
COLORREF crBorderColor; | /* region border color */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates a region starting at a specified point and continuing in all directions until finding the specified color.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoint | Pointer to a POINT structure that the toolkit will use as a starting point to create the region.
crBorderColor | The COLORREF value that specifies the color of the region boundaries.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

If the UserDC is not NULL, the user should set the DC boundaries before calling this function, by calling LRasterPaint::SetDCExtents.

The images below show the region created by setting the border color to red and clicking inside the red border.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionBorderTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( );
PAINTSHAPE shape ;
RECT rcShape ;
RECT rcDCExtents ;
POINT ptRegionStart ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERCOLOR |
PSF_BACKGROUNDSTYLE |
PSF_GRADIENTSTARTCOLOR |
PSF_GRADIENTENDCOLOR ;

shape.nBorderWidth = 10 ;
shape.crBorderColor = RGB ( 0, 255, 0 ) ;
shape.nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_GRADIENT ;
shape.crGradientStartColor = RGB ( 255, 255, 255 ) ;
shape.crGradientEndColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 210, 110 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Set the fill start point */
ptRegionStart.x = 100 ;
ptRegionStart.y = 100 ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
rstp.SetDCExtents (&rcDCExtents ) ;

/* Create the region */
rstp.RegionBorder ( pDC->m_hDC, &ptRegionStart, RGB ( 0, 255, 0 ), &hDestRgn) ;

/* Display the create region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionColor

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionColor(UserDC, crColor, phDestRgn)

HDC UserDC; | /* handle to the device context */
COLORREF crColor; | /* color used to create the region */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates a region that contains the specified color.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
crColor | The COLORREF value that specifies the color to use to create the region.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

If the UserDC is not NULL, the user should set the DC boundaries before calling this function, by calling LRasterPaint::SetDCExtents.

The images below show the region created by clicking inside the yellow area.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionColorTest ( CWnd* pWnd )
{
LRasterPaint LRsPaint ;
CDC* pDC = pWnd->GetDC( ) ;

PAINTSHAPE shape ;
RECT rcShape ;
RECT rcDCExtents ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != LRsPaint.Initialize ( ) )
{
return FAILURE ;
}

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_BACKGROUNDSTYLE |
PSF_GRADIENTSTARTCOLOR |
PSF_GRADIENTENDCOLOR ;

shape.nBorderWidth = 10 ;
shape.crBorderColor = RGB ( 0, 255, 0 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_GRADIENT ;
shape.crGradientStartColor = RGB ( 255, 255, 255 ) ;
shape.crGradientEndColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
LRsPaint.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions */
SetRect ( &rcShape, 10, 10, 60, 60 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
LRsPaint.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 100, 10, 150, 60 ) ;
LRsPaint.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 60, 60, 95, 95 ) ;
LRsPaint.DrawShapeRectangle ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 10, 100, 60, 150 ) ;
LRsPaint.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

SetRect ( &rcShape, 100, 100, 150, 150 ) ;
LRsPaint.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
LRsPaint.SetDCExtents (&rcDCExtents ) ;

/* Create the region */
LRsPaint.RegionColor ( pDC->m_hDC, RGB ( 0, 255, 0 ), &hDestRgn) ;

/* Display the create region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
LRsPaint.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionEllipse

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionEllipse(UserDC, prcRect, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates an elliptical region using the bounding rectangle, specified in prcRect.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the region boundaries
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT OnRegionTest ( CWnd* pWnd, LBitmap* pBitmap )
{
LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC( ) ;

RECT rcView ;
PAINTXFORM PntXForm ;
L_INT nXOffset, nYOffset ;
HRGN hRgn ;
RECT rcRegionRect ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

PntXForm.nZoom = m_nZoomFactor;
PntXForm.nXOffset = m_nHscroll;
PntXForm.nYOffset = m_nVscroll;

/* Set the painting transformations to relfect a zoom-in by 3:1 */
rstp.SetTransformation ( &PntXForm ) ;

/* set the painting rectangle */
SetRect ( &rcView, 0, 0, pBitmap->GetWidth( ), pBitmap->GetHeight( ) ) ;

if ( m_nZoomFactor < 100 )
{
nXOffset = - MulDiv ( m_nHscroll, 100, m_nZoomFactor ) ;
nYOffset = - MulDiv ( m_nVscroll, 100, m_nZoomFactor ) ;
}
else
{
nXOffset = - m_nHscroll ;
nYOffset = - m_nVscroll ;
}

OffsetRect ( &rcView, nXOffset, nYOffset ) ;

rcView.left = MulDiv ( rcView.left, m_nZoomFactor, 100 ) ;
rcView.top = MulDiv ( rcView.top, m_nZoomFactor, 100 ) ;
rcView.right = MulDiv ( rcView.right, m_nZoomFactor, 100 ) ;
rcView.bottom = MulDiv ( rcView.bottom, m_nZoomFactor, 100 ) ;

/* paint the bitmap */
pBitmap->Paint()->SetDC( pDC->m_hDC );
pBitmap->SetDstRect( &rcView );
pBitmap->Paint()->PaintDC();

/* Set the rectangle coordinates with respect to the DC dimensions*/
/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcRegionRect, 10, 10, 110, 110 ) ;

/* Use the current region properties and the current painting */
/* transformations to create an ellipse region */
rstp.RegionEllipse ( pDC->m_hDC, &rcRegionRect, &hRgn ) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/* Release the device context */
pWnd->ReleaseDC( pDC ) ;

pBitmap->Paint( )->SetDC(NULL);

/* Delete the region */
DeleteObject ( hRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

return SUCCESS ;
}


LRasterPaint::RegionPolygon

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionPolygon(UserDC, pptPoints, nCount, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoints; | /* pointer to an array of POINT structures */
L_INT nCount; | /* number of points */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates a polygonal region using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoints | Pointer to an array of POINT structures that specify the vertices of the polygon.
nCount | Specifies the number of vertices in the array. This value must be greater than 2.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionTest ( CWnd* pWnd )
{
//data member L_INT m_nZoomFactor = 500 ;
//data member L_INT m_nHscroll = 0 ;
//data member L_INT m_nVscroll = 0 ;

LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC( ) ;
POINT ptPolyPoints [ 5 ] ;
PAINTXFORM PntXForm ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

PntXForm.nZoom = m_nZoomFactor ;
PntXForm.nXOffset = m_nHscroll ;
PntXForm.nYOffset = m_nVscroll ;

/* Set the painting transformations to relfect a zoom in by 5:1 */
rstp.SetTransformation (&PntXForm ) ;

/* Set the coordinates with respect to the DC dimensions*/
ptPolyPoints [ 0 ].x = 10 ;
ptPolyPoints [ 0 ].y = 10 ;
ptPolyPoints [ 1 ].x = 50 ;
ptPolyPoints [ 1 ].y = 15 ;
ptPolyPoints [ 2 ].x = 70 ;
ptPolyPoints [ 2 ].y = 60 ;
ptPolyPoints [ 3 ].x = 120 ;
ptPolyPoints [ 3 ].y = 100;
ptPolyPoints [ 4 ].x = 20 ;
ptPolyPoints [ 4 ].y = 80 ;

/* Use the current region properties and the current painting
transformations to create a polygon region */
rstp.RegionPolygon ( pDC->m_hDC, ptPolyPoints, 5, &hDestRgn) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionRect

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionRect(UserDC, prcRect, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates a rectangular region using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the region boundaries.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
RECT rcRegion ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the painting transformations to their default values */
rstp.SetTransformation (NULL ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcRegion, 10, 10, 100, 100 ) ;

/* Use the current region properties and the current painting
transformations to create a rectangular region */
rstp.RegionRect ( pDC->m_hDC, &rcRegion, &hDestRgn) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionRoundRect

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionRoundRect(UserDC, prcRect, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPRECT prcRect; | /* pointer to a RECT structure */
pHRGN phDestRgn; | /* pointer to a region handle */

Create a rounded rectangle region using the specified points.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
prcRect | Pointer to a RECT structure that specifies the region boundaries.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( ) ;
RECT rcRegion;
HRGN hDestRgn;
PAINTREGION region;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

region.nSize = sizeof ( PAINTREGION ) ;
region.dwMask = PRF_ROUNDRECTELLIPSEWIDTH |
PRF_ROUNDRECTELLIPSEHEIGHT ;
region.nRoundRectEllipseWidth = 40 ;
region.nRoundRectEllipseHeight = 40 ;

rstp.SetProperty (PAINT_GROUP_REGION, &region ) ;

/* Set the painting transformations to their default values */
rstp.SetTransformation (NULL ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcRegion, 10, 10, 100, 100 ) ;

/* Use the current region properties and the current painting
transformations to create a round rect region */
rstp.RegionRoundRect ( pDC->m_hDC, &rcRegion, &hDestRgn) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionScale

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionScale(nHScaleFactor, nVScaleFactor, nAlignment, phDestRgn)

L_INT nHScaleFactor; | /* horizontal scale factor */
L_INT nVScaleFactor; | /* vetical scale factor */
PAINTALIGNMENT nAlignment; | /* alignment type*/
pHRGN phDestRgn; | /* pointer to the region handle */

Scales a region.

Parameter | Description
nHScaleFactor | Horizontal scale factor. Valid values are between 1 and 10000. For example:
 | Value | Meaning
 | 100 | The same dimensions.
 | 110 | 1.1 times the original dimensions.
 | 120 | 1.2 times the original dimensions.
 | 10000 | 100 times the original dimensions.
 | 99 | 0.99 times the original dimensions.
 | 98 | 0.98 times the original dimensions.
 | 1 | 0.01 times the original dimensions.
nVScaleFactor | Vertical scale factor. Valid values are between 1 and 10000. For example:
 | Value | Meaning
 | 100 | The same dimensions.
 | 110 | 1.1 times the original dimensions
 | 120 | 1.2 times the original dimensions.
 | 10000 | 100 times the original dimensions.
 | 99 | 0.99 times the original dimensions.
 | 98 | 0.98 times the original dimensions.
 | 1 | 0.01 times the original dimensions.
nAlignment | A value that determines how the scaled region will be aligned with respect to the original region. For a list of possible values, refer to PAINTALIGNMENT.
phDestRgn | Pointer to the region to be translated. After translation, the toolkit will delete the old region and replace it with the new one.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The user is responsible for deleting the resulting region.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionScaleTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
RECT rcRegion ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcRegion, 250, 110, 350, 210 ) ;

/* Use the current region properties and the current painting
transformations to create an ellipse region */
rstp.RegionEllipse ( pDC->m_hDC, &rcRegion, &hDestRgn ) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/* Scale the region */
rstp.RegionScale ( 300, 300,
( PAINTALIGNMENT ) (PAINT_ALIGNMENT_HCENTER | PAINT_ALIGNMENT_VCENTER),
&hDestRgn ) ;

/* Display the scaled region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionSurface

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionSurface(UserDC, pptPoint, phDestRgn)

HDC UserDC; | /* handle to the device context */
LPPOINT pptPoint; | /* pointer to an array of POINT structures */
pHRGN phDestRgn; | /* pointer to a region handle */

Creates a region, starting at a specified point and continuing in all directions, that contains a specific color.

Parameter | Description
UserDC | Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.
pptPoint | Pointer to a POINT stucture that the toolkit will use as a starting point to create the region. The color located at this point will specify the surface color.
phDestRgn | Pointer to the region handle to be updated with the resulting region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The region creation procedure will be carried out using the current region properties. To determine the current region properties, call LRasterPaint::GetProperty. To set or change the current region properties, call LRasterPaint::SetProperty. For more information on the region properties, refer to the PAINTREGION structure.

This function will also use the current painting transformation information when creating the new region. To get the current painting transformation information, call LRasterPaint::GetTransformation. To change or set the painting transformation information, call LRasterPaint::SetTransformation.

If the user has set a bitmap in the toolkit, using the function LRasterPaint::SetMetrics, then the toolkit will create the region for the bitmap. Otherwise, the toolkit will create the region for the specified device context.

If the UserDC is not NULL, the user should set the DC boundaries before calling this function, by calling LRasterPaint::SetDCExtents.

The images below show the region created by clicking in the red area.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionTranslate, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionSurfaceTest ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC( );
PAINTSHAPE shape ;
RECT rcShape ;
RECT rcDCExtents ;
POINT ptRegionStart ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Get the current shape properties */
rstp.GetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the required shape properties */
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERWIDTH |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERENDCAP |
PSF_BACKGROUNDCOLOR ;

shape.nBorderWidth = 8 ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DASHDOT ;
shape.crBorderColor = RGB ( 255, 0, 255 ) ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.crBackgroundColor = RGB ( 255, 255, 0 ) ;

/* Set the new shape properties */
rstp.SetProperty (PAINT_GROUP_SHAPE, &shape ) ;

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 210, 210 ) ;

/* Use the current shape properties to draw an ellipse to the DC (hDC) */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;

/* Set the fill start point */
ptRegionStart.x = 100 ;
ptRegionStart.y = 100 ;

/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;

/* Set the toolkit user DC extents */
rstp.SetDCExtents (&rcDCExtents ) ;

/* Create the region */
rstp.RegionSurface ( pDC->m_hDC, &ptRegionStart, &hDestRgn) ;

/* Display the create region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::RegionTranslate

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionTranslate(dx, dy, phRgn)

L_INT dx; | /* x-direction offset */
L_INT dy; | /* y-direction offset */
pHRGN phRgn; | /* pointer to the region handle */

Translates ( offsets ) a region.

Parameter | Description
dx | X-coordinate offset.
dy | Y-coordinate offset.
phRgn | Pointer to the region to be translated. After translation, the toolkit will delete the old region and replace it with the new one.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The values for dx and dy will be used "as is". No transformation will be performed on these values.

The user is responsible for deleting the resulting region.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, LRasterDialog::DoModalRegion, LRasterPaint::GetClipRgn, LRasterPaint::OffsetClipRgn, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::SetClipRgn, Class Members
Topics: | Creating a Region

Example

L_INT RegionTranslateTest ( CWnd* pWnd )
{
LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC() ;
RECT rcRegion ;
HRGN hDestRgn ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcRegion, 10, 10, 100, 100 ) ;

/* Use the current region properties and the current painting
transformations to create a rectangle region */
rstp.RegionRect ( pDC->m_hDC, &rcRegion, &hDestRgn) ;

/* Translate the region */
rstp.RegionTranslate (50, 50, &hDestRgn ) ;

/* Display the resulted region */
FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ;

/*Delete the region */
DeleteObject ( hDestRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::SetClipRgn

#include "Ltwrappr.h"

L_INT LRasterPaint::SetClipRgn(hClipRng)

HRGN hClipRgn;

/* region handle */

Sets the current clipping region for the toolkit.

Parameter | Description
hClipRgn | A handle to the region to be used to clip the painting output. If this parameter is NULL, there is no clipping region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

This function creates a copy of the specified region and uses it to clip the painting output. The toolkit will use the region as it is, without doing any transformations.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the toolkit will perform any necessary clipping, draw to the bitmap, and finally draw the resulting bitmap to the specified device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::OffsetClipRgn, LRasterPaint::GetClipRgn, Class Members
Topics: | Setting a DigitalPaint Clipping Region

Example

L_INT OnPaintShape ( CWnd* pWnd )
{
LRasterPaint rstp;
CDC* pDC = pWnd->GetDC() ;
HRGN hClipRgn ;
RECT rcShapeRect ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;

/* Use the current shape properties to draw an ellipse */
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShapeRect ) ;

hClipRgn = CreateRectRgn ( 120, 20, 200, 100 ) ;

/* Set painting clip region */
rstp.SetClipRgn ( hClipRgn ) ;

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 110, 10, 210, 110 ) ;

/* Use the current shape properties to draw an ellipse*/
rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShapeRect ) ;

/* Delete the clip region */
DeleteObject ( ( HRGN ) hClipRgn ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::SetDCExtents

#include "Ltwrappr.h"

L_INT LRasterPaint::SetDCExtents(prcRect)

LPRECT prcRect;

/* pointer to a RECT structure */

Sets the boundaries of the device context (DC).

Parameter | Description
prcRect | Pointer to a RECT structure that contains the boundaries of the user DC.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

It is better to set the boundaries of the device context (DC) before calling any functions that use the DC. In addition, the device context boundaries should be updated whenever the old boundaries become invalid, such as when the client area of the window has been resized.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::RegionSurface, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::FillSurface, LRasterPaint::FillBorder, LRasterPaint::FillColorReplace, LRasterPaint::PickColor, LRasterPaint::GetDCExtents, Class Members
Topics: | Setting General DigitalPaint Information

Example

L_VOID OnSize ( CWnd* pWnd, LRasterPaint* pRstp, UINT state, L_INT cxClient, L_INT cyClient )
{
RECT rcNewRect, rcDCRect ;
//.
//.
//.

SetRect ( &rcNewRect, 0, 0, cxClient, cyClient ) ;

/* Do the program sizing stuff */
pRstp->GetDCExtents ( &rcDCRect ) ;

if ( ! EqualRect ( &rcNewRect, &rcDCRect ) )
{
pRstp->SetDCExtents ( &rcNewRect ) ;
}
//.
//.
//.
}


LRasterPaint::SetMetrics

#include "Ltwrappr.h"

L_INT LRasterPaint::SetMetrics(UserDC, pBitmap, hRestrictionPalette)

HDC UserDC; | /* handle to the device context */
pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
HPALETTE hRestrictionPalette; | /* palette handle */

Sets general painting information for the toolkit.

Parameter | Description
UserDC | Handle to a Windows device context (DC), such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT. The toolkit will use this DC for future painting compatibility.
pBitmap | Pointer to a bitmap handle that references the bitmap on which the painting will occur. This parameter can be NULL if the user does not need a bitmap. This toolkit uses the LEAD DIB driver, which supports 1, 4, 8, 16 and 24 bit images. If an image that has some other number of bits per pixel is used, LBitmapBase::ColorRes must be used to change the image to a bits per pixel value supported by the LEAD DIB driver.
hRestrictionPalette | Handle to the palette used to restrict the painting colors. This parameter can be NULL. This function makes a copy of the specified palette handle. Therefore, the handle should be deleted after the function returns.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

If the UserDC parameter is NULL, the toolkit will use the screen DC for compatibility issues.

The user should delete UserDC after this function returns.

If hRestrictionPalette is not NULL, painting will be restricted to the nearest colors found in the palette. If hRestrictionPalette is NULL, then no color restriction will be performed by the toolkit.

If pBitmap is not NULL, the toolkit will draw to the bitmap first, then it will draw everything to the device context.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetTransformation, LRasterPaint::SetTransformation, LRasterPaint::GetDCExtents, LRasterPaint::SetDCExtents
Topics: | Setting General DigitalPaint Information

Example

L_INT CTest1View::OnPaintShape ( CWnd * pWnd, LBitmap* pBitmap )
{
LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC() ;
RECT rcShapeRect ;
HPALETTE hPalette ;

/* initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize () )
{
return FAILURE ;
}

/* create the palette that we will be used to restrict painting colors to the DC to
/* the colors that are in the bitmap */
hPalette=pBitmap->CreatePaintPalette( pDC->m_hDC ) ;

/* set the painting metrics */
rstp.SetMetrics ( pDC->m_hDC, pBitmap->GetHandle(), hPalette ) ;

/* set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;

/* use the current shape properties to draw an rectangle */
/* and to the currently selected bitmap using the LRasterPaint::SetMetrics function */
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;

/* Delete the newly created palette */
if ( hPalette )
{
DeleteObject ( hPalette ) ;
}

/* free the paint tools handle */
rstp.Free () ;

pWnd->ReleaseDC( pDC ) ;

return SUCCESS ;
}


LRasterPaint::SetProperty

#include "Ltwrappr.h"

L_INT LRasterPaint::SetProperty(nGroup, pProperty)

PAINTGROUP nGroup; | /* type of paint properties */
L_VOID * pProperty; | /* pointer to a PAINTXXX structure */

Sets the specified paint properties.

Parameter | Description
nGroup | Indicates the paint properties to get and the structure pointed to by pProperty. Possible values are:
 | Value | Meaning
 | PAINT_GROUP_BRUSH | Sets the Paintbrush properties. pProperty points to a PAINTBRUSH structure.
 | PAINT_GROUP_SHAPE | Sets the Paint shape properties. pProperty points to a PAINTSHAPE structure.
 | PAINT_GROUP_REGION | Sets the Paint region properties. pProperty points to a PAINTREGION structure.
 | PAINT_GROUP_FILL | Sets the Paint fill properties. pProperty points to a PAINTFILL structure.
 | PAINT_GROUP_TEXT | Sets the Paint fill properties. pProperty points to a PAINTTEXT structure.
pProperty | Pointer to a PAINTXXX structure that contains the property values to set. The type of structure that this parameter points to is indicated by the nGroup parameter. The user should set the nSize and dwMask of any of the PAINTXXX structures with proper values before calling this function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetProperty, LRasterDialog::DoModalBrush, LRasterDialog::DoModalFill, LRasterDialog::DoModalRegion, LRasterDialog::DoModalShape, LRasterDialog::DoModalText, LRasterPaint::BrushLineTo, LRasterPaint::BrushMoveTo, LRasterPaint::ApplyText, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, Class Members
Topics: | Setting DigitalPaint Properties

Example

L_INT OnPaintShape (CWnd* pWnd)
{
LRasterPaint rstp;
PAINTSHAPE shape ;
CDC* pDC = pWnd->GetDC();
RECT rcShapeRect ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* Set the desired shape properties using the field masks*/
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BACKGROUNDSTYLE |
PSF_BORDERSTYLE |
PSF_BORDERCOLOR |
PSF_BORDERWIDTH |
PSF_BORDERENDCAP |
PSF_GRADIENTSTYLE |
PSF_GRADIENTSTARTCOLOR |
PSF_GRADIENTENDCOLOR |
PSF_GRADIENTSTEPS ;
shape.nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_GRADIENT;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.crBorderColor = RGB ( 255, 0, 0 ) ;
shape.nBorderWidth = 10 ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
shape.nGradientStyle = PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_L ;
shape.crGradientStartColor = RGB ( 255, 192, 0 ) ;
shape.crGradientEndColor = RGB ( 0, 0, 255 ) ;
shape.uGradientSteps = 255 ;

/*Set the paint shape group properties */
rstp.SetProperty ( PAINT_GROUP_SHAPE, &shape ) ;

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;

/* Use the current shape properties to draw a rectangle*/
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;

/* Release the device context*/
pWnd->ReleaseDC( pDC ) ;

// Free the paint tools handle.
rstp.Free ( ) ;

return SUCCESS ;
}


LRasterPaint::SetTransformation

#include "Ltwrappr.h"

L_INT LRasterPaint::SetTransformation(pXForm)

pPAINTXFORM pXForm;

/* pointer to a PAINTXFORM structure */

Sets the toolkit transformation information.

Parameter | Description
pXForm | Pointer to a PAINTXFORM structure that contains transform values used to transform input coordinates. If this parameter is NULL, the zoom will default to 100 and the offset values will default to 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Comments

The toolkit will transform all input and output coordinates, using the values set by this function, unless otherwise stated.

Required DLLs and Libraries

LTPNT

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: | LRasterPaint::GetTransformation, LRasterPaint::GetDCExtents, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, Class Members
Topics: | Setting General DigitalPaint Information

Example

L_INT OnPaintShape ( CWnd* pWnd, LBitmap* pBitmap )
{
//data member L_INT m_nZoomFactor = 500 ;
//data member L_INT m_nHscroll = 0 ;
//data member L_INT m_nVscroll = 0 ;

LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC() ;

RECT rcView ;
L_INT nXOffset, nYOffset ;
RECT rcShapeRect ;
PAINTXFORM PntXForm ;

/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}

/* set the painting rectangel */
SetRect ( &rcView, 0, 0, pBitmap->GetWidth() , pBitmap->GetHeight() ) ;

if ( m_nZoomFactor < 100 )
{
nXOffset = - MulDiv ( m_nHscroll, 100, m_nZoomFactor ) ;
nYOffset = - MulDiv ( m_nVscroll, 100, m_nZoomFactor ) ;
}
else
{
nXOffset = - m_nHscroll ;
nYOffset = - m_nVscroll ;
}

OffsetRect ( &rcView, nXOffset, nYOffset ) ;

rcView.left = MulDiv ( rcView.left, m_nZoomFactor, 100 ) ;
rcView.top = MulDiv ( rcView.top, m_nZoomFactor, 100 ) ;
rcView.right = MulDiv ( rcView.right, m_nZoomFactor, 100 ) ;
rcView.bottom = MulDiv ( rcView.bottom, m_nZoomFactor, 100 ) ;

// set the paintin transformatoins values.
PntXForm.nZoom = m_nZoomFactor ;
PntXForm.nXOffset = - rcView.left ;
PntXForm.nYOffset = - rcView.top ;

/* Set the painting transformations to reflect a zoom-in by 5:1 */
rstp.SetTransformation ( &PntXForm ) ;

/* paint the bitmap */
pBitmap->Paint()->SetDC( pDC->m_hDC );
pBitmap->SetDstRect( &rcView );
pBitmap->Paint()->PaintDC();

/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 150, 150 ) ;

/* Use the current shape properties to draw a rectangle to DC (hDC) */
rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;

/* Release the device context */
pWnd->ReleaseDC( pDC ) ;

/* Free the paint tools handle */
rstp.Free ( ) ;

return SUCCESS ;
}


LRasterDialog::LRasterDialog

#include "ltwrappr.h"

L_VOID LRasterDialog::LRasterDialog(L_VOID)

Constructs and initializes the different member variables of the LRasterDialog object.

Returns

None

Comments

LRasterDialog::LRasterDialog() is the constructor for the LRasterDialog class.

Required DLLs and Libraries

LTPDG

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:

LRasterDialog::~LRasterDialog, Class Members

Example

For an example, refer to LRasterDialog::DoModalBrush.


LRasterDialog::~LRasterDialog

#include "ltwrappr.h"

virtual L_VOID LRasterDialog::~LRasterDialog(L_VOID)

Destroys the object, and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LRasterDialog class.

Required DLLs and Libraries

LTPDG

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:

LRasterDialog::LRasterDialog, Class Members

Example

For an example, refer to LRasterDialog::DoModalBrush.


LRasterDialog::DoModalBrush

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalBrush(hWnd, pBrushDlgInfo)

HWND hWnd; | /* owner of the dialog */
pPAINTDLGBRUSHINFO pBrushDlgInfo; | /* pointer to a structure */

Brings up the paintbrush properties dialog box.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pBrushDlgInfo | Pointer to a PAINTDLGBRUSHINFO structure that contains paintbrush information. The values present in pBrushDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_BRUSH_INITUSEDEFAULT is not set in the dwFlags member of pBrushDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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: | LRasterPaint::SetProperty, LRasterPaint::GetProperty, LRasterPaint::BrushLineTo, LRasterPaint::BrushMoveTo, Class Members
Topics: | Using the DigitalPaint Common Dialogs

Example

// This example will display the brush common dialog

L_VOID BrushDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
// this will call the default constructor and destructor when it is out of scope
LRasterDialog lRstDlg ;
L_TCHAR * ppszTouchImage [ ] = { TEXT("Image 0"), TEXT("Image 1"), TEXT("Image 2"), TEXT("Image 3"), TEXT("Image 4") } ;
PAINTDLGBRUSHINFO DlgBrushInfo ;

if ( bUseDef == TRUE )
{
DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_INITUSEDEFAULT | PAINT_DLG_BRUSH_SHOWALL ;
}
else
{
DlgBrushInfo.nSize = sizeof ( PAINTDLGBRUSHINFO ) ;
DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_SHOWTOUCHCONTENT |
PAINT_DLG_BRUSH_SHOWTOUCHCOLOR |
PAINT_DLG_BRUSH_SHOWTOUCHIMAGE |
PAINT_DLG_BRUSH_SHOWDIAMETER |
PAINT_DLG_BRUSH_SHOWHARDNESS |
PAINT_DLG_BRUSH_SHOWSPACING |
PAINT_DLG_BRUSH_SHOWOPACITY |
PAINT_DLG_BRUSH_SHOWTRANSPARENTCOLOR |
PAINT_DLG_BRUSH_SHOWDEFAULT ;

DlgBrushInfo.pszTitle = TEXT("Lead Brush Common Dialog ") ;
DlgBrushInfo.nContentsType = PAINT_TOUCH_CONTENTS_COLOR;
DlgBrushInfo.crColor = RGB ( 255, 0, 0 ) ;
DlgBrushInfo.ppszTouchImage = ppszTouchImage ;
DlgBrushInfo.uTouchImageCount = 5 ;
DlgBrushInfo.nActiveTouchImageItem = 1 ;
DlgBrushInfo.crTransparentColor = RGB(0,0,0) ;
DlgBrushInfo.nDiameter = 15 ;
DlgBrushInfo.nHardnessValue = 75 ;
DlgBrushInfo.nSpacing = 10 ;
DlgBrushInfo.nOpacity = 10 ;

}
lRstDlg.DoModalBrush ( hWnd, &DlgBrushInfo ) ;

return ;

}


LRasterDialog::DoModalFill

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalFill(hWnd, pFillDlgInfo)

HWND hWnd; | /* owner of the dialog */
pPAINTDLGFILLINFO pFillDlgInfo; | /* pointer to a structure */

Brings up the fill properties dialog box.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pFillDlgInfo | Pointer to a PAINTDLGFILLINFO structure that contains fill information. The values present in pFillDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_FILL_INITUSEDEFAULT is not set in the dwFlags member of pFillDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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: | LRasterPaint::SetProperty, LRasterPaint::GetProperty, LRasterPaint::FillBorder, LRasterPaint::FillColorReplace, LRasterPaint::FillSurface
Topics: | Using the DigitalPaint Common Dialogs

Example

// This example will display the Fill common dialog

L_VOID FillDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
L_TCHAR * ppszPaperTexture [ ] = { TEXT("Paper 0"), TEXT("Paper 1"), TEXT("Paper 2"), TEXT("Paper 3"), TEXT("Paper 4"), TEXT("Paper 5") };

L_TCHAR * ppszBackgroundTileBitmap [ ] = { TEXT("Tile 0"), TEXT("Tile 1"), TEXT("Tile 2"), TEXT("Tile 3"), TEXT("Tile 4"), TEXT("Tile 5") };

PAINTDLGFILLINFO DlgFillInfo ;

LRasterDialog lRstDlg ;

if ( bUseDef == TRUE )
{
DlgFillInfo.dwFlags = PAINT_DLG_FILL_INITUSEDEFAULT | PAINT_DLG_FILL_SHOWALL ;
}
else
{
DlgFillInfo.nSize = sizeof ( PAINTDLGFILLINFO ) ;
DlgFillInfo.dwFlags = PAINT_DLG_FILL_SHOWSTYLE |
PAINT_DLG_FILL_SHOWSOLIDFILLCOLOR |
PAINT_DLG_FILL_SHOWBKGRNDTILE |
PAINT_DLG_FILL_SHOWGRADIENTSTYLE |
PAINT_DLG_FILL_SHOWGRADIENTDIRECTION |
PAINT_DLG_FILL_SHOWGRADIENTPREVIEW |
PAINT_DLG_FILL_SHOWGRADIENTSTARTCOLOR |
PAINT_DLG_FILL_SHOWGRADIENTENDCOLOR |
PAINT_DLG_FILL_SHOWGRADIENTSTEPS |
PAINT_DLG_FILL_SHOWTEXTURE |
PAINT_DLG_FILL_SHOWDEFAULT ;

DlgFillInfo.pszTitle = TEXT("Lead Fill Common Dialog ") ;
DlgFillInfo.nStyle = PAINT_FILL_STYLE_GRADIENT ;
DlgFillInfo.crSolidFillColor = RGB ( 255, 0, 0 ) ;
DlgFillInfo.ppszBackgroundTileBitmap = ppszBackgroundTileBitmap ;
DlgFillInfo.uBackgroundTileBitmapCount = 6;
DlgFillInfo.nActiveBackgroundTileBitmapItem = 1 ;
DlgFillInfo.nGradientStyle = PAINT_FILL_GRADIENT_STYLE_CONE_FROM_L;
DlgFillInfo.crGradientStartColor = RGB ( 255, 0, 0 ) ;
DlgFillInfo.crGradientEndColor = RGB ( 0, 0, 255 ) ;
DlgFillInfo.uGradientSteps = 200 ;
DlgFillInfo.ppszPaperTexture = ppszPaperTexture ;
DlgFillInfo.uPaperTextureCount = 6 ;
DlgFillInfo.nActivePaperTextureItem = -1 ;
}

lRstDlg.DoModalFill ( hWnd, &DlgFillInfo ) ;

return ;
}


LRasterDialog::DoModalRegion

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalRegion(hWnd, pRegionDlgInfo)

HWND hWnd; | /* owner of the dialog */
pPAINTDLGREGIONINFO pRegionDlgInfo; | /* pointer to a structure */

Brings up the region properties dialog box.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pRegionDlgInfo | Pointer to a PAINTDLGREGIONINFO structure that contains region information. The values present in pRegionDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_REGION_INITUSEDEFAULT is not set in the dwFlags member of pRegionDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, LRasterPaint::RegionScale, LRasterPaint::RegionSurface, LRasterPaint::RegionTranslate
Topics: | Using the DigitalPaint Common Dialogs

Example

// This example will display the Region common dialog

L_VOID RegionDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
PAINTDLGREGIONINFO DlgRegionInfo ;
LRasterDialog lRstDlg ;

if ( bUseDef == TRUE )
{
DlgRegionInfo.dwFlags = PAINT_DLG_REGION_SHOWALL | PAINT_DLG_REGION_INITUSEDEFAULT ;
}
else
{
DlgRegionInfo.nSize = sizeof ( PAINTDLGREGIONINFO ) ;
DlgRegionInfo.dwFlags = PAINT_DLG_REGION_SHOWLOWERTOLERANCE |
PAINT_DLG_REGION_SHOWUPPERTOLERANCE |
PAINT_DLG_REGION_SHOWELLIPSEWIDTH |
PAINT_DLG_REGION_SHOWELLIPSEHEIGHT ;

DlgRegionInfo.pszTitle = TEXT("Lead Region Common Dialog ") ;
DlgRegionInfo.crLowerTolerance = RGB ( 10, 10, 10 ) ;
DlgRegionInfo.crUpperTolerance = RGB ( 10, 10, 10 ) ;
DlgRegionInfo.nRoundRectEllipseWidth = 20 ;
DlgRegionInfo.nRoundRectEllipseHeight = 20 ;
}

lRstDlg.DoModalRegion ( hWnd, &DlgRegionInfo ) ;

return ;
}


LRasterDialog::DoModalShape

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalShape(hWnd, pShapeDlgInfo)

HWND hWnd; | /* owner of the dialog */
pPAINTDLGSHAPEINFO pShapeDlgInfo; | /* pointer to a structure */

Brings up the shape properties dialog box.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pShapeDlgInfo | Pointer to a PAINTDLGSHAPEINFO structure that contains shape information. The values present in pShapeDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_SHAPE_INITUSEDEFAULT is not set in the dwFlags member of pShapeDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect
Topics: | Using the DigitalPaint Common Dialogs

Example

// This example will display the Shape common dialog

L_VOID ShapeDlgTest ( HWND hWnd, L_BOOL bUseDef )

{
L_TCHAR * ppszPaperTexture [ ] = { TEXT("Paper 0"), TEXT("Paper 1"), TEXT("Paper 2"),
TEXT("Paper 3"), TEXT("Paper 4"), TEXT("Paper 5") } ;
PAINTDLGSHAPEINFO DlgShapeInfo ;

LRasterDialog lRstDlg ;

if ( bUseDef == TRUE )
{
DlgShapeInfo.dwFlags = PAINT_DLG_SHAPE_INITUSEDEFAULT | PAINT_DLG_SHAPE_SHOWALL ;
}
else
{
DlgShapeInfo.nSize = sizeof ( PAINTDLGSHAPEINFO ) ;
DlgShapeInfo.dwFlags = PAINT_DLG_SHAPE_SHOWBKGRNDSTYLE |
PAINT_DLG_SHAPE_SHOWBKOPAQUECOLOR |
PAINT_DLG_SHAPE_SHOWBORDERSTYLE |
PAINT_DLG_SHAPE_SHOWBORDERWIDTH |
PAINT_DLG_SHAPE_SHOWBORDERBRUSHSTYLE |
PAINT_DLG_SHAPE_SHOWBORDERCOLOR |

PAINT_DLG_SHAPE_SHOWGRADIENTSTYLE |
PAINT_DLG_SHAPE_SHOWGRADIENTDIRECTION |
PAINT_DLG_SHAPE_SHOWGRADIENTSTARTCOLOR|
PAINT_DLG_SHAPE_SHOWGRADIENTENDCOLOR |
PAINT_DLG_SHAPE_SHOWGRADIENTPREVIEW |
PAINT_DLG_SHAPE_SHOWGRADIENTSTEPS |
PAINT_DLG_SHAPE_SHOWENDCAP |
PAINT_DLG_SHAPE_SHOWELLIPSEWIDTH |
PAINT_DLG_SHAPE_SHOWELLIPSEHEIGHT |
PAINT_DLG_SHAPE_SHOWOPACITY |
PAINT_DLG_SHAPE_SHOWTEXTURE |
PAINT_DLG_SHAPE_SHOWDEFAULT ;

DlgShapeInfo.pszTitle = TEXT("Lead Shape Common Dialog ") ;
DlgShapeInfo.nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_GRADIENT ;
DlgShapeInfo.crBackgroundColor = RGB ( 255, 0, 0 ) ;
DlgShapeInfo.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT;
DlgShapeInfo.nBorderWidth = 10;
DlgShapeInfo.nBorderBrushStyle = PAINT_SHAPE_BORDER_BRUSH_STYLE_COLOR ;
DlgShapeInfo.crBorderColor = RGB ( 0, 255, 0 ) ;

DlgShapeInfo.nGradientStyle = PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_FROM_C;
DlgShapeInfo.crGradientStartColor = RGB ( 255, 0, 0 ) ;
DlgShapeInfo.crGradientEndColor = RGB ( 0, 0, 255 ) ;
DlgShapeInfo.uGradientSteps = 200 ;
DlgShapeInfo.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_FLAT ;
DlgShapeInfo.nRoundRectEllipseWidth = 10 ;
DlgShapeInfo.nRoundRectEllipseHeight = 10 ;
DlgShapeInfo.nOpacity = 10;
DlgShapeInfo.ppszPaperTexture = ppszPaperTexture ;
DlgShapeInfo.uPaperTextureCount = 6;
DlgShapeInfo.nActivePaperTextureItem = 3;
}
lRstDlg.DoModalShape ( hWnd, &DlgShapeInfo ) ;
return ;
}


LRasterDialog::DoModalText

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalText(hWnd, pTextDlgInfo)

HWND hWnd; | /* owner of the dialog */
pPAINTDLGTEXTINFO pTextDlgInfo; | /* pointer to a structure */

Brings up the text properties dialog box.

Parameter | Description
hWnd | Handle of the window that owns the dialog.
pTextDlgInfo | Pointer to a PAINTDLGTEXTINFO structure that contains text information. The values present in pTextDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_TEXT_INITUSEDEFAULT is not set in the dwFlags member of pTextDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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: | LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::ApplyText
Topics: | Using the DigitalPaint Common Dialogs

Example

// This example will display the Text common dialog

L_VOID TextDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
L_TCHAR * ppszBackgroundTileBitmap [ ] = { TEXT("Tile 0"), TEXT("Tile 1"), TEXT("Tile 2"), TEXT("Tile 3"), TEXT("Tile 4"), TEXT("Tile 5") };
PAINTDLGTEXTINFO DlgTextInfo ;

LOGFONT lf ;
PAINTTRANSFORM Painttransform ;
LRasterDialog lRstDlg ;

if ( bUseDef == TRUE )
{
DlgTextInfo.dwFlags = PAINT_DLG_TEXT_INITUSEDEFAULT | PAINT_DLG_TEXT_SHOWALL ;
}
else
{
lf.lfHeight = 48;
lf.lfWidth = 0 ;
lf.lfEscapement = 0 ;
lf.lfOrientation = 0 ;
lf.lfWeight = FW_NORMAL ;
lf.lfItalic = FALSE ;
lf.lfUnderline = FALSE ;
lf.lfStrikeOut = FALSE ;
lf.lfCharSet = ANSI_CHARSET ;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS ;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS ;
lf.lfQuality = DEFAULT_QUALITY ;
lf.lfPitchAndFamily = FF_DONTCARE ;
lstrcpy(lf.lfFaceName, TEXT("Times New Roman") ) ;

Painttransform.nRotate = 45 ;
Painttransform.Scale.cx = 200 ;
Painttransform.Scale.cy = 200 ;

DlgTextInfo.nSize = sizeof ( PAINTDLGTEXTINFO ) ;
DlgTextInfo.dwFlags = PAINT_DLG_TEXT_SHOWTEXT |
PAINT_DLG_TEXT_SHOWBKGRNDSTYLE |
PAINT_DLG_TEXT_SHOWBKGRNDOPAQUECOLOR |
PAINT_DLG_TEXT_SHOWBKGRNDTILE |
PAINT_DLG_TEXT_SHOWBORDERWIDTH |
PAINT_DLG_TEXT_SHOWBORDERCOLOR |
PAINT_DLG_TEXT_SHOWHORZALIGNMENT |
PAINT_DLG_TEXT_SHOWVERTALIGNMENT |
PAINT_DLG_TEXT_SHOWROTATE |
PAINT_DLG_TEXT_SHOWSCALE |
PAINT_DLG_TEXT_SHOWTRUETYPEFONT |
PAINT_DLG_TEXT_SHOWOPACITY |
PAINT_DLG_TEXT_SHOWDEFAULT ;

DlgTextInfo.pszTitle = TEXT("Lead Text Common Dialog ") ;

DlgTextInfo.pszText = TEXT("Test Test Test");
DlgTextInfo.logFont = lf ;

DlgTextInfo.nBorderWidth = 10 ;
DlgTextInfo.crBorderColor = RGB ( 0, 0, 255 ) ;
DlgTextInfo.nBackgroundStyle = PAINT_TEXT_BACK_STYLE_TILEDIMAGE ;
DlgTextInfo.crBackgroundColor = RGB ( 255, 0, 0 ) ;
DlgTextInfo.ppszBackgroundTileBitmap = ppszBackgroundTileBitmap ;
DlgTextInfo.uBackgroundTileBitmapCount = 6 ;
DlgTextInfo.nActiveBackgroundTileBitmapItem = 2 ;
DlgTextInfo.nAlignment = ( PAINTALIGNMENT ) ( PAINT_ALIGNMENT_RIGHT | PAINT_ALIGNMENT_VCENTER ) ;
DlgTextInfo.nOpacity = 10 ;
DlgTextInfo.TransformInfo = Painttransform ;
}

lRstDlg.DoModalText ( hWnd, &DlgTextInfo ) ;

return ;

}


LRasterPaintWindow::LRasterPaintWindow

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::LRasterPaintWindow()

Returns

None

Comments

LRasterPaintWindow::LRasterPaintWindow () is the default constructor for the LRasterPaintWindow object.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::~LRasterPaintWindow, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LRasterPaintWindow MyLRasterPntWnd;

//…
}


LRasterPaintWindow::~LRasterPaintWindow

#include "Ltwrappr.h"

virtual L_VOID LRasterPaintWindow::~LRasterPaintWindow()

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LRasterPaintWindow class.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::LRasterPaintWindow, Class Members

Example

For an example, refer to LRasterPaintWindow::LRasterPaintWindow


LRasterPaintWindow::CanRedo

#include "Ltwrappr.h"

L_BOOL LRasterPaintWindow::CanRedo()

Determines whether or not the last automation operation in the class object's container can be redone.

Returns

TRUE | A redo can be performed.
FALSE | A redo cannot be performed.

Comments

To redo an automation operation, call LRasterPaintWindow::Redo.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Redo, LRasterPaintWindow::CanUndo, LRasterPaintWindow::Undo

Example

For an example, refer to LRasterPaintWindow::Redo.


LRasterPaintWindow::CanUndo

#include "Ltwrappr.h"

L_BOOL LRasterPaintWindow::CanUndo()

Determines whether or not the last automation operation in the class object's container can be undone.

Returns

TRUE | An undo can be performed.
FALSE | An undo cannot be performed.

Comments

To undo an automation operation, call LRasterPaintWindow::Undo.

The default number of undo operations that can be undone within the class object's container is 16.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Undo, LRasterPaintWindow::CanRedo, LRasterPaintWindow::Redo

Example

For an example, refer to LRasterPaintWindow::Undo.


LRasterPaintWindow::Copy

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Copy()

Copies the selected objects in the class object's container to the Windows clipboard.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To paste valid automation paint data from the clipboard to the class object's container, use LRasterPaintWindow::Paste.

Paint automation data can be cut from the class object's container and placed on the clipboard using LRasterPaintWindow::Cut.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Paste, Class Members

Example

L_INT Copy(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE ;

if ( pLRasterPntWnd->IsValid () )
nRetCode = pLRasterPntWnd->Copy();

return nRetCode;
}


LRasterPaintWindow::CreateToolbar

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::CreateToolbar(pLToolbar, hWndParent, lpCaption)

LToolbar * pLToolbar; | /* pointer to an LToolbar class object */
HWND hWndParent; | /* window handle */
L_TCHAR * lpCaption; | /* window title string */

Creates a digtalpaint toolbar.

Parameter | Description
pLToolbar | Pointer to an LToolbar class object that references the newly created toolbar.
hWndParent | Window handle to the toolbar's parent window.
lpCaption | Pointer a null-terminated string to be used as the title for the toolbar window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The toolbar is created as a child window to the window specified in hwndParent.

LRasterPaintWindow::Initialize must be called before calling this function.

Please note that this DigitalPaint toolbar is an automation toolbar. This toolbar automatically handles the buttons and the necessary function calls. However, the handle of the toolbar must be set by calling LRasterPaintWindow::SetToolbar, before using the toolbar.

The digitalpaint toolbar contains the following buttons:

Description | Button ID
Paintbrush tool | ID_TOOL_PAINT_BRUSH
Line shape tool | ID_TOOL_PAINT_SHAPE_LINE
Rectangle shape tool | ID_TOOL_PAINT_SHAPE_RECT
Rounded rectangle shape tool | ID_TOOL_PAINT_SHAPE_ROUNDRECT
Ellipse shape tool | ID_TOOL_PAINT_SHAPE_ELLIPSE
Polygon shape tool | ID_TOOL_PAINT_SHAPE_POLYGON
Bezier shape tool | ID_TOOL_PAINT_SHAPE_BEZIER
Region rectangle tool | ID_TOOL_PAINT_REGION_RECT
Rounded rectangle region tool | ID_TOOL_PAINT_REGION_ROUNDRECT
Ellipse region tool | ID_TOOL_PAINT_REGION_ELLIPSE
Polygon region tool | ID_TOOL_PAINT_REGION_POLYGON
Surface region tool | ID_TOOL_PAINT_REGION_SURFACE
Border region tool | ID_TOOL_PAINT_REGION_BORDER
Color region tool | ID_TOOL_PAINT_REGION_COLOR
Surface fill tool | ID_TOOL_PAINT_FILL_SURFACE
Border fill tool | ID_TOOL_PAINT_FILL_BORDER
Color replace tool | ID_TOOL_PAINT_FILL_COLORREPLACE
Text tool | ID_TOOL_PAINT_TEXT
Zoom tool | ID_TOOL_PAINT_ZOOM
Border color picker tool | ID_TOOL_PAINT_BORDERCOLORPICKER
Mover tool | ID_TOOL_PAINT_MOVER

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Initialize, LRasterPaintWindow::FreeToolbar

Example

L_VOID MyFunction(LRasterPaintWindow *pLRasterPntWnd, LToolbar * pLToolbar, HWND hWnd,
POINT ptPos)
{
LRasterPaintWindow::Initialize ();
if (pLRasterPntWnd->IsValid ())
{

LRasterPaintWindow::CreateToolbar(pLToolbar, hWnd, TEXT("Test Toolbar"));

LRasterPaintWindow::SetToolbar (pLToolbar);
LRasterPaintWindow::SetToolbarPosition (&ptPos);
LRasterPaintWindow::ShowToolbar (TRUE);
}
}


LRasterPaintWindow::Cut

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Cut()

Cuts the selected objects in the class object's container to the Windows clipboard.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To paste paint automation data on the clipboard to the class object's container, call LRasterPaintWindow::Paste.

To copy paint automation data from the class object's container, to the Windows clipboard, use LRasterPaintWindow::Copy.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Paste, LRasterPaintWindow::Copy, Class Members

Example

L_INT MyFunction(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode;

pLRasterPntWnd->Print ();
nRetCode = pLRasterPntWnd->Cut();

if(nRetCode == SUCCESS)
return SUCCESS;

return FAILURE;
}


LRasterPaintWindow::Delete

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Delete()

Deletes the selected objects from the class object's container.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Copy, LRasterPaintWindow::Cut, LRasterPaintWindow::Paste, LRasterPaintWindow::Undo.

Example

L_INT Delete(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE ;

if ( pLRasterPntWnd->IsValid () )
nRetCode = pLRasterPntWnd->Delete();

return nRetCode;
}


LRasterPaintWindow::Free

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::Free()

Frees the class object's internal automation handle and internal container handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when the class object's internal automation handle and container handle are no longer needed.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Initialize, LRasterPaintWindow::IsValid, Class Members

Example

For an example, refer to LRasterPaintWindow::FreeToolbar.


LRasterPaintWindow::FreeToolbar

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::FreeToolbar(pLToolbar)

LToolbar * pLToolbar;

/* pointer to an LToolbar class object*/

Frees the toolbar handle's internal information and destroys the toolbar object.

Parameter | Description
pLToolbar | Pointer to an LToolbar class object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When the toolbar handle is no longer needed, this function should be called to free it.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Initialize, LRasterPaintWindow::CreateToolbar, Class Members

Example

L_VOID MyFunction(LToolbar * pLToolbar)
{
// Free The toolbar
LRasterPaintWindow::FreeToolbar(pLToolbar);
// Free The Automation
LRasterPaintWindow::Free ();
}


LRasterPaintWindow::GetBitmap

#include "Ltwrappr.h"

LBitmapBase * LRasterPaintWindow::GetBitmap()

Gets the bitmap currently attached to the class object.

Returns

Pointer to the LBitmapBase class object which contains the bitmap.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetWndHandle, LRasterPaintWindow::SetBitmap, Class Members

Example

L_VOID SaveBitmap(LRasterPaintWindow* pRasterPntWnd)
{
LBitmapBase *PLBtmpbase;
LBitmapBase *pLBtmpbase = pRasterPntWnd->GetBitmap();
PLBtmpbase->DialogFile()->DoModalSave();
}


LRasterPaintWindow::GetPaintBrush

#include "Ltwrappr.h"

PAINTBRUSH * LRasterPaintWindow::GetPaintBrush()

Gets the paintbrush properties.

Returns

Pointer to a PAINTBRUSH structure that contains the current paintbrush properties.

Comments

If this function is called before LRasterPaintWindow::SetPaintBrush has been called, the default values will be returned. For more information about the default property values, refer to:

PAINTBRUSH

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetPaintBrush, Class Members

Example

L_VOID ChangePaintBrushProp(LRasterPaintWindow *pRasterPntWnd, LBitmapBase LBtmpBrush)
{
PAINTBRUSH* pPaintBrush = pRasterPntWnd->GetPaintBrush();

pPaintBrush->nSize = sizeof (PAINTBRUSH);
pPaintBrush->dwMask = PBF_ALL;
pPaintBrush->Touch.nContentsType = PAINT_TOUCH_CONTENTS_COLOR;
pPaintBrush->Touch.crColor = RGB (255, 0, 0);
pPaintBrush->Touch.crTransparentColor = RGB (0, 0, 0);
pPaintBrush->Touch.nShape = PAINT_TOUCH_SHAPE_CIRCLE;
pPaintBrush->Touch.pBitmap = LBtmpBrush.GetHandle();
pPaintBrush->nDiameter = PAINT_BRUSH_MIN_DIAMETER;
pPaintBrush->Hardness.nDistributionType = PAINT_HARDNESS_DISTRB_TYPE_0;
pPaintBrush->Hardness.nValue = PAINT_BRUSH_MIN_HARDNESS;
pPaintBrush->nSpacing = PAINT_BRUSH_MIN_SPACING;
pPaintBrush->nDensity = PAINT_BRUSH_MAX_DENSITY;
pPaintBrush->nOpacity = PAINT_BRUSH_MAX_OPACITY;
pPaintBrush->nFadeOutRate = PAINT_BRUSH_MIN_FADEOUT;
pPaintBrush->pTexture = NULL;

pRasterPntWnd->SetPaintBrush (pPaintBrush);
}


LRasterPaintWindow::GetPaintFill

#include "Ltwrappr.h"

PAINTFILL * LRasterPaintWindow::GetPaintFill()

Gets the paint fill properties.

Returns

Pointer to a PAINTFILL structure that contains the current paint fill properties.

Comments

If this function is called before LRasterPaintWindow::SetPaintFill has been called, the default values will be returned. For more information about the default property values, refer to:

PAINTFILL

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetPaintFill, Class Members

Example

void OnPropsFill(LRasterPaintWindow *pRasterPntWnd, LBitmapBase* pLBtmpPaperTexture, LBitmapBase *pLBtmpBackTile, HWND hWnd, LRasterDialog *pPaintDialog)
{
PAINTDLGFILLINFO FillDlgInfo;
PAINTFILL* pPaintFill = pRasterPntWnd->GetPaintFill();
L_INT nRetCode;
L_TCHAR* BKTileBitmap [ ] = { TEXT("Blocks") };
L_TCHAR* TextureBitmap [ ] = { TEXT("Texture-00") };

FillDlgInfo.dwFlags = PAINT_DLG_FILL_SHOWALL;
FillDlgInfo.pszTitle = TEXT("Fill Properties");
FillDlgInfo.nStyle = pPaintFill->nStyle;
FillDlgInfo.crSolidFillColor = pPaintFill->crSolidFillColor;
FillDlgInfo.ppszBackgroundTileBitmap = BKTileBitmap;
FillDlgInfo.uBackgroundTileBitmapCount = 1;
FillDlgInfo.nActiveBackgroundTileBitmapItem = 0;
FillDlgInfo.nGradientStyle = pPaintFill->nGradientStyle;
FillDlgInfo.crGradientStartColor = pPaintFill->crGradientStartColor;
FillDlgInfo.crGradientEndColor = pPaintFill->crGradientEndColor;
FillDlgInfo.uGradientSteps = pPaintFill->uGradientSteps;
FillDlgInfo.crUpperTolerance = pPaintFill->crUpperTolerance;
FillDlgInfo.crLowerTolerance = pPaintFill->crLowerTolerance;
FillDlgInfo.nOpacity = pPaintFill->nOpacity;
FillDlgInfo.ppszPaperTexture = TextureBitmap;
FillDlgInfo.uPaperTextureCount = 1;
FillDlgInfo.nActivePaperTextureItem = ((pPaintFill->pTexture != NULL) ? 0 : -1);

nRetCode = pPaintDialog->DoModalFill(hWnd, &FillDlgInfo);

if(nRetCode == SUCCESS)
{
pPaintFill->nSize = sizeof(PAINTFILL);
pPaintFill->dwMask = PFF_ALL;
pPaintFill->nStyle = FillDlgInfo.nStyle;
pPaintFill->crSolidFillColor = FillDlgInfo.crSolidFillColor;

pPaintFill->pBackgroundTileBitmap = ((FillDlgInfo.nActiveBackgroundTileBitmapItem != -1) ? pLBtmpBackTile->GetHandle() : NULL);
pPaintFill->nGradientStyle = FillDlgInfo.nGradientStyle;
pPaintFill->crGradientStartColor = FillDlgInfo.crGradientStartColor;
pPaintFill->crGradientEndColor = FillDlgInfo.crGradientEndColor;
pPaintFill->uGradientSteps = FillDlgInfo.uGradientSteps;
pPaintFill->crUpperTolerance = FillDlgInfo.crUpperTolerance;
pPaintFill->crLowerTolerance = FillDlgInfo.crLowerTolerance;
pPaintFill->nOpacity = FillDlgInfo.nOpacity;
pPaintFill->pTexture = ((FillDlgInfo.nActivePaperTextureItem != -1) ? pLBtmpPaperTexture->GetHandle() : NULL);

pRasterPntWnd->SetPaintFill (pPaintFill);
}
}


LRasterPaintWindow::GetPaintRegion

#include "Ltwrappr.h"

PAINTREGION * LRasterPaintWindow::GetPaintRegion()

Gets the paint region properties.

Returns

Pointer to a PAINTREGION structure that contains the current paint region properties.

Comments

If this function is called before LRasterPaintWindow::SetPaintRegion has been called, the default values will be returned. For more information about the default property values, refer to:

PAINTREGION

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetPaintRegion, Class Members

Example

void OnPropsRegion(LRasterPaintWindow *pRasterPntWnd, HWND hWnd, LRasterDialog *pPaintDialog)
{
PAINTDLGREGIONINFO RegionDlgInfo;
PAINTREGION* pPaintRegion = pRasterPntWnd->GetPaintRegion();
L_INT nRetCode;

RegionDlgInfo.dwFlags = PAINT_DLG_REGION_SHOWALL;
RegionDlgInfo.pszTitle = TEXT("Region Properties");
RegionDlgInfo.crLowerTolerance = pPaintRegion->crLowerTolerance;
RegionDlgInfo.crUpperTolerance = pPaintRegion->crUpperTolerance;
RegionDlgInfo.nRoundRectEllipseWidth = pPaintRegion->nRoundRectEllipseWidth;
RegionDlgInfo.nRoundRectEllipseHeight = pPaintRegion->nRoundRectEllipseHeight;

nRetCode = pPaintDialog->DoModalRegion(hWnd, &RegionDlgInfo);

if(nRetCode == SUCCESS)
{
pPaintRegion->nSize = sizeof(PAINTREGION);
pPaintRegion->dwMask = PRF_ALL;
pPaintRegion->crLowerTolerance = RegionDlgInfo.crLowerTolerance;
pPaintRegion->crUpperTolerance = RegionDlgInfo.crUpperTolerance;
pPaintRegion->nRoundRectEllipseWidth = RegionDlgInfo.nRoundRectEllipseWidth;
pPaintRegion->nRoundRectEllipseHeight = RegionDlgInfo.nRoundRectEllipseHeight;

pRasterPntWnd->SetPaintRegion(pPaintRegion);
}
}


LRasterPaintWindow::GetPaintShape

#include "Ltwrappr.h"

PAINTSHAPE * LRasterPaintWindow::GetPaintShape()

Gets the paint shape properties.

Returns

Pointer to a PAINTSHAPE structure that contains the current paint shape properties.

Comments

If this function is called before LRasterPaintWindow::SetPaintShape has been called, the default values will be returned. For more information about the default property values, refer to:

PAINTSHAPE

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetPaintShape, Class Members

Example

void OnPropsShape(LRasterPaintWindow *pRasterPntWnd, LBitmapBase *pLBtmpBackTile, LBitmapBase* pLBtmpPaperTexture, HBITMAP hBorderTile, HWND hWnd, LRasterDialog *pPaintDialog)
{
PAINTDLGSHAPEINFO ShapeDlgInfo;
PAINTSHAPE* pPaintShape = pRasterPntWnd->GetPaintShape();
L_INT nRetCode;
L_TCHAR* BKTileBitmap [ ] = { TEXT("Blocks") };
L_TCHAR* BorderTileBitmap [ ] = { TEXT("Border-00") };
L_TCHAR* TextureBitmap [ ] = { TEXT("Texture-00") };

ShapeDlgInfo.dwFlags = PAINT_DLG_SHAPE_SHOWALL;
ShapeDlgInfo.pszTitle = TEXT("Shape Properties");
ShapeDlgInfo.nBackgroundStyle = pPaintShape->nBackgroundStyle;
ShapeDlgInfo.crBackgroundColor = pPaintShape->crBackgroundColor;
ShapeDlgInfo.ppszBackgroundTileBitmap = BKTileBitmap;
ShapeDlgInfo.uBackgroundTileBitmapCount = 1;
ShapeDlgInfo.nActiveBackgroundTileBitmapItem = 0;
ShapeDlgInfo.nBorderStyle = pPaintShape->nBorderStyle;
ShapeDlgInfo.nBorderBrushStyle = pPaintShape->nBorderBrushStyle;
ShapeDlgInfo.crBorderColor = pPaintShape->crBorderColor;
ShapeDlgInfo.ppszBorderTileBitmap = BorderTileBitmap;
ShapeDlgInfo.uBorderTileBitmapCount = 1;
ShapeDlgInfo.nActiveBorderTileBitmapItem = 0;
ShapeDlgInfo.nBorderWidth = pPaintShape->nBorderWidth;
ShapeDlgInfo.nBorderEndCap = pPaintShape->nBorderEndCap;
ShapeDlgInfo.nGradientStyle = pPaintShape->nGradientStyle;
ShapeDlgInfo.crGradientStartColor = pPaintShape->crGradientStartColor;
ShapeDlgInfo.crGradientEndColor = pPaintShape->crGradientEndColor;
ShapeDlgInfo.uGradientSteps = pPaintShape->uGradientSteps;
ShapeDlgInfo.nRoundRectEllipseWidth = pPaintShape->nRoundRectEllipseWidth;
ShapeDlgInfo.nRoundRectEllipseHeight = pPaintShape->nRoundRectEllipseHeight;
ShapeDlgInfo.nOpacity = pPaintShape->nOpacity;
ShapeDlgInfo.ppszPaperTexture = TextureBitmap;
ShapeDlgInfo.uPaperTextureCount = 1;
ShapeDlgInfo.nActivePaperTextureItem = ((pPaintShape->pTexture != NULL) ? 0 : -1);

nRetCode = pPaintDialog->DoModalShape(hWnd, &ShapeDlgInfo);

if(nRetCode == SUCCESS)
{
pPaintShape->nSize = sizeof(PAINTSHAPE);
pPaintShape->dwMask = PSF_ALL;
pPaintShape->nBackgroundStyle = ShapeDlgInfo.nBackgroundStyle;
pPaintShape->crBackgroundColor = ShapeDlgInfo.crBackgroundColor;
pPaintShape->pBackgroundTileBitmap = ((ShapeDlgInfo.nActiveBackgroundTileBitmapItem != -1) ? pLBtmpBackTile->GetHandle() : NULL);
pPaintShape->nBorderStyle = ShapeDlgInfo.nBorderStyle;
pPaintShape->nBorderBrushStyle = ShapeDlgInfo.nBorderBrushStyle;
pPaintShape->crBorderColor = ShapeDlgInfo.crBorderColor;
pPaintShape->hBorderTileBitmap = ((ShapeDlgInfo.nActiveBorderTileBitmapItem != -1) ? hBorderTile : NULL);
pPaintShape->nBorderWidth = ShapeDlgInfo.nBorderWidth;
pPaintShape->nBorderEndCap = ShapeDlgInfo.nBorderEndCap;
pPaintShape->nGradientStyle = ShapeDlgInfo.nGradientStyle;
pPaintShape->crGradientStartColor = ShapeDlgInfo.crGradientStartColor;
pPaintShape->crGradientEndColor = ShapeDlgInfo.crGradientEndColor;
pPaintShape->uGradientSteps = ShapeDlgInfo.uGradientSteps;
pPaintShape->nRoundRectEllipseWidth = ShapeDlgInfo.nRoundRectEllipseWidth;
pPaintShape->nRoundRectEllipseHeight = ShapeDlgInfo.nRoundRectEllipseHeight;
pPaintShape->nOpacity = ShapeDlgInfo.nOpacity;
pPaintShape->pTexture = ((ShapeDlgInfo.nActivePaperTextureItem != -1) ? pLBtmpPaperTexture->GetHandle(): NULL);

pRasterPntWnd->SetPaintShape (pPaintShape);
}
}


LRasterPaintWindow::GetPaintText

#include "Ltwrappr.h"

PAINTTEXT * LRasterPaintWindow::GetPaintText()

Gets the paint text properties.

Returns

Pointer to a PAINTTEXT structure that contains the current paint text properties.

Comments

If this function is called before LRasterPaintWindow::SetPaintText has been called, the default values will be returned. For more information about the default property values, refer to:

PAINTTEXT

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetPaintText, Class Members

Example

void OnPropsText(LRasterPaintWindow *pRasterPntWnd, LBitmapBase *pLBtmpBackTile, HWND hWnd, LBitmapBase* pLBtmpPaperTexture, LRasterDialog *pPaintDialog)
{
PAINTDLGTEXTINFO TextDlgInfo;
PAINTTEXT* pPaintText = pRasterPntWnd->GetPaintText();

L_INT nRetCode;
LOGFONT lf;
L_TCHAR* BKTileBitmap [ ] = { TEXT("Blocks") };
L_TCHAR* TextureBitmap [ ] = { TEXT("Texture-00") };

if(pPaintText->hFont != NULL)
{
GetObject(pPaintText->hFont, sizeof(LOGFONT), &lf);
}

TextDlgInfo.dwFlags = PAINT_DLG_TEXT_SHOWALL;
TextDlgInfo.pszTitle = TEXT("Text Properties");
TextDlgInfo.pszText = pPaintText->pszText;
TextDlgInfo.logFont = lf;
TextDlgInfo.nBorderBrushStyle = pPaintText->nBorderBrushStyle;
TextDlgInfo.nBorderWidth = pPaintText->nBorderWidth;
TextDlgInfo.crBorderColor = pPaintText->crBorderColor;
TextDlgInfo.nBackgroundStyle = pPaintText->nBackgroundStyle;
TextDlgInfo.crBackgroundColor = pPaintText->crBackgroundColor;
TextDlgInfo.ppszBackgroundTileBitmap = BKTileBitmap;
TextDlgInfo.uBackgroundTileBitmapCount = 1;
TextDlgInfo.nActiveBackgroundTileBitmapItem = 0;
TextDlgInfo.nAlignment = pPaintText->nAlignment;
TextDlgInfo.nOpacity = pPaintText->nOpacity;
TextDlgInfo.ppszPaperTexture = TextureBitmap;
TextDlgInfo.uPaperTextureCount = 1;
TextDlgInfo.nActivePaperTextureItem = ((pPaintText->pTexture != NULL) ? 0 : -1);
TextDlgInfo.TransformInfo = pPaintText->TransformInfo;

nRetCode = pPaintDialog->DoModalText (hWnd, &TextDlgInfo );

if(nRetCode == SUCCESS)
{
pPaintText->nSize = sizeof(PAINTTEXT) ;
pPaintText->dwMask = PTF_ALL;
pPaintText->pszText = TextDlgInfo.pszText;

if(pPaintText->hFont != NULL)
{
DeleteObject(pPaintText->hFont);
}

pPaintText->hFont = CreateFontIndirect(&TextDlgInfo.logFont);

pPaintText->nBorderBrushStyle = TextDlgInfo.nBorderBrushStyle;
pPaintText->nBorderWidth = TextDlgInfo.nBorderWidth;
pPaintText->crBorderColor = TextDlgInfo.crBorderColor;
pPaintText->nBackgroundStyle = TextDlgInfo.nBackgroundStyle;
pPaintText->crBackgroundColor = TextDlgInfo.crBackgroundColor;
pPaintText->pBackgroundTileBitmap = ((TextDlgInfo.nActiveBackgroundTileBitmapItem != -1) ? pLBtmpBackTile->GetHandle() : NULL);
pPaintText->nAlignment = TextDlgInfo.nAlignment;
pPaintText->nOpacity = TextDlgInfo.nOpacity;
pPaintText->pTexture = ((TextDlgInfo.nActivePaperTextureItem != -1) ? pLBtmpPaperTexture->GetHandle() : NULL);
pPaintText->TransformInfo = TextDlgInfo.TransformInfo;

pRasterPntWnd->SetPaintText (pPaintText);
}
}


LRasterPaintWindow::GetToolbar

#include "Ltwrappr.h"

static LToolbar * LRasterPaintWindow::GetToolbar()

Gets the current automation toolbar handle.

Returns

!NULL | Pointer to the LToolbar object that references the toolbar.
NULL | An error occurred.

Comments

If the user didn’t set the toolbar handle by using the LRasterPaintWindow::SetToolbar, this function will return NULL.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetToolbar, Class Members

Example

L_INT GetToolbarRows(LRasterPaintWindow *pLRasterPntWnd)
{
L_INT nRows = 0;
LToolbar* pLToolbar = LRasterPaintWindow::GetToolbar( );

if ( pLToolbar-> IsValid () )
nRows = pLToolbar-> GetRows ( );

return nRows;
}


LRasterPaintWindow::HandlePalette

#include "ltwrappr.h"

L_BOOL LRasterPaintWindow::HandlePalette(uMsg, wParam, lParam)

L_UINT uMsg; | /* window message */
WPARAM wParam; | /* first parameter of the window message */
LPARAM lParam; | /* second parameter of the window message */

Call this function to let the DigitalPaint window automatically handle the palette based on the specified message.

Parameter | Description
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

TRUE | The paint window was repainted.
FALSE | The paint window was not repainted.

Comments

This function works with the following Windows messages:

WM_PALETTECHANGED

WM_QUERYNEWPALETTE

WM_SYSCOLORCHANGE

This function will respond to these messages by automatically handling palette issues properly.

You are responsible for calling this function with the appropriate window message to let the class object's window respond to palette changes.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetWndHandle, Class Members

Example

For an example, refer to LRasterPaintWindow::SetWndHandle.


LRasterPaintWindow::Initialize

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::Initialize(void)

Initializes the class object's internal automation handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function must be called before calling many of the other LRasterPaintWindow functions.

The paint window's automation handle is valid after calling LRasterPaintWindow::Initialize.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::IsValid, LRasterPaintWindow::Free, Class Members

Example

For an example, refer to LRasterPaintWindow::CreateToolbar.


LRasterPaintWindow::IsValid

#include "Ltwrappr.h"

L_BOOL LRasterPaintWindow::IsValid()

Checks the validity of both the class object's internal automation and container.

Returns

TRUE | Both the automation handle and the container handle are valid.
FALSE | The automation handle, the container handle or both handles is/are invalid.

Comments

For the paint automation the automation handle becomes valid after calling the LRasterPaintWindow::Initialize.

The container handle is created, initialized and added to the automation when LRasterPaintWindow::SetBitmap is called.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Initialize, LRasterPaintWindow::Free, Class Members

Example

For an example, refer to LRasterPaintWindow::CreateToolbar.


LRasterPaintWindow::MsgProcCallBack

#include "ltwrappr.h"

virtual LRESULT LRasterPaintWindow::MsgProcCallBack(hWnd, uMsg, wParam, lParam)

HWND hWnd; | /* handle to the bitmap window */
UINT uMsg; | /* the window message */
WPARAM wParam; | /* the first parameter of the window message */
LPARAM lParam; | /* the second parameter of the window message */

This function is called for each message the bitmap window control receives.

Parameter | Description
hWnd | Handle to the bitmap window.
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

The result of processing a specific message.

Comments

Override this function to do your own processing of window events and messages. If you override this function you must call the base class implementation (LRasterPaintWindow::MsgProcCallBack) for default processing.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

Class Members

Example

class LUserPntWnd : public LRasterPaintWindow
{
public:
LUserPntWnd();
virtual ~LUserPntWnd();

virtual LRESULT MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
};

// Construction/Destruction

LUserPntWnd::LUserPntWnd()
{
}

LUserPntWnd::~LUserPntWnd()
{
}

LRESULT LUserPntWnd::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_CLOSE:
break ;
};

return LRasterPaintWindow::MsgProcCallBack(hWnd,uMsg,wParam,lParam);
}


LRasterPaintWindow::Paste

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Paste()

Copies the valid paint automation data on the clipboard to the class object's container.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To copy paint automation data from the class object's container to the clipboard use LRasterPaintWindow::Copy. Paint automation data can be cut from the class object's container and placed on the clipboard using LRasterPaintWindow::Cut.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Cut, LRasterPaintWindow::Copy, Class Members

Example

L_INT Paste(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE ;

if ( pLRasterPntWnd->IsValid () )
nRetCode = pLRasterPntWnd->Paste();

return nRetCode;
}


LRasterPaintWindow::Print

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Print()

Prints the objects in the class object's container that are currently displayed on the screen.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::Undo, Class Members

Example

For an example, refer to LRasterPaintWindow::Cut.


LRasterPaintWindow::Redo

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Redo()

Repeats that last automation operation performed in the class object's container.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can be called for each process "undone" in the class object's container by calling LRasterPaintWindow::Undo. For example, if LRasterPaintWindow::Undo has been called three times, to undo three processes, then calling LRasterPaintWindow::Redo can redo those three processes. The first call to LRasterPaintWindow::Redo will redo the first process; the second call will redo the second process and the third call will redo the third process.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::CanRedo, LRasterPaintWindow::CanUndo, LRasterPaintWindow::Undo, Class Members

Example

L_INT Redo(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE;

if( pLRasterPntWnd->CanRedo () )
nRetCode = pLRasterPntWnd->Redo();

return nRetCode;
}


LRasterPaintWindow::Repaint

#include "ltwrappr.h"

L_VOID LRasterPaintWindow::Repaint(pRect=NULL)

LPRECT pRect;

/* pointer to a rectangle structure */

Repaints the class object's window. Only the specified rectangle will be repainted.

Parameter | Description
pRect | Pointer to a rectangle structure that describes the rectangle to be repainted. Pass NULL to repaint the entire window.

Returns

None

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetWndHandle, Class Members

Example

For an example, refer to LRasterPaintWindow::SetWndHandle.


LRasterPaintWindow::SelectAll

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::SelectAll()

Selects the entire bitmap attached to the class object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SelectNone, Class Members

Example

L_INT SelectAll(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE ;

if ( pLRasterPntWnd->IsValid() )
nRetCode = pLRasterPntWnd->SelectAll();

return nRetCode;
}


LRasterPaintWindow::SelectNone

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::SelectNone()

Deselects the entire bitmap attached to the class object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SelectAll, Class Members

Example

L_INT SelectNone(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode = FAILURE ;

if ( pLRasterPntWnd->IsValid() )
nRetCode = pLRasterPntWnd->SelectNone();

return nRetCode;
}


LRasterPaintWindow::SetBitmap

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::SetBitmap(pLBitmap)

LBitmapBase * pLBitmap;

/* pointer to an LBitmapBase class object */

Attaches a bitmap to the class object.

Parameter | Description
pLBitmap | Pointer to an LBitmapBase class object which contains the bitmap to attach to the LRasterPaintWindow class object.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

The bitmap set by calling this function is the bitmap that will be displayed in the RasterPaint window. This is also the bitmap on which painting will occur.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetWndHandle, LRasterPaintWindow::GetBitmap, Class Members

Example

L_VOID LoadBitmap(LRasterPaintWindow *pRasterPntWnd ,HWND hWnd)
{
LBitmapBase LBtmpbase;

if(LBtmpbase.DialogFile()->DoModalOpen(hWnd) == SUCCESS)
pRasterPntWnd->SetBitmap(&LBtmpbase);
}


LRasterPaintWindow::SetPaintBrush

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::SetPaintBrush(pPaintbrush)

PAINTBRUSH * pPaintbrush;

/* pointer to a paint brush structure */

Sets the paintbrush properties.

Parameter | Description
pPaintbrush | Pointer to a PAINTBRUSH structure that contains the paintbrush properties to set.

Returns

None

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetPaintBrush, Class Members

Example

For an example, refer to LRasterPaintWindow::GetPaintBrush() Example.


LRasterPaintWindow::SetPaintFill

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::SetPaintFill(pPaintFill)

PAINTFILL * pPaintFill;

/* pointer to a paint fill structure */

Sets the paint fill properties.

Parameter | Description
pPaintFill | Pointer to a PAINTFILL structure that contains the paint fill properties to set.

Returns

None

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetPaintFill, Class Members

Example

For an example, refer to LRasterPaintWindow::GetPaintFill.


LRasterPaintWindow::SetPaintRegion

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::SetPaintRegion(pPaintRegion)

PAINTREGION * pPaintRegion;

/* pointer to a paint region structure */

Sets the paint region properties.

Parameter | Description
pPaintRegion | Pointer to a PAINTREGION structure that contains the paint region properties to set.

Returns

None

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetPaintRegion, Class Members

Example

For an example, refer to LRasterPaintWindow::GetPaintRegion.


LRasterPaintWindow::SetPaintShape

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::SetPaintShape(pPaintShape)

PAINTSHAPE * pPaintShape;

/* pointer to a paint shape structure */

Sets the paint shape properties.

Parameter | Description
pPaintShape | Pointer to a PAINTSHAPE structure that contains the paint shape properties to set.

Returns

None

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetPaintShape, Class Members

Example

For an example, refer to LRasterPaintWindow::GetPaintShape.


LRasterPaintWindow::SetPaintText

#include "Ltwrappr.h"

L_VOID LRasterPaintWindow::SetPaintText(pPaintText)

PAINTTEXT * pPaintText;

/* pointer to a paint text structure */

Sets the paint text properties.

Parameter | Description
pPaintText | Pointer to a PAINTTEXT structure that contains the paint text properties to set.

Returns

None

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetPaintText, Class Members

Example

For an example, refer to LRasterPaintWindow::GetPaintText.


LRasterPaintWindow::SetToolbar

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::SetToolbar(pLToolbar)

LToolbar * pLToolbar;

/* pointer to an LToolbar object */

Sets the automation toolbar handle.

Parameter | Description
pLToolbar | Pointer to the LToolbar object that references the handle of the toolbar to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Initialize must be called before calling this function.

This function must be called before using the toolbar.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::GetToolbar, Class Members

Example

For an example, refer to LRasterPaintWindow::CreateToolbar.


LRasterPaintWindow::SetToolbarPosition

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::SetToolbarPosition(lpptPos, dwFlags = TOOLBAR_POSITION_TOP| TOOLBAR_POSITION_LEFT)

LPPOINT lpptPos; | /* pointer to a structure */
L_UINT32 dwFlags; | /* position flags */

Sets the toolbar window position.

Parameter | Description
lpptPos | Pointer to a POINT structure that contains values used to align the toolbar. The coordinates are with respect to the screen.
dwFlags | Set of flags that will indicate how the toolbar will be aligned. Possible values are:
 | Horizontal alignment flags:
 | Value | Meaning
 | TOOLBAR_POSITION_LEFT | The specified point x will become the left of the toolbar window.
 | TOOLBAR_POSITION_RIGHT | The specified point x will become the right of the toolbar window.
 | Vertical alignment flags:
 | Value | Meaning
 | TOOLBAR_POSITION_TOP | The specified point y will become the top of the toolbar window.
 | TOOLBAR_POSITION_BOTTOM | The specified point y will become the bottom of the toolbar window.
 | The values from each category are combined by using the bitwise OR operator (|).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::CreateToolbar, LRasterPaintWindow::FreeToolbar, Class Members

Example

For an example, refer to LRasterPaintWindow::CreateToolbar.


LRasterPaintWindow::SetWndHandle

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::SetWndHandle(hWnd)

HWND hWnd;

/* handle to a window */

Sets the handle of the window to be attached to the paint window.

Parameter | Description
hWnd | Handle to the window to be attached to the paint window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The passed window handle will be attached to the paint window. If NULL is passed, then the previously attached window will be detached from the paint window.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::SetBitmap, LRasterPaintWindow::GetBitmap, Class Members

Example

L_VOID MyFunc(HWND hWnd, UINT uMsg , WPARAM wParam, LPARAM lParam)
{
LRasterPaintWindow MyLRasterPntWnd;

MyLRasterPntWnd.SetWndHandle(hWnd);
MyLRasterPntWnd.HandlePalette (uMsg , wParam , lParam);
MyLRasterPntWnd.Repaint ();
}


LRasterPaintWindow::ShowToolbar

#include "Ltwrappr.h"

static L_INT LRasterPaintWindow::ShowToolbar(bShow)

L_BOOL bShow;

/* visibility flag */

Sets the toolbar window visibility.

Parameter | Description
bShow | Flag that indicates whether to show the toolbar. Possible values are:
 | Value | Meaning
 | TRUE | Show the toolbar window.
 | FALSE | Hide the toolbar window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::CreateToolbar, LRasterPaintWindow::FreeToolbar, LRasterPaintWindow::SetToolbarPosition, Class Members

Example

For an example, refer to LRasterPaintWindow::CreateToolbar.


LRasterPaintWindow::Undo

#include "Ltwrappr.h"

L_INT LRasterPaintWindow::Undo()

Undoes the last automation operation performed in the class object's container.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

LRasterPaintWindow::Undo must be called at least once in order to perform a "redo" using LRasterPaintWindow::Redo.

To determine whether an automation operation can be undone, call LRasterPaintWindow::CanUndo.

LRasterPaintWindow::Initialize must be called before calling this function.

Required DLLs and Libraries

LTPNT
LTDIS
LTFIL
LTAUT
LTCON
LTTLB

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:

LRasterPaintWindow::CanUndo, LRasterPaintWindow::CanRedo, Class Members

Example

L_INT MyFunction(LRasterPaintWindow * pLRasterPntWnd)
{
L_INT nRetCode;

if(pLRasterPntWnd->CanUndo ())
 {
nRetCode = pLRasterPntWnd->Undo();

if(nRetCode == SUCCESS)
return SUCCESS;
}
return FAILURE;
}


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling LSettings::UnlockSupport (L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling LSettings::UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements .


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.