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

  • Home
  • SEARCH
  • 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 8752543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:15:24+00:00 2026-06-13T13:15:24+00:00

I have an sprite with a few icons, about 30. I use them by

  • 0

I have an sprite with a few icons, about 30. I use them by setting the background position of one specific icon. But now, I want to use one icon like a image, to put them for example, in the facebook og:img metatag..

So, how can I generate the icon, by php and GD?

mydomain.com/generate_icon.php?icon_id=5

Is there any other way to do this without GD?

  • 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-13T13:15:25+00:00Added an answer on June 13, 2026 at 1:15 pm

    how can i do this with GD or other method.. sorry for my English!! here is an example WITH GD

    $no = isset($_GET['no']) ? $_GET['no'] : 0; <---- Image Number via GET
    $img = "sprites.png";
    list($h, $w) = getimagesize($img);
    $size = ($h < $w) ? $h : $w;
    
    $src = imagecreatefrompng($img);
    $dest = imagecreatetruecolor($size, $size);
    
    imagecopy($dest, $src, 0, 0, 0, ($size * $no), $size, $size);
    
    // Output and free from memory
    header('Content-Type: image/png');
    imagegif($dest);
    

    Usage image.php?no=5

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sprite that I use to display a few images. I am
I have been attempting this for a few days now. I'm creating a sprite
I have a sprite sheet, and would like to use it using UIImage in
I have a sprite image set as the background of an element on my
I have a few generic questions about what are the best practices for SharePoint(2010).
i have a few filters on a sprite. on mouse over i would like
I'm animating a sprite on a pixel grid. I have a few options, with
Is there a standard way of using the jquery-ui icon sprite without attaching them
I'm using sprite images for icons that are linked, but no text associated. I'm
background-position: -200px 0; one site says it crops an image from the bottom and

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.