473,698 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generating dynamic heading images

I want to generate dynamic heading images, but I won't be able to use
the GD Library, ImageMagick or any other plug-in to generate an image
on the fly due to hosting restrictions.

I have seen, in the past, sites that generate headings from a set of
Gif images, each corresponding to a letter in the string that is being
turned into a graphical heading.

I've searched in vain on a technique on how to do this, but all I can
find is the GD technique of FIR (Flash Image Replacement).

Before I have to sit down and have a think about how to achieve this
solution, does anyone know how to do this or know of a site with a
tutorial on how to get the result I require?

I need to - break a string apart an then count the individual letters
out in the correct order so I can make them each correspond to a .gif
image to build a title.

Hope somebody can help!

Duncan

Jul 17 '05 #1
7 1512
du***********@l itho.co.uk wrote:
I have seen, in the past, sites that generate headings from a set of
Gif images, each corresponding to a letter in the string that is being
turned into a graphical heading.
An example please, since I still not clear to me what you are trying to
accomplish.

[snip] I need to - break a string apart an then count the individual letters
out in the correct order so I can make them each correspond to a .gif
image to build a title.


A string in an array of characters, you can access individual characters
like described in the fine manual:
http://www.php.net/manual/en/languag....string.substr
Jul 17 '05 #2
I hope you are not using this for verification purposes, (Turing test). If
so, spammers will still be able to get parse each image if you are not
careful.

--
Jamie
http://protoncms.gotdns.com - My open source content management system, take
a peek.

Some people are like Slinkies . . . not really good for anything, but you
still can't help but smile when you see one tumble down the stairs.
<du***********@ litho.co.uk> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I want to generate dynamic heading images, but I won't be able to use
the GD Library, ImageMagick or any other plug-in to generate an image
on the fly due to hosting restrictions.

I have seen, in the past, sites that generate headings from a set of
Gif images, each corresponding to a letter in the string that is being
turned into a graphical heading.

I've searched in vain on a technique on how to do this, but all I can
find is the GD technique of FIR (Flash Image Replacement).

Before I have to sit down and have a think about how to achieve this
solution, does anyone know how to do this or know of a site with a
tutorial on how to get the result I require?

I need to - break a string apart an then count the individual letters
out in the correct order so I can make them each correspond to a .gif
image to build a title.

Hope somebody can help!

Duncan

Jul 17 '05 #3
> I want to generate dynamic heading images, but I won't be able to use
the GD Library, ImageMagick or any other plug-in to generate an image
on the fly due to hosting restrictions.

I have seen, in the past, sites that generate headings from a set of
Gif images, each corresponding to a letter in the string that is being
turned into a graphical heading.


I have seen this done in Webmin. You might check their source code. I
don't think it is actually PHP (probably Perl), but it might give you
some good direction.

http://www.webmin.com/

--df

Jul 17 '05 #4
Ok, I have something working now, but with a few problems, my code is
below:

<?
// create a string ..
$txt = "My String Here";
$txt = strtoupper($txt );
// characters to search for
$txts = array ( "A", "B", "C", "D", "E", "F", and so forth );

// images array to replace them with.
$images = array ( "<img src=\"a.gif\" />", "<img src=\"b.gif\" />" ,
"<img src=\"c.gif\" />" , etc );
// continue with the <img src>'s with the number pattern above.

// Now, using str_replace to complete all the replacing.
$final = str_replace ($txts, $images, $txt);

echo $final;
?>

This works fine for my purpose, but, you will notice, I have to convert
my string to upper case characters for it to work. If the string is in
lower case, the str_replace function will replace all the characters in
the $images array as well.

Does anyone know a work around for this, so that i can use lower case
and upper case characters?

Thanks,

Duncan

Jul 17 '05 #5
> Ok, I have something working now, but with a few problems, my code is
below:

<?
// create a string ..
$txt = "My String Here";
$txt = strtoupper($txt );
// characters to search for
$txts = array ( "A", "B", "C", "D", "E", "F", and so forth );

// images array to replace them with.
$images = array ( "<img src=\"a.gif\" />", "<img src=\"b.gif\" />" ,
"<img src=\"c.gif\" />" , etc );
// continue with the <img src>'s with the number pattern above.

// Now, using str_replace to complete all the replacing.
$final = str_replace ($txts, $images, $txt);

echo $final;
?>


You could do away with your arrays by using backreferences and
preg_replace:

$final = preg_replace('/([a-zA-Z])/', '<img src="$1.gif" />', $string);

You would have to adjust things to work with spaces and other special
characters, but this would work with any letter.

--df

Jul 17 '05 #6
du***********@l itho.co.uk wrote:
I want to generate dynamic heading images, but I won't be able to use
the GD Library, ImageMagick or any other plug-in to generate an image
on the fly due to hosting restrictions.

I have seen, in the past, sites that generate headings from a set of
Gif images, each corresponding to a letter in the string that is being
turned into a graphical heading.

I've searched in vain on a technique on how to do this, but all I can
find is the GD technique of FIR (Flash Image Replacement).

Before I have to sit down and have a think about how to achieve this
solution, does anyone know how to do this or know of a site with a
tutorial on how to get the result I require?

I need to - break a string apart an then count the individual letters
out in the correct order so I can make them each correspond to a .gif
image to build a title.

Hope somebody can help!

Duncan

I guess this is the thing you are looking for:
http://axisfive.net/aboutsiir/
Jul 17 '05 #7
duncan.lov...@l itho.co.uk wrote:
I want to generate dynamic heading images, but I won't be able to use
the GD Library, ImageMagick or any other plug-in to generate an image
on the fly due to hosting restrictions.


This technique uses the GD library, which i can't use on my clients
host.

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2055
by: duncan.lovett | last post by:
I am working on a graphical heading generator for a clients website as their server does not have the GD library or similar plugins for dynamic image generation. I have achieved the result partly, from a snipet I found in the user contributions to the "str_replace" function in the manual on php.net. However there is a small problem - it only works in uppercase. Please first see my code below and then a brief description of the problem:
14
2593
by: Philippe C. Martin | last post by:
Hi, I wish to use an easy way to generate reports from wxPython and feel wxHtmlEasyPrinting could be a good solution. I now need to generate the HTML wxHtmlEasyPrinting can print: I need to have a title followed by lines of text that do not look too ugly. If possible I would like to use an existing module. Q1) Is there such a module ?
1
1793
by: Dante | last post by:
My company stores thousands of images in a SQL 200 database (image datatype). We have a need to manipulate these images as they are presented according to different situations. For example - different logos need to be inserted at the bottom of the image according to the requesting party. Any thoughts on the subject are much appreciated. Dante
1
17664
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
4
2091
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event. Each question is displayed and answered, then result written to a SQL table. Then the next question is read from a table and displayed using the load_page event again. The questions display and function perfectly. The user anwers the question...
0
1821
by: sugarsmack | last post by:
Hi folks, Using XSL, I'm trying to take an XML file containing a flat list of "topics" and generate a hierarchical topic map. The topic nodes include a role attribute that indicates their position in the hierarchy (role="1" being the top node). Here is the original XML file structure: <NoName> <topic id="id1" role="1"> <title>Heading 1 Title</title> <body>
4
2360
by: dpratt | last post by:
I have some xml documents that I am converting to html via an xsl transform. This means that the structure of the html can be whatever I want/need it to be. On the other hand, I want the majority of the formatting to come from a linked css stylesheet. The problem I am trying to deal with at the moment is generating headings that are followed (on the same line) by 0 or more images based on the xml data. Supposing "(a)" and "(b)" represent...
1
3389
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
2
3477
by: neovantage | last post by:
Hey all, I have created transparent PNG images from text dynamically. But it edges are pixel-ate or we can say edges are distorted. Here is my LINK which shows my generated transparent PNG image. Can someone help me out to sort out my problem i will be very grateful to him as i am stuck bad with this issue and i am not figuring out how to fix this. Here is my Code which generate transparent PNG images <img...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.