473,836 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic image (png) file

I've recently seen a couple of sites that have dynamically generated .png
files on them and I'm wondering how to do it in c#, or if it's a server side
thing. Here are a couple of links:
http://www.serverspy.net/bin/hmon/12...15/0/image.png
http://miniprofile.xfire.com/gaspar.png

Both of these images are real-time/dynamically generated, but they have a
..png extension. I understand how to create/manipulate and render images in a
..aspx page, but the image tag has to point to an .aspx page address to work.
How are these images being generated with a .png extension?

My first guess would be that the mapping for the .png extension is being
changed ont the server to use whatever scripting language the site is
supported. Since the images are generated real-time I'd rule out saving temp
files for display purposes.

Any ideas/help will be appreciated.

Thanks.
Nov 19 '05 #1
4 2136
>My first guess would be that the mapping for the .png extension is being
changed ont the server to use whatever scripting language the site is
supported. Since the images are generated real-time I'd rule out saving
temp
files for display purposes.


Exactly. For example with ASP.NET, .png extension could be mapped first in
IIS to ASP.NET ISAPI, so that ASP.NET can process those requests and then
yet, it could be a custom HTTP handler (a page or a custom handler) to
process the request at ASP.NET side.

There could be temp files with this approach (depends howe the HTTP handler
works) but not necessarily, it could also use output caching to ease the
request processing burden.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #2
(comments inline)

"Phil" <Ph**@discussio ns.microsoft.co m> wrote in message
news:C8******** *************** ***********@mic rosoft.com...
I've recently seen a couple of sites that have dynamically generated .png
files on them and I'm wondering how to do it in c#, or if it's a server side thing. Here are a couple of links:
http://www.serverspy.net/bin/hmon/12...15/0/image.png
http://miniprofile.xfire.com/gaspar.png
Neat, isn't it. :)

Both of these images are real-time/dynamically generated, but they have a
.png extension. I understand how to create/manipulate and render images in a .aspx page, but the image tag has to point to an .aspx page address to work. How are these images being generated with a .png extension?

It is possible to write HTTP protocol handlers in C# or other .NET languages
and then assign a handler for the .png extension for the individual web
application in the IIS settings dialogues.
My first guess would be that the mapping for the .png extension is being
changed ont the server to use whatever scripting language the site is
supported. Since the images are generated real-time I'd rule out saving temp files for display purposes.


A primitive way of writing it would be to save it as a temp file, but if you
have drawn something programmaticall y, it is usually simple to stick it in a
MemoryStream object and attach it to the response inside the protocol
handler.

-- Sean M, who admittedly has not tried this himself so correct me if I'm
off base on this
Nov 19 '05 #3
Thanks for the help ;).

I'm not familiar with http handlers. Is this something that would have to
also be implemented through IIS, as well as code? I'm currently hosting
through a third party hosting company and I'm pretty sure I won't be able to
change IIS mappings/settings.

Thanks!

"Sean M" wrote:
(comments inline)

"Phil" <Ph**@discussio ns.microsoft.co m> wrote in message
news:C8******** *************** ***********@mic rosoft.com...
I've recently seen a couple of sites that have dynamically generated .png
files on them and I'm wondering how to do it in c#, or if it's a server

side
thing. Here are a couple of links:
http://www.serverspy.net/bin/hmon/12...15/0/image.png
http://miniprofile.xfire.com/gaspar.png


Neat, isn't it. :)

Both of these images are real-time/dynamically generated, but they have a
.png extension. I understand how to create/manipulate and render images

in a
.aspx page, but the image tag has to point to an .aspx page address to

work.
How are these images being generated with a .png extension?


It is possible to write HTTP protocol handlers in C# or other .NET languages
and then assign a handler for the .png extension for the individual web
application in the IIS settings dialogues.
My first guess would be that the mapping for the .png extension is being
changed ont the server to use whatever scripting language the site is
supported. Since the images are generated real-time I'd rule out saving

temp
files for display purposes.


A primitive way of writing it would be to save it as a temp file, but if you
have drawn something programmaticall y, it is usually simple to stick it in a
MemoryStream object and attach it to the response inside the protocol
handler.

-- Sean M, who admittedly has not tried this himself so correct me if I'm
off base on this

Nov 19 '05 #4
With ASP.NET , yes, it would need a mapping in IIS because IIS is the first
one to direct the request to the correct place for processing. This is a
different case with IIS 7, but that won't help here for a few years. :-)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Nov 19 '05 #5

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

Similar topics

2
3006
by: Cybex | last post by:
Who knows how this is done: http://www.danasoft.com/vipersig.jpg As you can see the signature is dynamical, it uses gdlib I assume and php. But does anybody have any code for this? Please help me find this, I allready searched alot, but can't seem to find anything yet... Regards, Cybex
8
6342
by: Krzysztof Kujawski | last post by:
I'm trying to get an image to analize by imagecreatefrompng(http://www.domain.pl/png.php); The file png.php is generating a PNG file different for all logged users in domain (cookies are used in this process). I want to get this graphic from another domain e.g. domain2 by imagecreatefrompng and analize it. Problem is that - if I get this image straight to HTML by <img src="http://www.domain.pl/png.php"> everything is ok. But if I'm...
5
2387
by: K | last post by:
I have found a script online that I want to use (I am new to PHP). It creates dynamic images based on the text that you pass it. However, no matter how I try, I can't get anything other than a blank white image. Can one of you knowledgeable people please have a look at the code below and help please.
2
10483
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all have the same name and reside in the following physical path structure:
7
6775
by: JavaScriptRocks | last post by:
I've been trying to imitate / reverse engineer the add attachment feature in gmail composer. I managed to do it to say about 80% but its giving me trouble in IE on WinXP-Sp2. I am using PHP to do the upload. It works well on Firefox/DeerPark, but in IE, the file selected just vanishes. You can verify it by commenting the lines marked "//IE Trouble". Commenting those lines will remove IE specific code, except the el.click() whick sends the...
18
7448
by: Andrew Christiansen | last post by:
Hey all. The images I create in photoshop with semi-transparent pixels (for instance in Photoshop text with a dropshadow with a transparent canvas) I've been saving in PNG format and then using them in my VB.NET app using the picturebox control. I was really happy when I learned that you could use PNG images in VB.NET so your images could blend in with the form's background color. But, is PNG the ideal image format to use with these...
0
2053
by: Independent | last post by:
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK Landranger maps, so that they can be used with other mapping and GPS programs apart from the restricted Memory Map viewer. You can get the details in...
1
3397
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
3487
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
9820
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
9670
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10844
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
10548
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
10591
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,...
1
7792
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
5649
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4452
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3115
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.