Recent

Author Topic: lable or canvas.textout?  (Read 3836 times)

ali-libre

  • New Member
  • *
  • Posts: 40
lable or canvas.textout?
« on: October 18, 2016, 05:16:40 am »
thers is some info on the form that will change repeativly..
i test it with canvas.textout
and got me about 6ms to draw all of theme..
what will you prefer to got beter performance..?
just using lable or using direct canvas
or are they have same cpu usage..?
« Last Edit: October 18, 2016, 04:17:34 pm by ali-libre »

circular

  • Hero Member
  • *****
  • Posts: 4441
    • Personal webpage
Re: lable or canvas.textout?
« Reply #1 on: October 18, 2016, 07:37:28 pm »
I am not sure but I would say that a label is probably the same speed. The main drawback is that if you have many different labels, that can be a bit long to create with the designer whereas with the canvas, you can do a for loop to write as many texts as you want.
Conscience is the debugger of the mind

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1523
    • Lebeau Software
Re: lable or canvas.textout?
« Reply #2 on: October 20, 2016, 05:29:54 am »
The main drawback is that if you have many different labels, that can be a bit long to create with the designer whereas with the canvas, you can do a for loop to write as many texts as you want.

At run-time, you could put the Labels into an array/list and then loop through that when needed.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

circular

  • Hero Member
  • *****
  • Posts: 4441
    • Personal webpage
Re: lable or canvas.textout?
« Reply #3 on: October 20, 2016, 12:27:17 pm »
True. In some cases that would be the correct way to do it. But if you can avoid it, it is simpler to do some TextOut rather than having Label variables, creating them and releasing them.
Conscience is the debugger of the mind

RAW

  • Hero Member
  • *****
  • Posts: 869
Re: lable or canvas.textout?
« Reply #4 on: October 20, 2016, 02:50:15 pm »
Quote
...it is simpler to do some TextOut rather than having Label variables, creating them and releasing them.
I guess that's right, but then you have to do your own "DOUBLEBUFFERED-Thing" if needed... ?
A TLabel is just easy to handle... and needs therefore probably more resources.

 

TinyPortal © 2005-2018