?
Solved

Fading Images

Posted on 2004-10-04
5
Medium Priority
?
474 Views
Last Modified: 2012-08-13
I'd like to draw an icon to the screen ,and have it invisible until the user moves their mouse over it. Once they do, it will gradually fade into view. Any ideas?
0
Comment
Question by:derekthornton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:viola123
ID: 12223970
<HTML>
      <HEAD><TITLE>Image opacity script - www.designplace.org</TITLE></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<IMG id=tuxie style="FILTER: alpha(opacity=0)" src="sheep.bmp" onmouseover="setTimeout('fadein()',100)">
<SCRIPT>
value=0;

function fadein(){
      if (value<100) value+=5;

      document.getElementById("tuxie").filters[0].opacity=value;
      setTimeout('fadein()',100);
}
</SCRIPT>
</BODY></HTML>
0
 
LVL 6

Expert Comment

by:viola123
ID: 12224048
this code is able to fade in/out ,maybe it is better to fit your case,

<HTML>
      <HEAD><TITLE></TITLE></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<IMG id=tuxie style="FILTER: alpha(opacity=0)" src="../images/E-Logo.jpg" onmouseover="setTimeout('fadein()',100)"
onmouseout="setTimeout('fadeout()',100)">
<SCRIPT>
value=0;
var t1=null;
var t2=null;

function fadein(){
      if (value<100) value+=5;

      document.getElementById("tuxie").filters[0].opacity=value;
      if (t2!=null) clearTimeout(t2);
      t1=setTimeout('fadein()',100);
}
function fadeout(){
      if (value>0) value-=5;

      document.getElementById("tuxie").filters[0].opacity=value;
      if (t1!=null) clearTimeout(t1);
      t2=setTimeout('fadeout()',100)
}
</SCRIPT>
</BODY></HTML>


cheers
viola
0
 
LVL 18

Accepted Solution

by:
armoghan earned 2000 total points
ID: 12224096
if you need to use it using C#
Start a timer on Mouse over function and use the opacity from 0 to max

You can also see this article
http://www.codeproject.com/cs/media/CsTranspTutorial3.asp
0
 
LVL 2

Author Comment

by:derekthornton
ID: 12226130
it needs to be C# ..no HTML or anything ..but there is no opacity option for images or anything. Opacity only exists on forms.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 12230781

Actually the way you do it is to set the (??) Z-alpha part of the image to transparent.  I'm not a graphics guy, I just rememeber wanting to prorgram something like this a while back and looked into it.

In the end I would up embedding the picture into a control and then faded the control.  You *can* do an image directly, but the methods I found were more work than I was willing to do at the time.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question