Solved

Fading Images

Posted on 2004-10-04
5
472 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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!
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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