"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
Hi,
Ok, I will explain the hard way, maybe there is an easy way that I don't
know.
Create a bitmap image using the System.Drawing like this:
Bitmap NewBitmap = new Bitmap(widht, height, pixelformat)
Have a function to translate numbers to pixels like:
private static Bitmap NumbersToPixel (byte number, Bitmap currentBitmap)
{
switch (number)
{
case 1:
currentBitmap.SetPixel(x,y,color);
}
Ok, that's the hard way? Then what about this (which will create the image
and allow for the image to be auto-generated/shown to the user w/o saving
the image to the hard disk.
Create class that Implements IHttpModule.
The class will render the image to a memory stream then WriteTo the
Response.OutputStream.
Add an event handler for OnBeginRequest using AddHandler inside of the
Init() method of this class.
In OnBeginRequest handler, check the sender.Request.Path to see if it's the
same path you set in the ImageUrl of the asp.net image below.
Add an asp.net image to the web form and set the ImageUrl to be that of some
name that you will check inside your OnBeginRequest event handler.
In Web.Config, you'll need to add an <httpModules> section.
There are some tweaks you will need to do, but that is an advanced way to do
this. If you have trouble, let me know. I have an example of it, but can't
send it, don' t have the time to package it all up to post it.
If I remember, I will tonight :)
Mythran