Salve.
I'm somewhat new to Java, but I learn quickly. However, one thing that
I'm trying to do is stumping me badly.
I[0] have a network application, originally written in C, that transmits
images in a fairly simple but nonstandard format over a socket connection.
I've gotten as far as recieving and decompressing[1] the image data, but
I'm somewhat stumped as to how to get it onto the screen. The Swing and
AWT documentation in the API docs haven't helped too much; they do a great
job of listing methods and a poor job of outlining how those methods
interact with each other.
Options that have sprung out at me:
- implement ImageProducer. It looks like I can get ColorModel to do a
certain amount of the heavy lifting as far as converting the decompressed
image data into pixels goes, and there seems to be a way to get a Raster,
and thence an Image, out of it that way. Only problem is, I don't see how.
- Create a method that accepts a Graphics object and unRLEs the image data
into lines on the image. I *think* this might result in having to redo
the RLE decompression if the image is ever redrawn, which, if true, would
be non-optimal.
Any thoughts?
Owen
[0] My employer, actually.
[1] Simple RLE algorithm on each raster line.
--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution. 3 1910
Owen,
Probably the simplest way to do this would be to use a BufferedImage.
That way, you can just set the pixels yourself. Implementing an
ImageProducer might be more elegant, but would take a little more work.
--Nathan Davis
Owen Jacobson wrote: Salve.
I'm somewhat new to Java, but I learn quickly. However, one thing that I'm trying to do is stumping me badly.
I[0] have a network application, originally written in C, that transmits images in a fairly simple but nonstandard format over a socket connection. I've gotten as far as recieving and decompressing[1] the image data, but I'm somewhat stumped as to how to get it onto the screen. The Swing and AWT documentation in the API docs haven't helped too much; they do a great job of listing methods and a poor job of outlining how those methods interact with each other.
Options that have sprung out at me:
- implement ImageProducer. It looks like I can get ColorModel to do a certain amount of the heavy lifting as far as converting the decompressed image data into pixels goes, and there seems to be a way to get a Raster, and thence an Image, out of it that way. Only problem is, I don't see how.
- Create a method that accepts a Graphics object and unRLEs the image data into lines on the image. I *think* this might result in having to redo the RLE decompression if the image is ever redrawn, which, if true, would be non-optimal.
Any thoughts?
Owen
[0] My employer, actually. [1] Simple RLE algorithm on each raster line.
i was under the impression that rle was a standard bitmap implementation
that should be ideal for the Java2D api to utilize. if not, then you'll
have to invest sometime investigating how Java2D works. a trip down to
your local book store is strongly advised. there are examples similiar
to what you are doing out there and java will be able to handle it for you.
- perry
Owen Jacobson wrote: Salve.
I'm somewhat new to Java, but I learn quickly. However, one thing that I'm trying to do is stumping me badly.
I[0] have a network application, originally written in C, that transmits images in a fairly simple but nonstandard format over a socket connection. I've gotten as far as recieving and decompressing[1] the image data, but I'm somewhat stumped as to how to get it onto the screen. The Swing and AWT documentation in the API docs haven't helped too much; they do a great job of listing methods and a poor job of outlining how those methods interact with each other.
Options that have sprung out at me:
- implement ImageProducer. It looks like I can get ColorModel to do a certain amount of the heavy lifting as far as converting the decompressed image data into pixels goes, and there seems to be a way to get a Raster, and thence an Image, out of it that way. Only problem is, I don't see how.
- Create a method that accepts a Graphics object and unRLEs the image data into lines on the image. I *think* this might result in having to redo the RLE decompression if the image is ever redrawn, which, if true, would be non-optimal.
Any thoughts?
Owen
[0] My employer, actually. [1] Simple RLE algorithm on each raster line.
another approach would be to utilize the C code you already have that
receives and decompresses. under java you would access your C code using
JNI. there, you write a function that passes a decompressed bitmap back
to whatever needs it.
this can be and should be done in an elegant manner otherwise you'll end
up with code that you won't want to use. check out "Essential JNI"
- perry
Owen Jacobson wrote: Salve.
I'm somewhat new to Java, but I learn quickly. However, one thing that I'm trying to do is stumping me badly.
I[0] have a network application, originally written in C, that transmits images in a fairly simple but nonstandard format over a socket connection. I've gotten as far as recieving and decompressing[1] the image data, but I'm somewhat stumped as to how to get it onto the screen. The Swing and AWT documentation in the API docs haven't helped too much; they do a great job of listing methods and a poor job of outlining how those methods interact with each other.
Options that have sprung out at me:
- implement ImageProducer. It looks like I can get ColorModel to do a certain amount of the heavy lifting as far as converting the decompressed image data into pixels goes, and there seems to be a way to get a Raster, and thence an Image, out of it that way. Only problem is, I don't see how.
- Create a method that accepts a Graphics object and unRLEs the image data into lines on the image. I *think* this might result in having to redo the RLE decompression if the image is ever redrawn, which, if true, would be non-optimal.
Any thoughts?
Owen
[0] My employer, actually. [1] Simple RLE algorithm on each raster line. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: duncan.lovett |
last post by:
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,...
|
by: Fabricio Sperandio |
last post by:
Hi everyone,
I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean,...
|
by: Lars Netzel |
last post by:
Hey!
I wrote a message yersterday and got some good answers and have now managed
to generate a nice image. The problem is that it's all generated in an
Images.Aspx file and I don't really want...
|
by: Xah Lee |
last post by:
The following is a program to generate thumbnail images for a website.
Useful, if you want to do that.
It is used to generate the thumbnails for my “Banners, Damsels, and
Mores” project...
|
by: bizt |
last post by:
Hi,
Is it possible to obtain the width/ height of an image when that image
is dyanically created using a PHP script and passing GET attributes.
For example:
<img...
|
by: Faisal Vali |
last post by:
Are there any guidelines people use that help them decide when it is
better to dynamically generate all html elements using javascript
versus actually writing some html and using it as scaffolding?...
|
by: rajesha |
last post by:
i m new to perl cgi scripting
i required to genearte some sort of image(s) after reading some data from the server through cgi script.
That image contains different components which is decided...
|
by: Miki |
last post by:
Hello,
I'm trying to write something like http://blabberize.com/, generating
a video file with lip-sync.
Currently the general idea is:
* Generate animation images using GIMP
* Sample voice...
|
by: Irmen de Jong |
last post by:
Hi,
I wanted to generate Captcha images(*) from Python and I couldn't find any module that
suited my needs so I made one myself.
It only needs PIL. (I used PIL 1.1.6)
It can generate images...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
| |