本文的线性亮度/对比度调整方法是在《改进的图像线性亮度调整方法》一文中线性亮度调整方法与《Delphi图像处理 -- Photoshop图像亮度/对比度调整》中的对比度调整方法基础上形成的,其原理和特点可参见这2篇文章:
过程定义:
// 线性调整亮度,Value亮度值
procedure ImageLinearBrightness(Data: TImageData; Value: Integer);
// 调整亮度(线性)和对比度
procedure ImageLinearBrightnessAndContrast(Data: TImageData;
Bright, Contrast: Integer; Threshold: LongWord);
实现代码:
procedure ImageLinearbrightness(Data: TImageData; Value: Integer);
asm
push ebp
push esi
push edi
push ebx
test edx, edx // if (Value == 0) return
jz @end
mov ebp, edx
jl @@2
push eax
cmp ebp, 255 // if (Value > 0)
jle @@1 // {
mov ebp, 255 // if (Value > 255) Value = 255
@@1:
mov eax, 65536 // Value = 65536 / (256 - Value) - 256
mov ecx, 256
sub ec ......
本文是基于《GDI+在Delphi程序的应用 – Photoshop色相/饱和度/明度功能》一文的BASM实用性过程,有关实现原理可参见《GDI+ 在Delphi程序的应用 -- 图像饱和度调整》和《GDI+ 在Delphi程序的应用 -- 仿Photoshop的明度调整》,纯PAS实现代码和测试例子代码见《GDI+在Delphi程序的应用 – Photoshop色相/饱和度/明度功能》。
过程定义:
// 调整色相/饱和度/明度
procedure ImageHSBAdjustment(Data: TImageData; hValue, sValue, bValue: Integer);
实现代码:
procedure _SetBrightness(Data: TImageData; Value: Integer);
asm
push esi
push edi
push ebx
sar edx, 1 // Value /= 2
movd mm5, edx
punpcklwd mm5, mm5
punpcklwd mm5, mm5
pcmpeqb mm6, mm6
psrlw mm6, 8 // mm4 = 00 FF 00 FF 00 FF 00 FF
pxor mm7, mm7
push edx
call SetDataReg32
pop esi
@yLoop:
push ecx
@xLoop:
mov al, [edi + 3]
movd mm0, [edi]
punpcklbw mm0, mm7
......
jQuery片段:
var
// Will speed up references to window, and allows munging its name.
window = this,
// Will speed up references to undefined, and allows munging its name.
undefined,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
jQuery = window.jQuery = window.$ = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/;
从这一节开始,我们剥掉jQuery的外衣,看看里面藏着些什么。前一节中曾经提及,如果单看外层的匿名函数,不看里面的实现的话,这个实现肯定不是闭包。但是,如果把jQuery的实现加上的话,这个肯定就是一种闭包应用。万丈高楼平地起,要了解闭包应用,就首先要了解它的基 ......
实现效果:
引入JS和CSS文件:
<mce:script type='text/javascript' src="dropdown/jquery-1.2.3.min.js" mce_src="dropdown/jquery-1.2.3.min.js"></mce:script>
<mce:script type='text/javascript' src="dropdown/menu.js" mce_src="dropdown/menu.js"></mce:script>
<link rel="stylesheet" href="dropdown/style.css" mce_href="dropdown/style.css" type="text/css" media="screen" />
style.css Code:
body{
font-size:0.85em;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
#div{
line-height:1.5em;
list-style-type: none;
width: 300px;
margin-right: auto;
margin-left: auto;
}
#nav, #nav ul{
margin:0;
padding:0;
list-style-type:none;
list-style-position:outside;
position:relative;
line-height:1.5em;
}
#nav a{
display:block;
padding:0px 5px;
border:1px solid #333;
color:#fff;
text-decoration:none;
background-color:#333;
}
#nav a:hover{
background-color:#fff;
color:#333;
}
#nav li{
float:left;
position:relative;
}
#nav u ......
这里 是三种导出,网上搜的,excel导出还行,word就不好了,不是我想要的那种,但是还是贴出来了 嘿嘿,希望有更好的 告诉我下 谢谢,这里的word导出时利用复制黏贴原理,感觉很不好,有一种导出excel也是如此,这里还有导出表格信息的,不是复制黏贴%
<script language="javascript">
/**//*
*
* @param {Object} cont 要导出的html元素内容的id,注意不要加双引号
* @param {Object} key 分页关键字
*/
function AllAreaWord(cont,key)
{
var oWD = new ActiveXObject("Word.Application");
//默认为页面视图
var oDC = oWD.Documents.Add("", 0, 0);
var oRange = oDC.Range(0, 1);
//var oRange1 = oDC.Range(0,2);
&nb ......
string cbSelectOnClickJS = @"
if(this.checked)
{
document.getElementById('" + hidSelected.ClientID + @"').value += ',' + this.value;
}
else
{
document.getElementById('" + hidSelected.ClientID + @"').value
= document.getElementById('" + hidSelected.ClientID + @"').value
&nbs ......