处理图像1

作者: 味蕾里的青春 | 来源:发表于2016-10-19 21:08 被阅读9次

一、创建翻转器

1.A Simple Rollover:

html :

<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <title>A Simple Rollover</title>
        <meta name="viewport" content="width=device-scale,initial-scale=1">
        <!--[if it IE9]>
            <script src="files/html5shiv.js"></script>
        <![endif]-->
        <link type="text/css" rel="stylesheet" href="../css/simple Rollover.css"/>
        <script  type="text/javascript"  src="../js/simple Rollover.js"></script>
    </head>
    <body>
        <a href="http://hicc.me/" onmouseover="document.arrow.src='../img/redarrow.jpg'"
        onmouseout="document.arrow.src='../img/bluearrow.jpg'" > 
            <img src="../img/bluearrow.jpg" name="arrow" alt="arrow">
        </a>
    </body>
</html>

css:

body {
    background-color: #ffffff;
    }
    
 img {
     width: 3000;
     height: 150px;
     border: 0;   
    }

output:

onmouseover onmouseout

2.A More Effective Rollover

html:

<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <title>A Simple Rollover</title>
        <meta name="viewport" content="width=device-scale,initial-scale=1">
        <!--[if it IE9]>
            <script src="files/html5shiv.js"></script>
        <![endif]-->
        <link type="text/css" rel="stylesheet" href="../css/simple Rollover.css"/>
        <script  type="text/javascript"  src="../js/A More Effective  Rollover.js"></script>
    </head>
    <body>
    <!--
        <a href="http://hicc.me/" onmouseover="document.arrow.src='../img/redarrow.jpg'"
        onmouseout="document.arrow.src='../img/bluearrow.jpg'" > 
            <img src="../img/bluearrow.jpg" name="arrow" alt="arrow">
        </a>
    -->
        <a href="http:hicc.me"><img src="../img/bd_logo1.png" id="red"></a>   
        <a href="https://www.baidu.com/"><img src="../img/vip-introduce.jpg" id="blue"></a>
        
    </body>
</html>

css:

/*
body {
    background-color: #ffffff;
    }
    
 img {
     width: 300px;
     height: 150px;
     border: 0;   
    }
    */
    
    
    img {
        width: 300px;
        height: 150px;
        border: 0;
    }
    

js:

window.onload=rolloverInit;
function rolloverInit( ) {
    for (var i=0;i<document.images.length;i++){
        if (document.images[i].parentNode.tagName=="A") {
            setupRollover(document.images[i]);
        }
        
    }
}

function setupRollover(thisImage) {
     thisImage.outImage=new Image();
     thisImage.outImage.src=thisImage.src;
     
     thisImage.onmouseout=function () {
        this.src=this.outImage.src; 
    } 
    
    // thisImage.overImage=new Image();
    // console.log(thisImage.id)
    
    // thisImage.overImage.src="../img/"+thisImage.id+"arrow.jpg";
    thisImage.onmouseover=function () {
        thisImage.src= "../img/"+thisImage.id+"arrow.jpg";
    }
    
    
}
   

output:

Paste_Image.png
Paste_Image.png

相关文章

  • 《数字图像处理与分析》学习笔记 1

    第一章:图像处理的基本知识 1.1数字图像处理概述 【1、数字图像处理及其特点】 1.图像与数字图像 图像是自然界...

  • 处理图像1

    一、创建翻转器 1.A Simple Rollover: html : css: output: 2.A More...

  • OpenCV入门

    图像处理的基本操作  在图像处理的过程中,读取图像、显示图像和保存图像是最基本的操作 1. 读取图像 retval...

  • 博客收集

    1. 图像处理: 图像处理基本算法-形态学OpenCV-Pythonimage fusion 2. 图像数据: I...

  • 20180222周四~图像处理

    图像处理,分低层处理,输入图像,输出图像。中层处理,输入图像,输出数据。如分割。高层处理,输入图像,输出语义。...

  • 数字图像处理的分类

      根据对图像处理的不同目的,数字图像处理可以分为3类: 1、改善图像质量:   如进行图像的亮度和颜色变换,增强...

  • LabVIEW读写各类格式图像的方法(基础篇—1)

    图像数据被采集至内存缓冲区后,机器视觉软件即可对其施加各种图像预处理、图像分析、图像处理和机器视觉算法。 1、读写...

  • 四 图像处理

    图像处理技术概述: 图像处理技术 image processing 图像处理技术是用计算机对 图像信息进行处理的技...

  • adobe公司有哪些软件,分别是干什么用的?

    1、Adobe Photoshop(Ps):图像处理软件。集图像扫描、编辑修改、图像制作、广告创意,图像输入与输出...

  • 图像处理常见方法

    1、颜色转换 以红色图像为例。在图像中提取红色部分颜色。 2. 二值化处理 1) 二值化处理 2) 自动二值化处理...

网友评论

    本文标题:处理图像1

    本文链接:https://www.haomeiwen.com/subject/vambyttx.html