Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8813649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:54:35+00:00 2026-06-14T03:54:35+00:00

I am trying to create an image with a circle and some text on

  • 0

I am trying to create an image with a circle and some text on it where the text curves around the inside of the circle. The circle is adaptive and I want the text inside it to be adaptive.

Until now I have the following code that generates a text that curves:

    $row1="line1";
    $degrees = (130/strlen($row1));
    imageellipse ( $im , 250 , 250 , 390 , 390 , $black );
    imageellipse ( $im , 250 , 250 , 398 , 398 , $black );

    for ($i=0;$i<strlen($row1);$i++) 
    {
    $a = ($degrees*$i)+126-strlen($row1)/3;
    $cos = cos(deg2rad($a));
    $sin = sin(deg2rad($a));
    $x = 0;
    $y = 180;
    $xt = round($cos*($x) - $sin*($y));
    $yt = round($sin*($x) + $cos*($y));
    imagettftext($im,14,180-($a),250+$xt,270+$yt,$red,'fonts\times.TTF',$row1[$i]);
    }

Can you please tell me how can I make it adaptive, so it can adapt with the generated ellipse?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:54:36+00:00Added an answer on June 14, 2026 at 3:54 am

    Hope this helps:

         $image = imagecreatetruecolor(400,400);
         $white = imagecolorallocate($image,255,255,255);
    
        imagefill($image,0,0,$white);
    
        $red     = imagecolorallocate($image,255,0,0);
        $degrees = (360/strlen($text));
    
            for($i=0;$i<strlen($text);$i++) 
            {
              $a = ($degrees*$i)+180;
              $cos = cos(deg2rad($a));
              $sin = sin(deg2rad($a));
              $x = 0;
              $y = 180;
              $xt = round($cos*($x) - $sin*($y));
              $yt = round($sin*($x) + $cos*($y));
    
              imagettftext($image,20,180-($a),200+$xt,200+$yt,$red,"C:/WINNT/Fonts
                           arial.ttf",$text[$i]);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an image with some text on it and I want
I'm trying to create an image containing text. I've tried several examples I've found
have a nice day. I got problem when trying to create an image from
I am trying to create an image border with the following: background-color: #FFFFFF; border:
I'm trying to create an image animation using Raphael JS. I want the effect
I am trying to create a Security Image from a text using the perl
So I'm trying to create a method where the you move an image around
I am trying to create a function that generates an rectangle with some text
Im trying to create a continuous slider image, that loops itself, I have succeeded
im trying to create an image filter in OpenGL CE. currently I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.