Author |
Topic: Antialiased line problem (Read 328 times) |
|
Joe68
New Member
member is offline


Posts: 19
|
 |
Antialiased line problem
« Thread started on: Feb 21st, 2015, 4:21pm » |
|
I wrote a simple program to display an analogue clock. I am trying to improve it using antialiased lines from GDIPLIB (e.g. for the hands) but I can't get this to work.
As far as I can see, my code is in accordance with that shown in the BB4W Help, but I keep receiving 'Syntax error' each time the program reaches FN_gdipcreatepen(PenColour%,PenStyle%,PenWidth%) Can anyone please show me where I am going wrong?
Here is a sample of a test program I used to try to discover my error:
MODE 8
INSTALL @lib$+"GDIPLIB" PROC_gdipinit
PenColour%=&FFFFFFFF PenStyle%=&12 PenWidth%=5 PRINT PenColour%
FN_gdipcreatepen(PenColour%,PenStyle%,PenWidth%)
PROC_gdipline(pen%,100,100,500,200)
END
Thanks in advance for the help. Joe.
|
|
Logged
|
Joe
|
|
|
VBI
Guest
|
 |
Re: Antialiased line problem
« Reply #1 on: Feb 21st, 2015, 6:48pm » |
|
As specified in the related help documentation, FN_gdipcreatepen has a return value for your newly created pen, so you need to supply a variable to store it in the usual way. This value is then required as Pen% by PROC_gdipline, so that it knows which pen it is being asked to draw with.
Your example, modified -
Code:
INSTALL @lib$+"GDIPLIB"
PROC_gdipinit
MODE 8
PenColour%=&FFFFFFFF
PenStyle%=&12
PenWidth%=5
PRINT PenColour%
pen%=FN_gdipcreatepen(PenColour%,PenStyle%,PenWidth%)
PRINT pen%
PROC_gdipline(pen%,100,100,500,200)
PROC_gdipexit
END
Hope that helps.
|
« Last Edit: Feb 21st, 2015, 6:53pm by VBI » |
Logged
|
|
|
|
Joe68
New Member
member is offline


Posts: 19
|
 |
Re: Antialiased line problem
« Reply #2 on: Feb 21st, 2015, 8:54pm » |
|
Thank you very much, your mod works perfectly. I didn't find this specifically stated in the Help, and being rather new to programming I didn't realise where the 'pen' variable in the line drawing command was coming from! Always nice to be shown a new trick!
|
|
Logged
|
Joe
|
|
|
|