Post Reply 
TEXTOUT_P : width ?
10-04-2015, 04:21 PM
Post: #7
RE: TEXTOUT_P : width ?
After minor changes I managed to get a little faster version.
The time required for the calculation is ~1.5ms for width and ~0.9ms for height.

Width v2:
Code:
TEXT_P_W(t,s)
BEGIN
 local x,a,b=511,m=255;
 DIMGROB_P(G9,512,1);
 TEXTOUT_P(t,G9,0,0,s,0,511,0);
 FOR x FROM 1 TO 9 DO
  IFTE(GETPIX_P(G9,m,0)=#FFFFFFh,m▶b,m▶a);
  IP((a+b)/2)▶m;
 END;
 RETURN m;
END;

Height v2:
Code:
TEXT_P_H(t,s)
BEGIN
 local x,a=0,b=31,m=15;
 DIMGROB_P(G9,1,32);
 TEXTOUT_P(t,G9,0,0,s,0,1,0);
 FOR x FROM 1 TO 5 DO
   IFTE(GETPIX_P(G9,0,m)=#FFFFFFh,m▶b,m▶a);
   IP((a+b)/2)▶m;
 END;
 RETURN m;
END;

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
TEXTOUT_P : width ? - primer - 10-02-2015, 08:41 AM
RE: TEXTOUT_P : width ? - xset - 10-02-2015, 09:17 AM
RE: TEXTOUT_P : width ? - komame - 10-02-2015, 12:51 PM
RE: TEXTOUT_P : width ? - komame - 10-03-2015, 08:56 AM
RE: TEXTOUT_P : width ? - eried - 10-03-2015, 05:42 PM
RE: TEXTOUT_P : width ? - komame - 10-03-2015, 07:45 PM
RE: TEXTOUT_P : width ? - komame - 10-04-2015 04:21 PM
RE: TEXTOUT_P : width ? - primer - 10-05-2015, 03:04 PM
RE: TEXTOUT_P : width ? - Tyann - 10-12-2015, 11:58 AM
RE: TEXTOUT_P : width ? - hpfx - 10-14-2015, 10:02 PM



User(s) browsing this thread: 1 Guest(s)