Results 1 to 4 of 4

Thread: RGB in Thinbasic and Delphi / Lazarus

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member zak's Avatar
    Join Date
    Dec 2008
    Posts
    637
    Rep Power
    83

    RGB in Thinbasic and Delphi / Lazarus

    i have tried to port MathArt canvas version to delphi and lazarus, the same algorithm gives almost the same shape but the thinbasic shape are more beautifull than delphi, and the delphi shape have more details:
    thinbasic.JPG delphi.JPG

    checking the first pixel color in thinbasic it is :
    red,green,blue = -250, -85, 48 and the same for delphi
    but thinbasic RGB convert the negative value to zero, so the above color will be 0,0,48 and delphi RGB convert the negative values like this:
    RGB(-250+256, -85+256, 48 ) = RGB(6,171,48 )
    so if we instruct delphi to behave like thinbasic ie to convert negatives to zero it will produce again beautifull shape.


    there are many annoyances in pascal such as the extreme strict we must use, as an example integer variable = Cos(4.23); will produce an error "Incompatible types: 'Integer' and 'Extended'", other annoyance is the Round function, it behaves in the most bizzare way as explained here: http://www.festra.com/eng/tip-rounding.htm
    he provide another function to correct the situation.

    thinbasic code available in the above link
    attached delphi 7.0 code with executable here ( there is no canvas_scale in delphi like that in thinbasic as in the top link second version)
    the same code can be used for Lazarus
    Attached Files Attached Files

Similar Threads

  1. How to create a new thinBasic keyword in Delphi
    By ErosOlmi in forum Turbo Delphi language SDK development
    Replies: 6
    Last Post: 21-12-2006, 03:02
  2. Delphi resources
    By Michael Hartlef in forum Turbo Delphi language SDK development
    Replies: 4
    Last Post: 16-12-2006, 21:45

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •