help me harry up paint program i need

please i wanna program something but i havn't time

plz anyone has this program , give me i need it

my program is ( how to program in trubo pascal paint program that only use keyborad to paint and u can use only 16 colour .


here i'm

Comments

  • : please i wanna program something but i havn't time
    :
    : plz anyone has this program , give me i need it
    :
    : my program is ( how to program in trubo pascal paint program that only use keyborad to paint and u can use only 16 colour .
    :
    :
    : here i'm
    :
    Here is a small outline to get you started:
    [code]
    {Open Graphics}
    repeat
    {Draw Cursor}
    ch := readkey;
    case ch of
    'l','L': CursorPos.X := CursorPos.X -1;
    'r','R': CursorPos.X := CursorPos.X +1;
    'u','U': CursorPos.Y := CursorPos.Y -1;
    'd','D': CursorPos.Y := CursorPos.Y +1;
    #13{ENTER}: PutPixel(CursorPos.X,CursorPos.Y,CurrentColor);
    '0'..'9': begin
    case Length(ColorText) of
    1: begin
    ColorText := ColorText + ch;
    Val(TempColor, ColorText, e);
    if TempColor in [0..15] then
    CurrentColor := TempColor;
    end;
    else ColorText := ch;
    end;
    end;
    until ch=#27{ESC};{Done Drawing}
    {Close Graphics}
    [/code]
    This code might not be perfect. For more info on the procedures/functions used, see the help files.
    User can choose the color from the default TP palette by typing a 2 digit number: 00, 01, 02, etc. until 15
    The cursor is controlled using l,r,d,u instead of the cursor keys. Older posts on this board contain code to use the arrow keys.
    ENTER draws a pixel on the location of the cursor, with the color of CurrentColor.
    ESC stops the program.
    The actual graphics mode and load/save I leave to you.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion