Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Image from browser to applet idea

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

On a webpage, I would like to manipulate a simple 2-colour image (invert it and apply a mask) depending on the value of a variable. For example, if var1 = "red" then I want to manipulate the image such that it's outline changes from black to red.

I have managed to achieve this using CSS filters but these only work in IE.
Code:
<img src="Grid.bmp" style="width='100%';Filter: Invert Chroma(Color = #000000) Mask(Color=#FF0000)"  />
In order to create a generic approach that works in all browsers I was wondering if the following process was feasible:
1) pass image from web directory to java applet
2) java applet inverts image and applies mask based on value of var1
3) java applet returns modified image to web directory to be displayed in webpage

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Using an applet seems a bit heavyweight to me ... not all people have them installed, so it can't be guaranteed of being "browser compatible", and also you have the versioning issue. I've found problems with applets written in 1.4 and viewed in a 1.5 JRE.

I'd ask the javascript chaps if they have any ideas maybe ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Using an applet seems a bit heavyweight to me...
I know, but I'm running out of ideas because I've already asked the JS chaps (see thread216-1157401) but JS doesn't seem to be capable of image manipulation. Any other ideas? PHP perhaps?

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Well it could be done very easily using a server side lanaguage (be it JSP, ASP, or PHP) ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Ok, thanks for the confirmation sedj. I've managed to invert the image using PHP...just got to apply the mask now!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top