Bitmap as a Image web control

B

Ben

Hi Ya,

quick question for you. Im a little new to web controls and im trying
to have a control that returns a bitmap image.

So i have created a web control library, added a control,

have the following

public class MyImage : System.Web.UI.WebControls.Image
{
Public Bitmap MyBitmap()
{
bitmap = new Bitmap(
300,
60,
PixelFormat.Format32bppArgb);
//........
// do some stuff
return bitmap
}


}


so how can i make it that the image control has the results from the
MyBitmap method?

or am i doing this totally wrong?
 
B

bruce barker \(sqlwork.com\)

unlike a windows form, a image control in the browser is just a reference to
an external image and generate html like:

<img href="someimage.jpeg">

what you wnat to is create a page that reurns an image and have your web
control reference it:

<img href="myImage.aspx?id=<imageid>">

you can google for samples.

note: modern browsers (not IE) support inline images, in which case the you
base64 encode the image and include it in the url.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top