用户操作
[即时聊天] [发私信] [加为好友]
ID:wangweixing2000
59457次访问,排名1784好友68人,关注者216
爱好:足球,健身,看电影.
wangweixing2000的文章
原创 70 篇
翻译 0 篇
转载 41 篇
评论 45 篇
星的公告
知识共享,快乐coding!! 千里之行﹐始於足下! Locations of visitors to this page
最近评论
mikefather:很好啊
hailongxl://修改employee密码
extern "C" XDATAMANAGER_API int __stdcall DBChangePassword(const char *user,const char*pass)
{
#if USE_SQLITE
if( db == NULL )return X_DB_NOT_INIT;

……
lhtang:Program file does not exist
E:\S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\release\WINSCW\UDEB\first_syb_hello_0xE40082A0.exe not found

这是为什么?
lhtang:里面只是些zip压缩包,ide里是不是有个添加插件的界面,还有下的1.3的carbide打不开
wangweixing2000:http://www.forum.nokia.com/info/sw.nokia.com/id/48a93bd5-028a-4b3e-a0b1-148ff203b2b3/Extensions_plugin_S60_3rd_ed.html
这里去下载
文章分类
收藏
相册
csdn友情连接
COM集中营
kennykerr的blog
休闲空间(RSS)
婉儿的blog(RSS)
数字金刚
推荐经典网站
Codeguru
CodeProject
我的网站
我的免费代码垃圾堆
我的网站
存档
软件项目交易
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
订阅到BlogLines
订阅到Yahoo
订阅到GouGou
订阅到飞鸽
订阅到Rojo
订阅到newsgator
订阅到netvibes

转载 Silverlight 2 手把手(之一) Deep Zoom收藏

新一篇: IE7还没有用多久,IE8已经出来了,微软明显加快了步伐了!! | 旧一篇: Silverlight 入门

Silverlight 2 手把手(之一) Deep Zoom

下面的例子介绍了如何利用一刻钟的时间快速实现一个 Deep Zoom 应用,供您参考。

1. 启动 Deep Zoom Composer 预览版

image

2. 使用 Deep Zoom Composer 创建 SDI(Sea Dragon Index) 文件集

image

选取使用照片

image

布置照片

image

输出 SDI 文件

image

输出结果

3. 使用 Visual Studio 2008 创建 Silverlight 网站应用

如果你没有安装 Silverlight 2 beta1 的插件,可以到这里下载。

image

image

4. 添加 SDI 文件集到 ClientBin 目录下

image

5. 使用 <MultiScaleImage> 引用 info.bin

<MultiScaleImage x:Name="DeepZoomCan" Source="[yourfolder]/info.bin" Height="294" Width="456" Canvas.Left="68" Canvas.Top="51" />

在 Page.xaml 中使用 MultiScaleImage 标签引用 DZC 打包生成的编译文件 info.bin

6. 编译,预览

image

7. 输入用户提示信息

image

您可以在 Expression Blend 2.5 3月预览版中调整文字的位置和大小,您也可以使用 VS2008,使用 <TextBlock /> 标签,调整文字信息。

8. 添加鼠标键盘响应事件

在 Page.xaml.cs 中加入对鼠标和键盘的事件响应,代码如下:

   1: namespace DeepZoomTest1
   2: {
   3:     public partial class Page : UserControl
   4:     {
   5:         Point mousePosition = new Point();
   6:  
   7:         public Page()
   8:         {
   9:             InitializeComponent();
  10:             InitializeMouseEvent();
  11:         }
  12:  
  13:         private void InitializeMouseEvent()
  14:         {
  15:             this.MouseMove += new MouseEventHandler(Page_MouseMove);
  16:             this.KeyDown += new KeyEventHandler(Page_KeyDown);
  17:         }
  18:  
  19:         void Page_KeyDown(object sender, KeyEventArgs e)
  20:         {
  21:  
  22:             if (e.Key == Key.W)
  23:             {
  24:                 Zoom(1.2f, mousePosition);
  25:  
  26:             }
  27:  
  28:             else if (e.Key == Key.X)
  29:             {
  30:                 Zoom(0.8f, mousePosition);
  31:             }
  32:             else
  33:             {
  34:                 HtmlPage.Window.Alert("请输入 W 或者 X 进行缩放!");
  35:             }
  36:         }
  37:  
  38:         void Page_MouseMove(object sender, MouseEventArgs e)
  39:         {
  40:             mousePosition = e.GetPosition(this);
  41:         }
  42:         public void Zoom(double zoom, Point pointToZoom)
  43:         {
  44:             Point logicalPoint = this.DeepZoomCan.ElementToLogicalPoint(pointToZoom);
  45:             this.DeepZoomCan.ZoomAboutLogicalPoint(zoom, logicalPoint.X, logicalPoint.Y);
  46:         }
  47:     }
  48: }

9. 添加对用户提示的 Alert 事件

Silverlight 2 中原生支持了对页面中的 DOM 调用!!!为了给用户更多的提示,在 Silverlight 2 中你可以添加以下键盘事件的判断,给用户更好的提示:

   1: else
   2: {
   3:     HtmlPage.Window.Alert("请输入"W"或者"X"进行缩放!");
   4: }

注意:你需要在 Silverlight 2 项目的默认引用中添加如下 namespace 的引用

   1: using System.Windows.Browser;

10. 最终效果

image

你可以到下面地址下载项目的源文件:

 

更多参考博客:

Expression 产品组博客

Dan Waters 的博客

Published 30 March 08 11:17 by jijia Filed under:

发表于 @ 2008年04月17日 16:50:00|评论(loading...)|收藏

新一篇: IE7还没有用多久,IE8已经出来了,微软明显加快了步伐了!! | 旧一篇: Silverlight 入门

评论:没有评论。

发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © 星