Results 1 to 4 of 4

Thread: RGB in Thinbasic and Delphi / Lazarus

  1. #1

    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

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,138
    Rep Power
    733
    Hi Zak,

    thanks for this information, especially the Round behavior is something I didn't know before.

    I am personally not a big Delphi/Pascal fan, but many of my friends like it very much, so it is, as with everything else, matter of personal preference.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,869
    Rep Power
    404
    That is an interesting difference Zak.

    Petr, Delphi was super till it became .netizied -- Lazarus is nice, but not as smooth to work in as Delphi. At least you like C# now, so I am happy.

  4. #4
    I find Lazarus pretty good now, clsoe to Delphi6 at its time. I revamped my editor IndeEd for ther Corona SDK with it and under OSX. Most likely in 2-3 weeks I will restart its development and then port the program overt to windows, still using Lazarus.

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
  •