Wuu Posted February 20, 2009 Report Share Posted February 20, 2009 imagettftext() lieto kā atdures punktu X,Y un raksta no kreisās uz labo! Bet man vajag mainīt lai raksta piemēram no labās uz kreisās ,protams tādas funkcijas nav! Man vajag aprēķināt jaunu X punktu. Pac nesapratu ko es tur uzrakstiju. Labāk uzzīmēšu! Tātad vajag aprēķināt X asi lai varētu bīdīt tekstu pa labi,kreisi,centru! Neatkarīgi no fonta lieluma vai garuma. Tā lai php pac aprēķina! Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 20, 2009 Report Share Posted February 20, 2009 Man vajag aprēķināt jaunu X punktu. Pac nesapratu ko es tur uzrakstiju. Labāk uzzīmēšu! Njaa ... Cik tev gadinji ??? Skolaa nesi gajis?? --- P.S. varu pastastiit ka jau gandriiz 1000 gadus Cilvece matimatiskiem aprekjiniem izmanto negatiivus skaitljus ... Quote Link to comment Share on other sites More sharing options...
bubu Posted February 20, 2009 Report Share Posted February 20, 2009 Nu kā, ļoti vienkārši. Ja tekstu vajag centrēt pie kreisās malas, tad X = x; Ja tekstu vajag centrēt pa vidu, tad X = x - teksta_platums / 2; Ja tekstu vajag centrēt pie labās malas, tad X = x - tekst_platums; Un šo X tagad dod tai imagegettftext fjai. Grey_Wolf: tur pat nav negatīvi skaitļi jāizmato :) Tik vien kā atņemšanas operācija (teksta pabīdīšana pa kreisi). Quote Link to comment Share on other sites More sharing options...
Delfins Posted February 20, 2009 Report Share Posted February 20, 2009 1.) PHP pats nerēķinās 2.) X aprēķināšanai izmantojam 1. klases matemātiku. TTF teksta platumu piedāvā bibliotēkas f-ja. Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 20, 2009 Report Share Posted February 20, 2009 Grey_Wolf: tur pat nav negatīvi skaitļi jāizmato :) Tik vien kā atņemšanas operācija aga ... bet nu doma par X,Y assi tachu speekaa :) Quote Link to comment Share on other sites More sharing options...
Wuu Posted February 20, 2009 Author Report Share Posted February 20, 2009 Nu to es saprotu! Bet kā dabūt teksta platumu pikseļos? Quote Link to comment Share on other sites More sharing options...
bubu Posted February 20, 2009 Report Share Posted February 20, 2009 Tu komentārus apskaties imagettftext funkcijai. Tur tik daudz labumu ir! Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2009 Report Share Posted February 20, 2009 http://lv.php.net/manual/en/function.imagettfbbox.php Quote Link to comment Share on other sites More sharing options...
Wuu Posted February 25, 2009 Author Report Share Posted February 25, 2009 Lietojot imagettftext un ievadot simbolus ' vai " automātiski tekstam pievienojas slīpsvītras \ ,kā to noņemt? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 25, 2009 Report Share Posted February 25, 2009 Ar funkciju stripslashes(). Quote Link to comment Share on other sites More sharing options...
Wuu Posted February 26, 2009 Author Report Share Posted February 26, 2009 Aleksej kam domāti tie simboli? Kamdēļ viņi vispār pievienojas? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 26, 2009 Report Share Posted February 26, 2009 Visticamāk, ka tās ir "magic quotes" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.