473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

visualizing image

Hello,

I'm writing a ASP.net webservice wich will visualize an image, generated
by another application.
The generated image is a char*. I can transform this to a String*, but I
want to view it as an image in my browser.
Is this possible, and how should I do this?

thx,

Kristof
Nov 18 '05 #1
3 1704
Comments inline:
I'm writing a ASP.net webservice wich will visualize an image, generated
by another application.
Visualize? A web service can return serialized data, that is, data in the
form of text. In order to "visualize" it (I will assume here that you mean
to "display") it, it would, after being returned from a Web Service, need to
be de-serialized into an image, and then displayed by the client app. So,
this part is a bit confusing.
The generated image is a char*. I can transform this to a String*, but I
want to view it as an image in my browser.
A generated image that is a pointer to type char? That isn't very helpful.
Basically, the "generated image" could be anything. The char data type in C
is the same as a byte in size, and can therefore be cast as almost anything.
Casting it as a pointer to a String would not be (necessarily) helpful
either. And again, as a Web Service, the only thing a browser will see is
XML text, not an image.

An image is not an array of char. You need to know what exactly the app is
returning if you want to make use of it. On the other hand, you could
probably write your own .Net image generator. All of the classes are there,
ready for you to use. And you would know what your app is putting out, which
is essential to working with it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Kristof Thys" <Kr**********@luc.ac.be> wrote in message
news:cj**********@ikaria.belnet.be... Hello,

I'm writing a ASP.net webservice wich will visualize an image, generated
by another application.
The generated image is a char*. I can transform this to a String*, but I
want to view it as an image in my browser.
Is this possible, and how should I do this?

thx,

Kristof

Nov 18 '05 #2
Kevin Spencer wrote:
Comments inline:

I'm writing a ASP.net webservice wich will visualize an image, generated
by another application.

Visualize? A web service can return serialized data, that is, data in the
form of text. In order to "visualize" it (I will assume here that you mean
to "display") it, it would, after being returned from a Web Service, need to
be de-serialized into an image, and then displayed by the client app. So,
this part is a bit confusing.


I'm sorry for being confusing, I've just started working and I'm new to
webservices and .NET and ASP.net. But I'll try to explain what I've got.
The objective is to view an VRML-object from a website. Not with an
VRML-viewer, but with global illumination methods.
I have an existing project (c++) to raytrace the 3D-model. It's also
possible to generate a .ppm image, in a later stage hopefully a .jpg.
The project just copies whatever is in the screenbuffer and puts it in
the .ppm.
I've created an asp.net webservice in c++ wich calls this existing
project, it gives some parameters (eg size of the image) to the project,
and at this moment the global illuminationproject just returns what it
should have put in the test.ppm. And indeed what I see in my xml is a
whole load of characters.

Suppose this load of characters is the contents of a .jpg file. Is it
possible to create an image from this data in ASP.NET?
The next step I'm planning is to create a Web Application, wich shows
the image generated.

I don't know if this is possible and how, so I thank you very much for
pointing me in the right direction.
The generated image is a char*. I can transform this to a String*, but I
want to view it as an image in my browser.

A generated image that is a pointer to type char? That isn't very helpful.
Basically, the "generated image" could be anything. The char data type in C
is the same as a byte in size, and can therefore be cast as almost anything.
Casting it as a pointer to a String would not be (necessarily) helpful
either. And again, as a Web Service, the only thing a browser will see is
XML text, not an image.

An image is not an array of char. You need to know what exactly the app is
returning if you want to make use of it. On the other hand, you could
probably write your own .Net image generator. All of the classes are there,
ready for you to use. And you would know what your app is putting out, which
is essential to working with it.

Nov 18 '05 #3
Thanks for the clarification, Kristof,

It sounds to me like you don't want a Web Service. If your goal is to
display the image in an ASP.Net app, then what is needed is a "vehicle" for
displaying the image in an HTML document. An HTML document is plain text,
which means that there are no binaries or images actually embedded IN the
document, but instead, there are HTML tags that indicate where images should
be downloaded from and displayed. Example:

<img src="/images/image.jpg">

This tells the browser to download the image resource from
"/images/image.jpg" and display it according to the HTML layout
characteristics of the document.

In your case, you want to create the image dynamically (programmatically).
For this task, all you need to do is to create an ASP.Net Page that either
processes the image, or calls on another app to process the image, sets the
Response.ContentType to "image/jpeg" (or whatever MIMIE type is appropriate
for that image), and writes the binary stream to the Response.OutputStream.
Then you can refer to the ASP.Net Page that streams the image in an image
tag thusly:

<img src="/someFolder/image.aspx">

If the image is in binary format and is known by you to be a stream of bytes
that is the actual image, you can just use Response.BinaryWrite() to write
the image out to the browser. If, for example, your pointer to char is a
pointer to an array of bytes, you can simply cast it as an array of bytes,
and then write it out the the browser.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Kristof Thys" <Kr**********@luc.ac.be> wrote in message
news:cj**********@ikaria.belnet.be...
Kevin Spencer wrote:
Comments inline:

I'm writing a ASP.net webservice wich will visualize an image, generated
by another application.

Visualize? A web service can return serialized data, that is, data in the form of text. In order to "visualize" it (I will assume here that you mean to "display") it, it would, after being returned from a Web Service, need to be de-serialized into an image, and then displayed by the client app. So, this part is a bit confusing.


I'm sorry for being confusing, I've just started working and I'm new to
webservices and .NET and ASP.net. But I'll try to explain what I've got.
The objective is to view an VRML-object from a website. Not with an
VRML-viewer, but with global illumination methods.
I have an existing project (c++) to raytrace the 3D-model. It's also
possible to generate a .ppm image, in a later stage hopefully a .jpg.
The project just copies whatever is in the screenbuffer and puts it in
the .ppm.
I've created an asp.net webservice in c++ wich calls this existing
project, it gives some parameters (eg size of the image) to the project,
and at this moment the global illuminationproject just returns what it
should have put in the test.ppm. And indeed what I see in my xml is a
whole load of characters.

Suppose this load of characters is the contents of a .jpg file. Is it
possible to create an image from this data in ASP.NET?
The next step I'm planning is to create a Web Application, wich shows
the image generated.

I don't know if this is possible and how, so I thank you very much for
pointing me in the right direction.
The generated image is a char*. I can transform this to a String*, but I
want to view it as an image in my browser.

A generated image that is a pointer to type char? That isn't very helpful. Basically, the "generated image" could be anything. The char data type in C is the same as a byte in size, and can therefore be cast as almost anything. Casting it as a pointer to a String would not be (necessarily) helpful
either. And again, as a Web Service, the only thing a browser will see is XML text, not an image.

An image is not an array of char. You need to know what exactly the app is returning if you want to make use of it. On the other hand, you could
probably write your own .Net image generator. All of the classes are there, ready for you to use. And you would know what your app is putting out, which is essential to working with it.

Nov 18 '05 #4

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

Similar topics

9
by: Pierre Tremblay | last post by:
Hi! I am trying to display an image in my html document. The document contains the following line: <td class="Input"><img...
3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
0
by: psimakov | last post by:
I wrote an article that focuses on: - working with Hibernate 3.x metadata at runtime - drawing ER diagrams automatically by Ant tasks, not by hand - visualizing XML DTD, Apache OJB, WSDL and...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...

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.