Hello,
Everyone I need some help can anyone help me and give some simple graphics code for reference. Sincerely,
ZACH
Mailing lists / fpc-pascal / 2009-06
GRAPHICS HELP : PLEASE PLEASE????
6 messages · 5 people · –
- ZZachary Marlow 2
- GGraeme Geldenhuys 1
- GGuillermo Martínez Jiménez 1
- JJohn Coppens 1
- MM Pulis 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Zachary Marlow wroteEveryone I need some help can anyone help me and give some simple graphics code for reference.
You need to be a lot more specific... What do you want to do?
Regards,
- Graeme -
________________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
Hello, Everyone I need some help can anyone help me and give some…
So, a simple Google "pascal graphics code samples" did not help?
Without a _lot_ more detail (beginner, PC/Mac OS etc....) we can't help you, one please or a dozen....
Google first, list second.
Sincerely,
Everyone :-)
Zachary Marlow wrote 9 lines
Well
Like How to draw a circle , I just need some example code please
PS THANKS FOR READING AND REPLYING
--- On Sun, 6/28/09, Graeme Geldenhuys wrote:
Earlier message 18 lines
Well Like How to draw a circle , I just need some example code please
Check this tutorial:
http://pascalprogramming.byethost15.com/lesson8.php
John
Show quoted text 13 lines
There are a lot of ways to draw a circle. It depends why and where you need to draw a circle. There are a lot of differences if you need to draw it using X11 or using a graphical library. For example, using the Allegro.pas library:
(* Draw circle using Allegro (http://allegro-pas.sourceforge.net/) *)
PROGRAM circle;
USES
allegro;
BEGIN
IF NOT al_init THEN
BEGIN
WriteLn ('Error initialising Allegro');
EXIT;
END;
IF al_set_gfx_mode (AL_GFX_AUTODETECT, 320, 240, 0, 0) THEN
BEGIN
al_install_keyboard;
al_circle (al_screen, 160, 100, 50, al_makecol (255, 255, 255));
al_readkey;
al_exit;
END
ELSE
WriteLn ('Error setting graphics');
END.Another way, using Lazarus add a TPaintBox to the TForm and set the "onDraw" event of the TPaintBox to this:
PROCEDURE TForm1.PaintBox1Paint(Sender: TObject);
VAR
Tmp: TForm1;
BEGIN
Tmp := SELF;
WITH (Sender AS TPaintBox).Canvas DO
BEGIN
Ellipse (0, 0, Tmp.Width - 1, Tmp.Height - 1);
END;
END;