AddDelphi Tips
Tips 11-20 of 94
Go to << Prior 1 2 3 4 5 6 7 8 9 10 Next >> page 
Rotate a bitmap by any angle - 03 March, 2006 - Peter Bone

iRotationAxis, jRotationAxis is the center of rotation.
You can speed this up a lot by creating an array of scanlines for the input and output bitmaps before calling the procedure, then replace the Scanline calls in the procedure with an...

Test if 2 lines cross and find intersection - 03 March, 2006 - Peter Bone

[delphi]// determine if 2 line cross given their end-points
function LinesCross(LineAP1, LineAP2, LineBP1, LineBP2 : TPoint) : boolean;
Var
diffLA, diffLB : TPoint;
CompareA, CompareB : integer;
begin
...

Convert between RGB and HLS colour space - 03 March, 2006 - Peter Bone

Convert RGB colours to Hue, Luminance and Saturation. This is useful for all kind of things - eg. lighting in 3D graphics, brightness, saturation adjustment of images.

[delphi]type
TRGB = record
B : byte;
...

Test if a point is inside a polygon - 03 March, 2006 - Peter Bone

[delphi]// test if a point is inside a polygon
function PointInPoly(APoint : TPoint ; APoly : array of TPoint) : boolean;
Var
i, j : integer;
npol : integer;
begin
Result := false;
npol :=...

Working with Colour and Colour Blending - 13 February, 2006 - Ryan Smith

I have been asked the question of how to use and/or blend colours often, and on this forum it has been asked many times and there seems to be not much info readily available here, so I tried to make a short information piece that may hopefully...

to execute the query in MS Access - 22 November, 2005 - Mike Shkolnik

Today I want to show how you may execute the stored query in MS Access database (mdb-file) and process the records in query (view).

In the sample code below you may see how do it in Delphi:

[delphi]var
...

Change windows keyboard mode to Farsi when your App runns - 24 March, 2005 - Ehsun Behravesh

You can use this API function to change the mode of windows keyboard.

Change to farsi:
loadkeyboardlayout('00000429', KLF_Activate);


Change to default(English):
loadkeyboardlayout('0000000',...

to convert the file size to string (a-la Explorer) - 18 May, 2004 - Mike Shkolnik

As you know, the Explorer from MS Windows allow to display the file
sizes in "human" mode.
For example, to display the "69.1 Kb" instead 70846, "1.61 Mb" instead
1697109 etc

Same formating used by Microsoft in...

to display week numbers in TDateTimePicker - 22 April, 2004 - Mike Shkolnik

Standard TDateTimePicker component allow to display the week numbers in
dropdowned panel (where calendar displayed with navigator).

For some reason (maybe forgot) the Borland didn't publish this feature
and today I...

to print the TTreeView and TListView - 22 April, 2004 - Mike Shkolnik

Standard TTreeView and TListView allow to print the contents to any
canvas (bitmap or printer etc). All what you need is to send the
WM_PRINT message.

The code below demonstrate how you may print to bitmap file:
...

Tips 11-20 of 94
Go to << Prior 1 2 3 4 5 6 7 8 9 10 Next >> page 
Latest News
Submit News Form Past News
Latest Forum Entries