Recent

Author Topic: [SOLVED] How to create a TBitmap with a white background instead of black?  (Read 3625 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: How to create a TBitmap with a white background instead of black?
« Reply #15 on: September 18, 2021, 01:44:18 pm »
Hi Gus!

I made you a little demp project that covers the graphic part of the Captcha project.

It uses BGRAbitmap to show how much easier are graphics solved than with a TBitmap.

The BGRAbitmapPack can be installed via the Online Package Manager.

Screenshot an project attached.


Winni
« Last Edit: September 18, 2021, 03:29:25 pm by winni »

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: How to create a TBitmap with a white background instead of black?
« Reply #16 on: September 19, 2021, 08:00:28 am »
Hey Winni,

I made you a little demo project that covers the graphic part of the Captcha project.

You are the kindest person, THANK YOU so VERY much!!!

I promise I'll have a good look at it!! I'll for sure learn something new and I'm always grateful for that!!

My first impression is that the font size and placement is too easy to discern. But that should be easy to refine :)

Nonetheless, great effort for which I'm very grateful!!!

It uses BGRAbitmap to show how much easier are graphics solved than with a TBitmap.

I would agree with you on using an easier image manipulation library, but I think that Leledumbo's post kinda made me realise that using just what FPC/Lazarus provides by default, would be a better pattern. Having no external dependencies in the case of put it on OPM is a good argument, wouldn't you agree?

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: How to create a TBitmap with a white background instead of black?
« Reply #17 on: September 19, 2021, 08:04:59 am »
Hey Y'all,

I'm gonna mark this thread as SOLVED and create 2 news one to address:
  • Why setting TBitmap's PixelFormat resets the Brush/Pen
  • Why having a compile Optimization bigger than 1 messes with TLogFont's font size and rotation

For all that answered on this one I'm eternally grateful since I got my solution, even if it did indeed spawn another issue, LOL!!

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

 

TinyPortal © 2005-2018