posts - 21, comments - 25, trackbacks - 0, articles - 3
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

2011年9月29日

摘要: Android, sqlite阅读全文

posted @ 2011-09-29 12:48 Don 阅读(18) 评论(0) 编辑

2010年8月3日

没用Updatepanel的页面,这样使用:

btnSave.OnClientClick = "if(!Page_ClientValidate()){Page_BlockSubmit = false;return false;}" + this.GetPostBackEventReference(this.btnSave) + ";this.disabled=true;";

 

使用Updatepanel的页面:

ScriptManager.RegisterStartupScript(this.Page,
                this.Page.GetType(),
                Guid.NewGuid().ToString(),
                @"function BeginRequest(sender, args){var sLink = sender._postBackSettings.sourceElement;
if(sLink !=null &&  sLink.tagName=='A')sLink.disabled = true;$get('" + progress.ClientID + @"').style.display = 'block';}
                  function EndRequest(sender, args){var sLink = sender._postBackSettings.sourceElement;
if(sLink !=null &&  sLink.tagName=='A')sLink.disabled = false;$get('" + progress.ClientID + @"').style.display = 'none';}
                    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequest);
                    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);"
                , true);

posted @ 2010-08-03 14:47 Don 阅读(183) 评论(0) 编辑

2008年9月12日

大家经常会发现Table的BORDER设置为1,得到的边框却不是想要的1个像素的细边框,于是很多人去想方设法做出细边框的效果。

设置Table的细边框通常有这么几种方式:

1、设置边框的BORDER=0 、cellspacing=1,设置Table的背景色为所要的边框色,再设置所有的td背景色为白色,这样细边框就显露出来了。这个方法有些邪气,看似不太正宗,但是也能达到效果,条条大路通罗马嘛!

再来看看第二种方法:

2、设置BORDER=0 ,再通过CSS,给Table加上1px的border-top,border-left,然后再设置所有的td的border-right,border-bottom,这样也能达到所要的效果。可见CSS很是强大啊。

今天在实践过程中发现,以上两种方式生成的HTML在Word中打开则发生问题,不能达到预期效果。怎么办呢!?

下面介绍一种更为简便有效的方法:

3、设置table的CSS为{border-collapse:collapse;border:none;},再设置td的CSS为{border:solid #000 1px;},大功告成!而且Word也能认出这种设置。

 

笔者目前只想出这么几种常用的方法,不知是否还有其他设置细边框妙招,若哪位达人知道请跟贴写下哦!!!

 

 

 

posted @ 2008-09-12 14:30 Don 阅读(5334) 评论(3) 编辑

2008年9月8日

 

(译)SDL.NET Surfaces 相关介绍

翻译:Don

http://don.cnblogs.com/

 

Surfaces(平面)
本教程教大家如何使用SDL.NETSurfaces在屏幕上渲染图形。(本教程的前提条件是认为您已经学会了“Hello World”哦!)
目录
1、
引言
2、
功能

2.1 Blit 
2.2
Primitive Drawing

2.3颜色、透明度和Alpha混合   

3、集合

引言
Surfaces (平面)类SDL.NET中用于描绘图形,实现的功能和SDL中的几乎一样。您可以new一个全新的Surfaces实例,或从内存中加载它,也可以是硬盘、数据流等。Surfaces类还提供其所属图形的相关属性,如:宽度、高度。Surfaces类还提供一些函数用于绘制图形

功能
下面是Surfaces的一些功能: 
Blit
快速Blitting是复制一个Surfaces到另外一个Surfaces的概念。在SDL.NET内,Blit函数是把给定的Surfaces复制到当前Surfaces上。destinationSurface.Blit(sourceSurface)该函数就是把sourceSurface绘制到目标Surfaces(0,0)位置。如果你看看SDL.NET的文档,你会注意到有大量函数用于Blitting一个Surfaces到另外的一个Surfaces上。

// Draw the player onto the screen
screen.Blit(player, playerLocation)

新的SDL的用户会常犯这样的错误:在Blitting Surfaces后他们不刷新屏幕。这个刷新(update)动作是必需的,否则屏幕不会刷新新的Surfaces,改变后的内容也就不会被看到了。
Primitive Drawing
SDL.NET
Surfacesl类调用的是SDLSDL_gfx库,这意味着它能实现非常多的功能,能绘制线、圆、多边形、三角形等等。在这些绘制方法里你可以觉得是否使用透明效果。
色彩、透明和Alpha混合  
当一个Surface复制到另外一个Surface上时候,Color Key指定了源Surface的透明色为该颜色值。如果在SDL.NETSurface上给TransparentColor设置了值,则该颜色即为透明色,当该Surface Blit到另外的一个Surface上时,源Surface对应的该颜色将会被忽略掉(即产生透明效果)。

 

// Set the color key to magenta
surface.TransparentColor = System.Drawing.Color.Magenta;
surface.Transparent 
= true;

集合
SurfaceCollectionss
是用ListSurface的封装。 这样管理多个Surfaces将会非常容易。使用SurfaceCollectionss的优点是:灵活的同时加载一系列Surfaces,灵活的添加或移除一些Surfaces

 

 

原文参见:http://cs-sdl.sourceforge.net/index.php/Surfaces#Color_Keys.2C_Transparency_and_Alpha_Blending.2C_Oh_My.21

posted @ 2008-09-08 23:46 Don 阅读(391) 评论(0) 编辑

2008年8月5日

摘要: 推荐一款不错的2D游戏引擎HGE 。阅读全文

posted @ 2008-08-05 23:38 Don 阅读(3107) 评论(1) 编辑

2008年6月14日

摘要: Access中:DateDiff('d',Time1,Time2)Sql中:DateDiff(d,Time1,Time2)下面是我自己的sql语句'判断数据库类型IF IsSqlDataBase = 1 ThenConn.execute("Delete from lyt_log_info where datediff(day,logintime,getdate())>=3 ")ElseCon...阅读全文

posted @ 2008-06-14 22:55 Don 阅读(781) 评论(0) 编辑

2008年6月12日

摘要: 用这句试试:(System.Diagnostics.Process.GetCurrentProcess().ProcessName != "devenv")阅读全文

posted @ 2008-06-12 15:08 Don 阅读(97) 评论(1) 编辑

2008年5月5日

摘要: window.event IE:有window.event对象 FF:没有window.event对象。可以通过给函数的参数传递event对象。如onmousemove=doMouseMove(event) 鼠标当前坐标 IE:event.x和event.y。 FF:event.pageX和event.pageY。 通用:两者都有event.clientX和event.clientY属性。 鼠标当...阅读全文

posted @ 2008-05-05 09:57 Don 阅读(129) 评论(0) 编辑

摘要: 取得当前鼠标的X,Y坐标function SelfXY(){ var yScrolltop; var xScrollleft; if (self.pageYOffset || self.pageXOffset) { yScrolltop = self.pageYOffset; xScrollleft = self.pageXOffset; } else if (document.documen...阅读全文

posted @ 2008-05-05 09:35 Don 阅读(202) 评论(0) 编辑

2008年4月7日

摘要: 使用vs2008编译一个项目时遇到错误, Task failed because "AL.exe" was not found 解决方法如下:First of all you need to find the path of AL.exe on your machine, AL.exe should be there when you install Windows SDK.Go to: Star...阅读全文

posted @ 2008-04-07 09:54 Don 阅读(1063) 评论(0) 编辑