Recent

Author Topic: BGRABitmap - showcase -  (Read 4839 times)

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
BGRABitmap - showcase -
« on: November 25, 2023, 11:49:08 am »
 :), need more tweak for fast rendering.

Thank you.
« Last Edit: November 26, 2023, 12:31:03 pm by Mongkey »

circular

  • Hero Member
  • *****
  • Posts: 4356
    • Personal webpage
Re: BGRABitmap - showcase -
« Reply #1 on: November 26, 2023, 10:21:45 am »
Hi Mongkey,

The image you provide shows a variety of indicators that are esthetic and eye catching.

I am not sure, are you requesting tweaks to improve the speed rendering of BGRABitmap in general?

Regards
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4599
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: BGRABitmap - showcase -
« Reply #2 on: November 26, 2023, 11:33:12 am »
Is that eye candy controls or your own drawing?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11931
  • FPC developer.
Re: BGRABitmap - showcase -
« Reply #3 on: November 26, 2023, 11:59:30 am »
These look stunning though !

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #4 on: November 26, 2023, 12:14:25 pm »
Hi Mongkey,

The image you provide shows a variety of indicators that are esthetic and eye catching.

I am not sure, are you requesting tweaks to improve the speed rendering of BGRABitmap in general?

Regards

If i render only 2 gauge, sure it has no problem, running all gauge need about 14-16% cpu usage, any advice for reduce the cpu usage?

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #5 on: November 26, 2023, 12:16:21 pm »
Is that eye candy controls or your own drawing?

Yes, all are made with awesome bgrabitmap, i want bring it to LAMW but i had a problem with latest bgrabitmap, it depend on GL or something, it already there but has a problem on compiling bgra on LAMW.

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #6 on: November 26, 2023, 12:17:37 pm »
These look stunning though !

Thank you marcov, your code are inspiring me on doing pascal.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: BGRABitmap - showcase -
« Reply #7 on: November 26, 2023, 03:10:35 pm »
any advice for reduce the cpu usage?
Nobody can answer this without seeing your code.
In general, scale graphics down/up to the needed size just once and use that resized for further computing.
Stay in that choosen graphics mode/quality/bits all the time to reduce computing.
Maybe start using threads to see if performance increase and cpu power decrease.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

lainz

  • Hero Member
  • *****
  • Posts: 4599
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: BGRABitmap - showcase -
« Reply #8 on: November 26, 2023, 08:11:16 pm »
:), need more tweak for fast rendering.

Thank you.

Maybe you can save nito a temporary bitmap the static backgrounds and redraw only when needed.

circular

  • Hero Member
  • *****
  • Posts: 4356
    • Personal webpage
Re: BGRABitmap - showcase -
« Reply #9 on: November 27, 2023, 01:14:37 am »
Yes, all are made with awesome bgrabitmap, i want bring it to LAMW but i had a problem with latest bgrabitmap, it depend on GL or something, it already there but has a problem on compiling bgra on LAMW.
Hi Mongkey,

I've published a version (11.5.7) for you with the package for Android that has been recently added. It should compile without GL dependency. The name of the file is bgrabitmappack4android.lpk.
https://forum.lazarus.freepascal.org/index.php/topic,24239.msg497907.html#msg497907

Maybe you can save nito a temporary bitmap the static backgrounds and redraw only when needed.
Agreed. When the component is drawn, some parts never change unless the component is resized. You can store them in a bitmap, keep it in memory and reuse it each time the control rendered as a background.

For font rendering, you can try to use TBGRAVectorizedFontRenderer for font rendering. This converts system font into polygons and it may be faster once the characters have already been converted. To use it, create an instance of TBGRAVectorizedFontRenderer and then either assign it to your bitmap (then you don't have to free it yourself) or use it directly by calling its TextOut functions (in this case you still need to free it when you free your component).

Warm regards
« Last Edit: November 27, 2023, 01:18:32 am by circular »
Conscience is the debugger of the mind

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #10 on: November 27, 2023, 11:19:33 am »
:), need more tweak for fast rendering.

Thank you.

Maybe you can save nito a temporary bitmap the static backgrounds and redraw only when needed.

May be i need todo this one  :)

Thank you.
« Last Edit: November 27, 2023, 11:21:05 am by Mongkey »

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #11 on: November 27, 2023, 11:20:36 am »
Yes, all are made with awesome bgrabitmap, i want bring it to LAMW but i had a problem with latest bgrabitmap, it depend on GL or something, it already there but has a problem on compiling bgra on LAMW.
Hi Mongkey,

I've published a version (11.5.7) for you with the package for Android that has been recently added. It should compile without GL dependency. The name of the file is bgrabitmappack4android.lpk.
https://forum.lazarus.freepascal.org/index.php/topic,24239.msg497907.html#msg497907

Maybe you can save nito a temporary bitmap the static backgrounds and redraw only when needed.
Agreed. When the component is drawn, some parts never change unless the component is resized. You can store them in a bitmap, keep it in memory and reuse it each time the control rendered as a background.

For font rendering, you can try to use TBGRAVectorizedFontRenderer for font rendering. This converts system font into polygons and it may be faster once the characters have already been converted. To use it, create an instance of TBGRAVectorizedFontRenderer and then either assign it to your bitmap (then you don't have to free it yourself) or use it directly by calling its TextOut functions (in this case you still need to free it when you free your component).

Warm regards

Ok, i'll try on LAMW

Thank you

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #12 on: November 29, 2023, 11:14:36 am »
Thak you circular and lainz, Saving of background non changing image on a buffer save a lot cpu , i just think why i was not created image first then rotating on desired angle of my needle pointer and doing blending for the end image result, i think those one save much time for creating image from a code.

https://forum.lazarus.freepascal.org/index.php/topic,51731.0.html
« Last Edit: November 29, 2023, 11:34:19 am by Mongkey »

circular

  • Hero Member
  • *****
  • Posts: 4356
    • Personal webpage
Re: BGRABitmap - showcase -
« Reply #13 on: November 30, 2023, 08:52:03 pm »
Hi Monkey!

It's heartwarming to hear that you were able to optimize the rendering and get a satisfying result!
Conscience is the debugger of the mind

Mongkey

  • Sr. Member
  • ****
  • Posts: 433
Re: BGRABitmap - showcase -
« Reply #14 on: December 03, 2023, 08:27:14 am »
Thank you circular, does bgra has beveling on canvas2D ability for beveling and make it looks shiny in a short way? Sure i could do that by doing many layering procedures. I wanna place screw bolt like on a canvas by using only codes.

Ex:like white image below?
« Last Edit: December 03, 2023, 08:36:18 am by Mongkey »

 

TinyPortal © 2005-2018