Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-06

GRAPHICS HELP : PLEASE PLEASE????

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zachary Marlow

Hello,  
        Everyone I need some help can anyone help me and give some simple graphics code for reference.                   Sincerely,
                                 ZACH

Graeme Geldenhuys
to Zachary Marlow
Zachary Marlow wrote
Everyone 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/

M Pulis
to Zachary Marlow: 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
Hello, Everyone I need some help can anyone help me and give some simple graphics code for reference. Sincerely, ZACH _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Zachary Marlow

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
From: Graeme Geldenhuys Subject: Re: [fpc-pascal] GRAPHICS HELP : PLEASE PLEASE???? To: "FPC-Pascal users discussions" Date: Sunday, June 28, 2009, 2:05 AM Zachary Marlow wrote: >         Everyone 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/
Guillermo Martínez Jiménez
Show quoted text 13 lines
From: Zachary Marlow Subject: Re: [fpc-pascal] GRAPHICS HELP : PLEASE PLEASE???? To: FPC-Pascal users discussions Message-ID: Content-Type: text/plain; charset="iso-8859-1" Well = =A0=A0=A0=A0=A0 Like How to draw a circle , I just need some example code p= lease = =A0 PS THANKS FOR READING AND REPLYING

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;