Tags:BitmapCbuilderDrawingGraphicsImage ControlImagesPictureScanlineHow to set the initial bitmap size?

When you place an image control, it is simply a container. However, you can set the image control's Picture property at design time to contain a static graphic. The control can also load its picture from a file at runtime, as described in .

To create a blank bitmap when the application starts, Attach a handler to the OnCreate event for the form that contains the image. Create a bitmap...

Programming - C++Builder

Tags:BitmapCanvasCbuilderImage ControlHow to draw on a graphic?

You don't need any components to manipulate your application't graphic objects. You can construct, draw on, save, and destroy graphic objects without ever drawing anything on screen. In fact, your applications rarely draw directly on a form. More often, an application operates on graphics and then uses an image control component to display the graphic on a form.

Once you move the application's drawing to the graphic in the image...

Programming - C++Builder

How to use the drawing tools?

Now that you can tell what tool to use, you must indicate how to draw the different shapes. The only methods that perform any drawing are the mouse-move and mouse-up handlers, and the only drawing code draws lines, no matter what tool is selected.

To use different drawing tools, your code needs to specify how to draw, based on the selected tool. You add this instruction to each tool's event handler.
This section describes: Drawing shapes. Sharing code among...

Programming - C++Builder

Tags:CbuilderGraphicsHow to handle multiple drawing objects in your application?

In a real application, the graphics always comes complex, you have to handle more than one drawing objects to achieve your purpose. This article tells you how to do it.

Various drawing methods (rectangle, shape, line, and so on) are typically available on the toolbar and button panel. Applications can respond to clicks on speed buttons to set the desired drawing objects. This section describes how to: Keep...

Programming - C++Builder

How to use canvas to draw graphic objects such as lines, polylines, shapes, rectangles, and polygons?

This section shows how to use some common methods to draw graphic objects. It covers: Drawing lines. Drawing polylines. Drawing shapes. Drawing rounded rectangles. Drawing polygons.How to draw lines?

A canvas can draw straight lines and polylines. A straight line is just a line of pixels connecting two points. A polyline is a series of straight lines, connected end-to-end. The...

Programming - C++Builder

Tags:CanvasCbuilderWhat's the brush and how to use the brushes?

The Brush property of a canvas controls the way you fill areas, including the interior of shapes. Filling an area with a brush is a way of changing a large number of adjacent pixels in a specified way.

The brush has three properties you can manipulate: Color property changes the fill color. Style property changes the brush style. Bitmap property uses a bitmap as a brush pattern.

The values of these properties determine...

Programming - C++Builder

Tags:CanvasCbuilderDelphiPen and Brush in TCanvas

TCanvas is the base class that you can use to draw on it. In this article, you would learn how to use the pen to make some basic pictures on a canvas.

With the Canvas object, you can set the properties of a pen for drawing lines, a brush for filling shapes, a font for writing text, and an array of pixels to represent the image.

This section describes: Using pens. Using brushes. Reading and setting pixels.How to use Pen?

The Pen...

Programming - C++Builder

Tags:BrushCbuilderDelphiDrawLinetoMovetoPenTcanvasTextoutHow to use common properties and methods of Canvas?

The following table lists the commonly used properties of the Canvas object in C++Builder and Delphi.

Properties Descriptions Font Specifies the font to use when writing text on the image. Set the properties of the TFont object to specify the font face, color, size, and style of the font....

Programming - C++Builder

Tags:BitmapCbuilderClipboardDelphiPicturesFirst step to learn graphics programs--How to refresh the screen?

At certain times, the operating system determines that objects onscreen need to refresh their appearance, so it generates WM_PAINT messages on Windows, which the VCL routes to OnPaint events. (If you are using CLX for cross-platform development, a paint event is generated, which CLX routes to OnPaint events.) If you have written an OnPaint event handler for that object, it is called when...

Programming - C++Builder

More Articles...

10