* * *

Author Topic: grabbing the colour of a pixel from the coordinates of the pixel in a bitmap or  (Read 4869 times)


  • Hero Member
  • *****
  • Posts: 5136
3) TImage is already capable of loading "other" fileformats. Quite a lot actually.

Use TImage's Picture.LoadFromFile method, and use TOpenPictureDialog's filename property for the filename.
3.A the format mechanism is extendable you can use an image library that correctly supports lcl and extend your formats to anything you might need, openpicture dialog and image/picture.loadfromfile helps you code less.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64


  • Hero Member
  • *****
  • Posts: 2379
  • My goal: build my own game engine using Lazarus

Awesome, you solved some issues that I haven't solved. And you put detailed comments on the code. I will need some time to study the code.

You suggestion using hint is good but it may block the image form our sight.

I did not use Colors[X, Y] because it is very slow, ScanLine is much faster. But for simply showing the pixel information, Colors[X, Y] is okay.

The code now is very complete. The TS should have no problem writing the thing he needs. But honestly, if I want to write such function I personally will choose more powerful graphics library. Maybe BGRABitmap.



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus