MGEffV1dot0ProgrammingGuide < Main < TWiki Page 2 of 版本日期

Size: px
Start display at page:

Download "MGEffV1dot0ProgrammingGuide < Main < TWiki Page 2 of 版本日期"

Transcription

1 MGEffV1dot0ProgrammingGuide < Main < TWiki Page 1 of 2 mgeff 编程指南 目录修订记录版本变更记录 目录 前言 版权声明 关于本指南 第一部分 mgeff 简介 第一章动画原理 第二章 mgeff 架构与特性 第二部分 mgeff 使用基础 第三章开始启程 第四章创建和运行动画 第五章动画的参数 第六章动力曲线 第七章动画的属性 第八章动画上下文信息 第九章动画的运行方式及控制 第十章动画组 第十一章动画回调函数 第三部分 mgeff 高级动画 第十二章特效器 第十三章主窗体动画 第四部分 mgeff 使用进阶 第十四章自定义特效器 第十五章自定义动力曲线 第五部分附录 附录 1 相关数据结构 附录 2 FAQ? 修订记录 版本 作者完成日期评审者评审日期版本 董凯王旭斌胡兆麟 V1.0 变更记录

2 MGEffV1dot0ProgrammingGuide < Main < TWiki Page 2 of 版本日期内容备注 V 完成初稿 mgeff V1.0 - rev XuBinWang - 12 Jan 2011 This topic: Main > MiniGUI > MGEffV1dot0ProgrammingGuide History: r23-15 Feb :10:36 - YongmingWei Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

3 MGEffV1dot0PGC00CopyrightClaim < Main < TWiki Page 1 of 版权声明 版权声明 版权声明 mgeff 编程指南 版本 1.0, 适用于 mgeff Version 1.0.x 版权所有 (C) 2003~2011, 北京飞漫软件技术有限公司, 保留所有权利 无论您以何种方式获得该手册的全部或部分文字或图片资料, 无论是普通印刷品还是电子文档, 北京飞漫软件技术有限公司仅仅授权您阅读的权利, 任何形式的格式转换 再次发布 传播以及复制其内容的全部或部分, 或将其中的文字和图片未经书面许可而用于商业目的, 均被视为侵权行为, 并可能导致严重的民事或刑事处罚 -- ZhaolinHu - 18 Jan 2011 This topic: Main > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC00CopyrightClaim History: r3-11 Feb :09:16 - XuBinWang Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

4 MGEffV1dot0PGC00AboutMe < Main < TWiki Page 1 of 1 关于本编程指南 章节编排 章节编排 第一部分 mgeff 简介 介绍了动画的原理以及 mgeff 的框架等 第二部分 mgeff 编程基础 本部分将从最简单的例子开始, 完整的向读者介绍 mgeff 动画的基础接口与生命周期等 第三部分 mgeff 高级动画 本部分介绍 mgeff 内建特效器的使用和主窗口动画,mGEff 提供了大量稳定而高效的特效器, 为读者快速实现翻转, 放大, 滚屏, 卷页等常用动画提供了可能 并且 mgeff 可以与 MiniGUI 结合, 以双缓冲为基础开发了针对主窗口动画的动画接口 第四部分 mgeff 编程进阶 --- 本部分属于高阶编程, 介绍如何自定义动力曲线与特效器, 并通过重载各种默认的动画回调以更有力的控制动画执行, 协助读者随心所欲的实现高效而富有个性的动画 -- KaiDong - 19 Jan 2011 This topic: Main > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC00AboutMe History: r4-27 Jan :29:40 - XuBinWang Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

5 MGEffV1dot0PGC00 < Main < TWiki Page 1 of mgeff 前言 前言 前言 -- XuBinWang - 12 Jan 2011 This topic: Main > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC00 History: r4-11 Feb :08:57 - XuBinWang Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

6 MGEffV1dot0PGC01 < Main < TWiki Page 1 of 1 动画原理 动画的原理帧动画属性动画 mgeff 支持的是属性动画 动画的原理 动画是将静止的画面变为动态的艺术, 实现由静止到动态的变化, 主要依靠的是人眼的视觉残留效应, 一般而言, 动画分为两种类型 : 帧 (Frame) 动画和属性 (Property) 动画 帧动画 帧动画是指播放事先准备好的一系列存在一定差异的图像来实现图像上事物动态变化的一种动画, 比如 GIF 图片等 ; 属性动画 属性动画则是指通过改变被显示对象的各种属性 ( 例如尺寸 位置 角度 透明度等 ) 来达到变化效果的一种动画, 这种动画也有帧的概念, 只不过每一帧是通过实时计算对象的属性值来产生的 mgeff 支持的是属性动画 mgeff 支持的是属性动画 : 用户通过设置动画对象相关属性的一些参数, 比如属性的起始值 终止值 动力曲线 ( 变化方式 ) 以及动画持续的时间等相关参数, 然后 mgeff 就可以根据这些相关的参数, 随时间的变化计算出一组从起始值到终止值变化的数值, 按这组时间属性值的变化曲线设置动画对象的相关属性, 即可产生相应的动画效果 归纳起来,mGEff 实现了一种在一定时间范围内, 根据给定的动力曲线将属性值从起始值变化到终止值的动画机制 在下一章 我们将详细介绍 mgeff 是如何实现属性动画的 -- XuBinWang - 12 Jan 2011 This topic: Main > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC01 History: r15-27 Jan :29:41 - XuBinWang Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

7 MGEffV1dot0PGC02 < Main < TWiki Page 1 of 2 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC02 r12-27 Jan :29:42 - XuBinWang mgeff 的架构与特性 mgeff 是什么设计目标 mgeff 的框架 mgeff 的类主要特性本章小结 mgeff 是什么 mgeff 是一个轻量级动画框架, 它提供了一套高效灵活的动画实现方案 设计目标 mgeff 的设计目标是建立起一套平台无关的动画机制, 它可以和 MiniGUI GTK+ 等 GUI 系统相结合开发相应的 (GDI 级 控件级和窗口级 ) 动画 mgeff 的框架 以下是它与 MiniGUI 相结合的框架 : mgeff 的类 mgeff 本身采用 C 语言开发的, 但其设计及实现上运用了一些基本的面向对象思想, 比如以 struct 模拟 class 等, 了解这些结构 ( 类 ) 对使用它会很有帮助, 下面是 mgeff 的 类 图 : // TODO 类图 主要特性 mgeff 提供了以下主要特性 : 驱动动画 动力曲线 串行 并行动画组 特效器 主窗体动画

8 MGEffV1dot0PGC02 < Main < TWiki Page 2 of 2 本章小结 本章简单介绍了 mgeff 的框架结构和主要特性 接下来的章节将会就这些特性逐步展开进行详细的介绍 -- XuBinWang - 12 Jan 2011 I Attachment Action Size Date Who Comment mgeff.png manage 10.1 K 19 Jan :32 KaiDong Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

9 MGEffV1dot0PGC03 < Main < TWiki Page 1 of 6 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC03 r20-14 Feb :12:58 - XuBinWang 开始启程 使用 mgeff 库函数原型初始化 mgeff 库函数注销 mgeff 库函数使用示例运行结果注意事项本章小结 使用 mgeff 库 在上一章中我们简单介绍了下 mgeff 的框架和特性, 在接下来的章节, 将带领大家进入奇妙的动画世界, 首先我们先介绍下 mgeff 库的使用 函数原型 mgeff 库提供了 mgeffinit/mgeffdeinit 函数分别负责库的初始化和注销 其原型为 : 初始化 mgeff 库函数 /* 初始化 mgeff 库函数 */ int mgeffinit (void); 参数说明 : void - 无参数 ; 返回值说明 : int - 0 初始化成功 ; 注销 mgeff 库函数 /* 注销 mgeff 库函数 */ void mgeffdeinit (void); 参数说明 : void - 无参数 ; 返回值说明 : void - 无返回值 ; 使用示例 下面我们结合一个简单的示例来给大家讲解下 mgeff 库的使用 在这里我们将只关注

10 MGEffV1dot0PGC03 < Main < TWiki Page 2 of 6 mgeffinit/mgeffdeinit 这两个函数的使用, 其他函数的使用将在后续章节中讲解 : #include <stdio.h> #include <string.h> #include <minigui/common.h> #include <minigui/gdi.h> #include <minigui/window.h> #include <minigui/minigui.h> #include <mgeff/mgeff.h> /********************************************************************* #define CAPTION "animation_sync" #define BAR_HEIGHT 50 #define DURATION (20 * 1000) #define START_VAL 0x00 #define END_VAL 0xFF /********************************************************************* static char g_str[64]; static int g_value = 0x00; /********************************************************************* /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPAR /* draw a frame */ static void draw_frame (HWND hwnd); /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int /* create and run an animation */ static int do_animation (HWND hwnd); /********************************************************************* int MiniGUIMain (int argc, const char *argv[]) HWND hmainhwnd; MAINWINCREATE createinfo; MSG msg; #ifdef _MGRM_PROCESSES JoinLayer (NAME_DEF_LAYER, "animation", 0, 0); #endif createinfo.dwstyle = WS_VISIBLE WS_BORDER WS_CAPTION; createinfo.dwexstyle = WS_EX_NONE; createinfo.spcaption = CAPTION; createinfo.hmenu = 0;

11 MGEffV1dot0PGC03 < Main < TWiki Page 3 of 6 createinfo.hcursor = GetSystemCursor (0); createinfo.hicon = 0; createinfo.mainwindowproc = mainwindowproc; createinfo.lx = 0; createinfo.ty = 0; createinfo.rx = 240; createinfo.by = 320; createinfo.ibkcolor = COLOR_lightwhite; createinfo.dwadddata = 0; createinfo.hhosting = HWND_DESKTOP; hmainhwnd = CreateMainWindow (&createinfo); if (hmainhwnd == HWND_INVALID) return -1; ShowWindow (hmainhwnd, SW_SHOWNORMAL); while (GetMessage (&msg, hmainhwnd)) TranslateMessage (&msg); DispatchMessage (&msg); MainWindowThreadCleanup (hmainhwnd); return 0; /********************************************************************** /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA switch (message) case MSG_CREATE: /* init mgeff library */ mgeffinit (); sprintf (g_str, "you can press any key."); do_animation (hwnd); break; case MSG_KEYDOWN: sprintf (g_str, "you press key, keycode(%d)", wparam); printf ("%s\n", g_str);

12 MGEffV1dot0PGC03 < Main < TWiki Page 4 of 6 InvalidateRect (hwnd, NULL, TRUE); break; case MSG_PAINT: draw_frame (hwnd); break; case MSG_CLOSE: DestroyMainWindow (hwnd); PostQuitMessage (hwnd); /* deinit mgeff library */ mgeffdeinit (); break; default: break; return DefaultMainWinProc (hwnd, message, wparam, lparam); /* draw a frame */ static void draw_frame (HWND hwnd) HDC dc; RECT rc; int client_w, client_h; char str[64]; int color; /* begin draw */ dc = BeginPaint (hwnd); /* get client rect */ GetClientRect (hwnd, &rc); client_w = RECTW (rc); client_h = (RECTH (rc) - BAR_HEIGHT) * g_value / (END_VAL - STA color = g_value; /* set brush and draw area */ SetBrushColor (dc, RGB2Pixel (dc, color, 0x00, 0x00)); FillBox (dc, 0, BAR_HEIGHT, client_w, client_h);

13 MGEffV1dot0PGC03 < Main < TWiki Page 5 of 6 /* draw the text */ sprintf (str, "current color: RGB(%d,0,0)", color); TextOut (dc, 0, 0, str); /* print information */ TextOut (dc, 0, BAR_HEIGHT / 2, g_str); EndPaint (hwnd, dc); /* end draw */ /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i /* set animation property */ g_value = *value; /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prope /* set animation property */ /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */

14 MGEffV1dot0PGC03 < Main < TWiki Page 6 of 6 mgeffanimationsetendvalue (animation, &end_val); /* running */ mgeffanimationsyncrun (animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; 可以看到, 程序在创建的时候 ( 消息 MSG_CREATE 中 ) 调用了初始化函数 mgeffinit(), 在关闭的时候 ( 消息 MSG_CLOSE 中 ) 调用了注销函数 mgeffdeinit() 在这两个函数之间调用诸如创建动画, 设置属性, 运行动画等 mgeff 函数 运行结果 注意事项 但需要注意的是,mGEff 不是线程安全的, 所以请不要在多个线程中同时使用 本章小结 本章通过一个简单的 mgeff 示例演示了如何在 MiniGUI 程序中引入和准备 mgeff 环境, 做好了这些准备工作, 就能够开始使用 mgeff 实现动画了 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

15 MGEffV1dot0PGC04 < Main < TWiki Page 1 of 4 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC04 r18-14 Feb :13:43 - XuBinWang 创建和运行动画 创建和运行动画函数原型创建动画对象函数回调函数同步运行动画对象函数使用示例运行结果句柄的概念本章小结 创建和运行动画 在上一章中我们介绍了 mgeff 库的初始化和注销, 通过例子我们学习了库的初始化和注销函数在什么地方什么时候调用 在这章里面我们将要学习如何创建一个动画对象以及使这个动画动起来 函数原型 mgeff 库提供了两个函数分别用来创建动画对象和运行动画 其原型为 : 创建动画对象函数 BeautifierPlugin Error: Unable to handle " cpp " language. /* 创建动画对象 */ MGEFF_ANIMATION mgeffanimationcreate (void *target, MGEFF_SETPROPERTY_ 参数说明 : target - 要进行动画的目标对象, 这里因为我们只演示 mgeff 创建动画的方式, 所以先暂时传入 NULL, 没有具体的动画对象 ; setproperty - 属性变化时要调用的回调函数指针, 此函数会在动画的每一帧产生时被调用, 稍后会着重进行介绍 ; id - 属性 / 动画的 ID, 这个值将作为参数传递给回调函数, 用来在多个动画共用同一回调函数时区分要修改的属性 ; varianttype - 属性值的类型, 这个参数决定了属性起始值与终止值的数据类型,mGEff 里定义了一组类型的枚举, 其定义如下 : BeautifierPlugin Error: Unable to handle " cpp " language. enum EffVariantType MGEFF_INT = 0, /* 整型 */ MGEFF_FLOAT = 1, /* 浮点类型 */ MGEFF_DOUBLE = 2, /* 双精度浮点类型 */ MGEFF_POINT = 3, /* 整型点 */

16 MGEffV1dot0PGC04 < Main < TWiki Page 2 of 4 ; MGEFF_POINTF = 4, /* 浮点类型点 */ MGEFF_3DPOINT = 5, /* 整型 3 维点 */ MGEFF_3DPOINTF = 6, /* 浮点类型 3 维点 */ MGEFF_RECT = 7, /* 区域 */ MGEFF_COLOR = 8, /* 颜色 */ MGEFF_MAX 返回值说明 : handle - 动画对象句柄 ; 回调函数 mgeff 是属性动画, 而当动画的属性值 ( 比如当前幀 状态 方向等 ) 改变的时候,mGEff 会通过调用回调的方式来通知用户 比如这里的 MGEFF_SETPROPERTY_CB 回调函数就会在每一幀发生的时候调用, 用户可以在这里根据属性的变化值绘制动画对象 这里我们先接触一下帧回调函数, 关于回调函数的概念我们将有专门的一章来介绍它, 回调函数的原型 : BeautifierPlugin Error: Unable to handle " cpp " language. typedef void (* MGEFF_SETPROPERTY_CB)(MGEFF_ANIMATION handle, void *tar 参数说明 : handle - 调用本函数的动画句柄, 通过这个句柄可以在函数中访问到与动画相关的一些信息 ; target - 要进行动画的目标对象, 它在调用 mgeffanimationcreate 创建动画时被指定, 它可以是窗口 控件句柄或者是自定义的对象 ; id - 属性的 ID 值, 同样也是在调用 mgeffanimationcreate 时指定的, 有时用户希望在多个动画里共用同一个回调函数以控制对象多个属性的变化, 此时可以为每个属性设置不同的 ID 值, 让用户在回调函数里判断当前发生改变的属性 针对一些常用的属性对象, 预先设置了如下 ID 值, 用户可以直接拿来用 : BeautifierPlugin Error: Unable to handle " cpp " language. ; enum EffPropertyID ID_NULL = 0, ID_POS, /* POINT */ ID_SIZE, /* RECT */ ID_RECT, /* RECT, pos & size */ ID_OPACITY, /* int */... ID_USER = 1000; value - 属性的当前值, 属性的起始值与终止值由 mgeffanimationsetstartvalue/mgeffanimationsetendvalue 两个函数设置, 在前面提到过 mgeff 的整个动画过程就是将属性从起始值变化到终止值, 而这个 value, 每一幀的变化值 本示例中只是将该值做打印处理, 用户可以用它来驱动动画对象的相关属性, 比如长度, 大小, 颜色等, 来实现相关的动画效果

17 MGEffV1dot0PGC04 < Main < TWiki Page 3 of 4 返回值说明 : void - 无返回值 ; 同步运行动画对象函数 BeautifierPlugin Error: Unable to handle " cpp " language. /* 同步运行动画 */ int mgeffanimationsyncrun (MGEFF_ANIMATION handle); 参数说明 : handle - 动画对象句柄 返回值说明 : int - 使用示例 仍然以上一章中的示例为例, 函数 do_animation 中包含了创建和运行一个动画的全过程 : BeautifierPlugin Error: Unable to handle " cpp " language. /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int /* set animation property */ g_value = *value; /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) property /* set animation property */

18 MGEffV1dot0PGC04 < Main < TWiki Page 4 of 4 /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* running */ mgeffanimationsyncrun (animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; 通过阅读上述代码, 我们看到创建一个动画对象的步骤为 : 先创建了一个动画对象, 设置幀回调函数 然后对这个动画对象, 设置了相关属性的起始值 结束值和动画持续时间等 最后调用动画运行函数, 运行这个动画 运行结果 句柄的概念 从上面的代码可以看到, 正如 MiniGUI 一样,mGEff 对外提供的对象访问方式也是通过 句柄 来完成的 句柄与普通指针的区别在于 : 指针包含的是引用对象的内存地址, 而句柄则是由框架所管理的引用标识, 该标识可以被框架重新定位到一个内存地址上 这种间接访问对象的模式增强了系统对引用对象的控制, 并减少对外暴露的数据结构, 有利于保持一个较简洁的 API 接口层 本章小结 本章展示了一个最简单的动画是如何创建 运行的, 并附带了一个简单的示例, 在之后的章节里, 会逐渐扩展完善这个示例以便向用户演示更多的 mgeff 特性 另外这一章详细描述了属性变化回调函数的概念和用法, 通过实现不同的属性变化回调, 用户可以得到各种各样的动画特效, 概括起来就是 mgeff 只提供了运行动画的驱动力, 具体要如何运用这个驱动力来产生动画, 主要就看用户如何实现这个回调函数了 最后还介绍了 句柄 一词在 mgeff 中的含义, 通过句柄访问对象是 mgeff 提供统一访问途径 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

19 MGEffV1dot0PGC05 < Main < TWiki Page 1 of 3 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC05 r11-14 Feb :52:01 - XuBinWang 动画的参数 动画的参数函数原型设置动画运行时间函数设置动画属性开始值函数设置动画属性结束值函数使用示例运行结果本章小结 动画的参数 在上一章中我们介绍了如何创建动画以及如何运行这个动画, 接下来我们将介绍如何去控制动画的运行时间以及动画对象相关属性值的控制比如起始值和结束值等 函数原型 mgeff 提供了三个函数分别用于控制动画的运行时间和设置动画属性值的起始值和结束值 其原型分别是 : 设置动画运行时间函数 /* 设置动画运行时间 */ void mgeffanimationsetduration (MGEFF_ANIMATION handle, int duration_m 参数说明 : handle - 动画对象句柄 ; duration_ms - 运行时间, 单位 ms; 返回值说明 : void - 无返回值 ; 设置动画属性开始值函数 /* 设置动画开始值 */ void mgeffanimationsetstartvalue (MGEFF_ANIMATION handle, const void * 参数说明 : handle - 动画对象句柄 ; value - value 是 void* 型, 这就允许往里面传入任意类型的指针 这么设计的原因是动画要控制的属性可能有多种类型, 例如整型 浮点型甚至是结构体, 所以这里并不限定具体的类型 而这一类型将在动画创建时指定, 具体请参考 创建和运行动画 一章中对 mgeffanimationcreate 函数的介绍 在调用上述两个函数设置属性的起止值时, 应

20 MGEffV1dot0PGC05 < Main < TWiki Page 2 of 3 返回值说明 : 该传入创建动画时所约定类型的指针, 否则会导致不可预料的程序错误! void - 无返回值 ; 设置动画属性结束值函数 /* 设置动画结束值 */ void mgeffanimationsetendvalue (MGEFF_ANIMATION handle, const void *va 参数说明 : handle - 动画对象句柄 ; value - 和传入 mgeffanimationsetstartvalue 的值的类型一致 ; 返回值说明 : void - 无返回值 ; 使用示例 仍以之前的示例代码片段为例, 介绍这几个函数的使用 : /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prop /* set animation property */ /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* running */

21 MGEffV1dot0PGC05 < Main < TWiki Page 3 of 3 mgeffanimationsyncrun (animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; 上述代码中,startvalue 和 endvalue 是 RGB 颜色中红色值的起始值和结束值, 改动画运行的效果就是将红色值从 0x00 变化到 0xFF 运行结果 本章小结 本章介绍了动画的几项运行时的参数, 包括属性起止值和持续时间,mGEff 会在动画运行过程中将属性值按照一定的变化规律 ( 动画曲线 ), 从起始值变化到结束值 并将变化值通过帧回调函数通知给用户, 用户可以根据这些绘制动画的每一帧 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

22 MGEffV1dot0PGC06 < Main < TWiki Page 1 of 3 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC06 r10-14 Feb :54:38 - XuBinWang 动力曲线 动力曲线函数原型设置动力曲线函数预置的动力曲线类型曲线示例运行结果本章小结 动力曲线 前面的章节介绍了如何创建及运行一个动画, 通过执行程序得到的控制台输出可以看到从起始值到终止值的变化过程 但同时也可以看到属性值在起止值之间的变化是均匀的, 即为线性变化 如果将这种变化应用到实际动画得到的效果会比较直接和呆板, 而用户往往需要将属性值进行诸如加速 减速甚至振荡等非线性的变化, 以便达到更灵活真实的动画特效, 这就需要用到 mgeff 中的另一个特性 动力曲线, 本章介绍的及时如何通过它控制动画的运行, 以达到属性值的不同变化效果 函数原型 mgeff 提供了一个函数用于设置动力曲线, 其原型如下 : 设置动力曲线函数 void mgeffanimationsetcurve(mgeff_animation handle, enum EffMotionTyp 参数说明 : handle - 要设置动力曲线的动画句柄 ; type - 预置曲线的类型, 类型见下一节 ; 返回值说明 : void - 无返回值 ; 预置的动力曲线类型 mgeff 中预置了几十种动力曲线以便用户选用, 通过给动画设置这些不同的曲线可以达到各种变化效果 : enum EffMotionType Linear, /* 线性曲线, 动画创建后默认的曲线类型 */ InQuad, OutQuad, InOutQuad, OutInQuad, InCubic, OutCubic, InOutCubic, OutInCubic, InQuart, OutQuart, InOutQuart, OutInQuart, InQuint, OutQuint, InOutQuint, OutInQuint, InSine, OutSine, InOutSine, OutInSine,

23 MGEffV1dot0PGC06 < Main < TWiki Page 2 of 3 ; InExpo, OutExpo, InOutExpo, OutInExpo, InCirc, OutCirc, InOutCirc, OutInCirc, InElastic, OutElastic, InOutElastic, OutInElastic, InBack, OutBack, InOutBack, OutInBack, InBounce, OutBounce, InOutBounce, OutInBounce, InCurve, OutCurve, SineCurve, CosineCurve, Custom, NCurveTypes 曲线示例 在这里我们对之前的示例代码进行扩充, 其值按照 InQuad 曲线方式变化 : /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prope /* set animation property */ /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* set curve */ mgeffanimationsetcurve (animation, InQuad); /* running */ mgeffanimationsyncrun (animation);

24 MGEffV1dot0PGC06 < Main < TWiki Page 3 of 3 /* delete the animation object */ mgeffanimationdelete (animation); return 0; 从执行结果可以看到改变动画的动力曲线后, 与之前默认的线性变化输出的插值有了明显的区别 : 属性值呈加速规律变化 可以想像如果将 printf 语句替换为真正设置对象属性的代码后 ( 如修改圆的半径, 矩形的宽高等 ), 使动画带有变速效果 运行结果 本章小结 本章介绍了动力曲线的作用及预置曲线的使用方法, 不同的曲线会给动画带来不同的变化效果, 使动画更加真实和灵活 在后面的章节中, 还会介绍自定义曲线的使用方法 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

25 MGEffV1dot0PGC07 < Main < TWiki Page 1 of 3 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC07 r11-14 Feb :14:36 - XuBinWang 动画的属性 动画的属性函数原型设置动画属性函数获取动画属性函数 mgeff 支持的动画属性使用示例运行结果本章小结 动画的属性 在开始这一章之前, 需要先明确两个概念 属性动画 和 动画的属性 : 属性动画, 指的是通过修改动画中某个目标对象的某些属性, 比如大小, 颜色等来达到目标对象动态变化的一种动画 ; 动画的属性, 指的是这个动画自身的一些属性, 比如前一章所说的运行时间, 总的运行次数, 当前运行次数等之类的属性 两者不可混淆 函数原型 mgeff 提供了如下函数来设置和获取动画的属性, 其原型如下 : 设置动画属性函数 void mgeffanimationsetproperty(mgeff_animation handle, enum EffAnimPro 参数说明 : handle - 动画对象句柄 ; id - 属性的标志, 具体值可参考 EffAnimProperty? 枚举定义 ; value - 要设置的属性值 ; 返回值说明 : void - 无返回值 ; 获取动画属性函数 int mgeffanimationgetproperty(mgeff_animation handle, enum EffAnimProp 参数说明 : handle - 动画对象句柄 ; id - 属性的标志, 具体值可参考 EffAnimProperty? 枚举定义 ; 返回值说明 :

26 MGEffV1dot0PGC07 < Main < TWiki Page 2 of 3 int - 当前属性值 ; mgeff 支持的动画属性 目前 mgeff 支持的动画属性定义如下 : enum EffAnimProperty MGEFF_PROP_DURATION = 0, /* 可读写属性, 动画执行一次的持续时间 MGEFF_PROP_CURLOOP = 1, /* 只读属性, 动画当前循环运行的次数 * MGEFF_PROP_LOOPCOUNT = 2, /* 可读写属性, 动画循环运行的次数 * MGEFF_PROP_DIRECTION = 3, /* 可读写属性, 动画运行的方向 */ MGEFF_PROP_CURFRAME = 4, /* 只读属性, 当前帧 */ MGEFF_PROP_STATE = 5, /* 只读属性, 当前状态 */ MGEFF_PROP_MAX ; 请注意上述属性的注释, 里面指明了哪些属性的只读属性, 哪些属性是可以设置的, 在使用过程应该区分开来 使用示例 下面通过扩展之前的示例来演示如何设置和获取动画的属性 : /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int /* set animation property */ g_value = *value; /* get current loop */ g_loop = mgeffanimationgetproperty (handle, MGEFF_PROP_CURLOOP /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL;

27 MGEffV1dot0PGC07 < Main < TWiki Page 3 of 3 end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prope /* set animation property */ /* set loopcount */ mgeffanimationsetproperty (animation, MGEFF_PROP_LOOPCOUNT, LOO /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* running */ mgeffanimationsyncrun (animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; 上例中在创建动画时指定了动画的 MGEFF_PROP_LOOPCOUNT 属性为 3, 即动画运行后将循环 3 次 并在属性变化回调函数里获得当前循环过的次数 运行结果 本章小结 本章主要介绍了 属性动画 与 动画属性 两个概念的区别, 并针对 动画属性 的设置与获取进行了介绍 通过动画的属性, 可以很方便的操作动画的一些行为 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

28 MGEffV1dot0PGC08 < Main < TWiki Page 1 of 3 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC08 r11-14 Feb :15:05 - XuBinWang 动画上下文 动画上下文函数原型设置动画上下文函数获取动画上下文函数使用示例运行结果上下文生命域本章小结 动画上下文 一个动画可以设置上下文以便携带更多的用户信息, 该特性常被用在属性变化回调函数里面 函数原型 mgeff 提供了如下函数用来设置和获取动画的上下文 其原型如下 : 设置动画上下文函数 void mgeffanimationsetcontext(mgeff_animation handle, void* context); 参数说明 : handle - 动画对象句柄 ; context - 上下文信息指针 ; 返回值说明 : void - 无返回值 ; 获取动画上下文函数 void *mgeffanimationgetcontext(mgeff_animation handle); 参数说明 : handle - 从句柄为 handle 的动画中获取上下文信息 ; 返回值说明 : context - 动画对象的上下文信息指针 ; 通过上面两个函数, 可以设置和获得动画的上下文 上下文指针都是 void* 型的, 表明可以接收任意类型的指针, 其具体的类型由用户约定, 这里需要注意一个生命域的问题, 下面将有一节专门讲解这个 使用示例

29 MGEffV1dot0PGC08 < Main < TWiki Page 2 of 3 同样以之前的示例片断为例来介绍这一特性的使用方法 : /* callback of property */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int MY_CONTEXT *pcontext; /* get and print context */ pcontext = (MY_CONTEXT *)mgeffanimationgetcontext (handle); if (pcontext->value!= *value) pcontext->value = *value; printf ("CONTEXT: name(%s) value(%d)\n", pcontext->nam /* set animation property */ g_value = *value; /* get current loop */ g_loop = mgeffanimationgetproperty (handle, MGEFF_PROP_CURLOOP /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prop /* set animation property */ /* set loopcount */ mgeffanimationsetproperty (animation, MGEFF_PROP_LOOPCOUNT, LO /* duration */

30 MGEffV1dot0PGC08 < Main < TWiki Page 3 of 3 mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* set context */ mgeffanimationsetcontext (animation, (void *)&g_my_context); /* running */ mgeffanimationsyncrun (animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; 运行结果 上下文生命域 由于动画上下文只是一个 void* 型的指针, 所以使用时具体类型要由用户来约定, 如果用户为上下文动态分配了空间, 也应该自己在动画完成后将其释放 另外需要注意的是如果上下文是在栈上分配的, 而动画以异步方式运行 ( 详情请参考 动画运行方式 一章 ), 那么很可能在动画的属性变化回调被调用时已经离开了上下文的生命域, 此时获得到的上下文指针已经指向无效的内容, 将会导致不可预料的运行错误, 例如将上例中的 mgeffanimationsyncrun 函数替换为 mgeffanimationasyncrun, 就可能会出现这种情况, 因为 context 数组是在栈上的 要避免这种情况发生有多种方法, 比如可以在离开 context 生命域之前调用 mgeffanimationwait 函数等待异步动画结束, 或者在堆上分配 context 空间, 并在动画结束时释放 ( 至于如何掌握动画的结束时机, 请参考 回调函数 章节 ) 本章小结 本章介绍了动画上下文这一特性及其应用方式, 通过上下文要以给动画附加更多信息并在有需要的地方获取这些信息 不过用户需要保证 context 的生命周期不能短于动画生命周期, 以防止出现在动画执行中获取不到正确上下文的情况 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

31 MGEffV1dot0PGC09 < Main < TWiki Page 1 of 8 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC09 r10-14 Feb :00:35 - XuBinWang 动画的运行方式及控制 动画的运行方式函数原型同步运行动画函数异步运行动画函数等待异步动画运行结束函数暂停动画运行函数恢复动画运行函数停止动画运行函数使用示例运行结果注意事项本章小结 动画的运行方式 动画支持同步及异步两种不同的执行方式 采用同步方式运行的动画, 程序阻塞在运行函数上, 直到动画结合, 函数返回, 程序才继续运行, 在这个过程中程序将无法响应消息 ; 而采用异步方式运行的动画, 运行函数调用后立即返回, 此时动画在后台被调度执行, 直到被中止或结束, 而程序可以相应消息处理 下面将分别介绍这两种运行方式的使用和控制 函数原型 截止到本章为止, 我们在所有的示例程序中的动画都是以同步方式运行的, 同步动画的使用比较简单, 直接在动画创建后调用 mgeffanimationsyncrun 函数就可以开始动画并且直到其结束才返回, 整个过程是阻塞的, 在此期间程序是不能响应消息处理 接下我们开始介绍异步运行动画函数和如何控制动画的运行 mgeff 提供了以下几个函数来运行和控制动画 其原型分别为 : 同步运行动画函数 int mgeffanimationsyncrun(mgeff_animation handle); 参数说明 : handle - 动画对象句柄 ; 返回值说明 : int - 0; 异步运行动画函数 int mgeffanimationasyncrun(mgeff_animation handle);

32 MGEffV1dot0PGC09 < Main < TWiki Page 2 of 8 参数说明 : handle - 动画对象句柄 ; 返回值说明 : *int - 0; 等待异步动画运行结束函数 MGEFF_BOOL mgeffanimationwait(void* phwnd, MGEFF_ANIMATION handle); 参数说明 : phwnd - 当前线程的窗体句柄的地址 ; handle - 动画对象句柄 ; 返回值说明 : MGEFF_BOOL - 成功返回 MGEFF_TRUE, 否则返回 MGEFF_FALSE 暂停动画运行函数 void mgeffanimationpause(mgeff_animation handle); 参数说明 : * handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; 恢复动画运行函数 void mgeffanimationresume(mgeff_animation handle); 参数说明 : * handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; 停止动画运行函数 void mgeffanimationstop(mgeff_animation handle); 参数说明 : * handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; 使用示例 #include <stdio.h> #include <string.h> #include <minigui/common.h> #include <minigui/gdi.h>

33 MGEffV1dot0PGC09 < Main < TWiki Page 3 of 8 #include <minigui/window.h> #include <minigui/minigui.h> #include <mgeff/mgeff.h> /********************************************************************** #define CAPTION "animation_control" #define BAR_HEIGHT 50 #define DURATION (20 * 1000) #define START_VAL 0x00 #define END_VAL 0xFF /********************************************************************** static char g_str[64]; static int g_value = 0x00; static MGEFF_ANIMATION g_handle = NULL; /********************************************************************** /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA /* draw a frame */ static void draw_frame (HWND hwnd); /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i /* create and run an animation */ static int do_animation (HWND hwnd); /********************************************************************** int MiniGUIMain (int argc, const char *argv[]) HWND hmainhwnd; MAINWINCREATE createinfo; MSG msg; #ifdef _MGRM_PROCESSES JoinLayer (NAME_DEF_LAYER, "animation", 0, 0); #endif createinfo.dwstyle = WS_VISIBLE WS_BORDER WS_CAPTION; createinfo.dwexstyle = WS_EX_NONE; createinfo.spcaption = CAPTION; createinfo.hmenu = 0; createinfo.hcursor = GetSystemCursor (0); createinfo.hicon = 0; createinfo.mainwindowproc = mainwindowproc; createinfo.lx = 0; createinfo.ty = 0; createinfo.rx = 240;

34 MGEffV1dot0PGC09 < Main < TWiki Page 4 of 8 createinfo.by = 320; createinfo.ibkcolor = COLOR_lightwhite; createinfo.dwadddata = 0; createinfo.hhosting = HWND_DESKTOP; hmainhwnd = CreateMainWindow (&createinfo); if (hmainhwnd == HWND_INVALID) return -1; ShowWindow (hmainhwnd, SW_SHOWNORMAL); while (GetMessage (&msg, hmainhwnd)) TranslateMessage (&msg); DispatchMessage (&msg); MainWindowThreadCleanup (hmainhwnd); return 0; /********************************************************************** /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA switch (message) case MSG_CREATE: /* init mgeff library */ mgeffinit (); sprintf (g_str, "you can press any key."); do_animation (hwnd); break; case MSG_KEYDOWN: sprintf (g_str, "you press key, keycode(%d)", wparam); printf ("%s\n", g_str); if (g_handle!= NULL) if (wparam == SCANCODE_S) /* stop animation */ mgeffanimationstop (g_handle); sprintf (g_str, "stop animation");

35 MGEffV1dot0PGC09 < Main < TWiki Page 5 of 8 if (wparam == SCANCODE_P) /* pause animation */ mgeffanimationpause (g_handle); sprintf (g_str, "pause animation"); if (wparam == SCANCODE_R) /* resume animation */ mgeffanimationresume (g_handle); sprintf (g_str, "resume animation"); InvalidateRect (hwnd, NULL, TRUE); break; case MSG_PAINT: draw_frame (hwnd); break; case MSG_CLOSE: DestroyMainWindow (hwnd); PostQuitMessage (hwnd); /* deinit mgeff library */ mgeffdeinit (); break; default: break; return DefaultMainWinProc (hwnd, message, wparam, lparam); /* draw a frame */ static void draw_frame (HWND hwnd) HDC dc; RECT rc; int client_w, client_h; char str[64]; int color; /* begin draw */ dc = BeginPaint (hwnd);

36 MGEffV1dot0PGC09 < Main < TWiki Page 6 of 8 /* get client rect */ GetClientRect (hwnd, &rc); client_w = RECTW (rc); client_h = (RECTH (rc) - BAR_HEIGHT) * g_value / (END_VAL - STA color = g_value; /* set brush and draw area */ SetBrushColor (dc, RGB2Pixel (dc, color, 0x00, 0x00)); FillBox (dc, 0, BAR_HEIGHT, client_w, client_h); /* draw the text */ sprintf (str, "current color: RGB(%d,0,0)", color); TextOut (dc, 0, 0, str); /* print information */ TextOut (dc, 0, BAR_HEIGHT / 2, g_str); EndPaint (hwnd, dc); /* end draw */ /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i /* set animation property */ g_value = *value; /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION;

37 MGEffV1dot0PGC09 < Main < TWiki Page 7 of 8 start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prope g_handle = animation; /* set animation property */ /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* set loopcount */ // mgeffanimationsetproperty (animation, MGEFF_PROP_LOOPCOUN /* running */ mgeffanimationasyncrun (animation); /* wait animation stop */ mgeffanimationwait ((void *) &hwnd, animation); g_handle = NULL; /* delete the animation object */ mgeffanimationdelete (animation); return 0; 运行结果 注意事项 上述几个函数禁止用于同步运行动画对象 本章小结 本章介绍了动画的两种运行方式 同步和异步 这两种方式有各自的应用场景, 现将其优缺点整理如下 : 同步动画

38 MGEffV1dot0PGC09 < Main < TWiki Page 8 of 8 优点 缺点 异步动画 优点 缺点 使用简单 易于掌握生命周期 运行时程序无法响应其它消息 运行时程序仍然可以响应其它消息 用户可能需要自行控制其生命周期 涉及的函数较多, 使用稍为复杂 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

39 MGEffV1dot0PGC10 < Main < TWiki Page 1 of 7 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC10 r13-14 Feb :16:17 - XuBinWang 动画组 动画组函数原型创建动画组函数添加到动画组函数一点概念使用示例并行动画组串行动画组本章小结 动画组 在实际应用中, 用户往往不只是希望同时执行一个动画, 而是需要将多个动画关联起来并行或串行地执行, 以获得更复杂的动画效果 所以 mgeff 引入了动画组机制, 用户可以通过创建并行 (Parallel) 或串行 (Sequential) 组来达到执行一组动画的需求 并行组动画并行组的特点是当动画组执行时组内所有动画都同时被调度, 表现的效果是这些动画同时在进行, 组动画的总运行时间由最长的那个动画运行时间决定 串行组动画串行组的特点是动画组执行时组内动画将被顺序调度, 表现的效果是这些动画分先后秩序进行, 组动画的总运行时间为所有动画运行时间的和 另外可以将一个动画组当作一个动画添加到另一个组, 其调度规则同上 函数原型 mgeff 提供了如下几个函数用于支持动画组的创建和使用 其函数原型如下 : 创建动画组函数 MGEFF_ANIMATION mgeffanimationcreategroup(enum EffAnimationType type); 参数说明 : type - 动画组类型, 可以是 MGEFF_PARALLEL ( 并行 ) 和 MGEFF_SEQUENTIAL ( 串行 ) 二值之一 ; 返回值说明 : handle - 成功返回动画组句柄, 否则返回 NULL; 添加到动画组函数 /** * 将一个动画加入动画组

40 MGEffV1dot0PGC10 < Main < TWiki Page 2 of 7 */ void mgeffanimationaddtogroup(mgeff_animation group, MGEFF_ANIMATION an 参数说明 : group - 动画组句柄 ; animation - 将加入 group 中的动画句柄 ; 返回值说明 : void - ; 一点概念 从函数原型可以看到, 动画组的句柄和动画句柄是同样的类型, 前面介绍过 mgeff 的设计上采用了一些面向对象思想, 动画组对象从动画对象 继承 而来 动画组也是一种动画, 之前介绍过的动画属性 上下文和运行方式相关的函数均可作用于动画组, 这一点将在下一节的示例中展示出来 使用示例 并行动画组 #include <stdio.h> #include <string.h> #include <minigui/common.h> #include <minigui/gdi.h> #include <minigui/window.h> #include <minigui/minigui.h> #include <mgeff/mgeff.h> /********************************************************************** #define CAPTION "group_animation_parallel" #define BAR_HEIGHT 50 #define DURATION (5 * 1000) #define START_VAL 0x00 #define END_VAL 0xFF #define ANIMATION_NUM 3 /********************************************************************** static int g_color[animation_num] = 0 ; /********************************************************************** /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA /* draw a frame */ static void draw_frame (HWND hwnd); /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i

41 MGEffV1dot0PGC10 < Main < TWiki Page 3 of 7 /* create and run an animation */ static int do_animation (HWND hwnd); /********************************************************************** int MiniGUIMain (int argc, const char *argv[]) HWND hmainhwnd; MAINWINCREATE createinfo; MSG msg; #ifdef _MGRM_PROCESSES JoinLayer (NAME_DEF_LAYER, "animation", 0, 0); #endif createinfo.dwstyle = WS_VISIBLE WS_BORDER WS_CAPTION; createinfo.dwexstyle = WS_EX_NONE; createinfo.spcaption = CAPTION; createinfo.hmenu = 0; createinfo.hcursor = GetSystemCursor (0); createinfo.hicon = 0; createinfo.mainwindowproc = mainwindowproc; createinfo.lx = 0; createinfo.ty = 0; createinfo.rx = 240; createinfo.by = 320; createinfo.ibkcolor = COLOR_lightwhite; createinfo.dwadddata = 0; createinfo.hhosting = HWND_DESKTOP; hmainhwnd = CreateMainWindow (&createinfo); if (hmainhwnd == HWND_INVALID) return -1; ShowWindow (hmainhwnd, SW_SHOWNORMAL); while (GetMessage (&msg, hmainhwnd)) TranslateMessage (&msg); DispatchMessage (&msg); MainWindowThreadCleanup (hmainhwnd); return 0; /**********************************************************************

42 MGEffV1dot0PGC10 < Main < TWiki Page 4 of 7 static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA switch (message) case MSG_CREATE: /* init mgeff library */ mgeffinit (); do_animation (hwnd); break; case MSG_PAINT: draw_frame (hwnd); break; case MSG_CLOSE: DestroyMainWindow (hwnd); PostQuitMessage (hwnd); /* deinit mgeff library */ mgeffdeinit (); break; default: break; return DefaultMainWinProc (hwnd, message, wparam, lparam); static void draw_frame (HWND hwnd) HDC dc; RECT rc; int client_w, client_h; char str[animation_num][64]; dc = BeginPaint (hwnd); /* get client rect */ GetClientRect (hwnd, &rc); client_w = RECTW (rc); client_h = RECTH (rc);// - BAR_HEIGHT) * g_value / (END_VAL - S /* draw */ /* red */ SetBrushColor (dc, RGB2Pixel (dc, g_color[0], 0, 0));

43 MGEffV1dot0PGC10 < Main < TWiki Page 5 of 7 FillBox (dc, 0, client_h * 0 / ANIMATION_NUM, client_w, client_ sprintf (str[0], "%d", g_color[0]); TextOut (dc, 0, client_h * 0 / ANIMATION_NUM, str[0]); /* green */ SetBrushColor (dc, RGB2Pixel (dc, 0, g_color[1], 0)); FillBox (dc, 0, client_h * 1 / ANIMATION_NUM, client_w, client_ sprintf (str[1], "%d", g_color[1]); TextOut (dc, 0, client_h * 1 / ANIMATION_NUM, str[1]); /* blue */ SetBrushColor (dc, RGB2Pixel (dc, 0, 0, g_color[2])); FillBox (dc, 0, client_h * 2 / ANIMATION_NUM, client_w, client_ sprintf (str[2], "%d", g_color[2]); TextOut (dc, 0, client_h * 2 / ANIMATION_NUM, str[2]); EndPaint (hwnd, dc); static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i g_color[id] = *value; InvalidateRect (hwnd, NULL, TRUE); static int do_animation (HWND hwnd) MGEFF_ANIMATION animation[animation_num]; MGEFF_ANIMATION group_animation; int duration;; int start_val; int end_val; int i; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create an animation group */ group_animation = mgeffanimationcreategroup (MGEFF_PARALLEL); //group_animation = mgeffanimationcreategroup (MGEFF_SEQUENTIAL

44 MGEffV1dot0PGC10 < Main < TWiki Page 6 of 7 /* create and animation and add it to a group */ for (i = 0; i < ANIMATION_NUM; i++) /* create animation */ animation[i] = mgeffanimationcreate ((void *) hwnd, (vo /* set property */ /* duration */ mgeffanimationsetduration (animation[i], duration); /* start value */ mgeffanimationsetstartvalue (animation[i], &start_val); /* end value */ mgeffanimationsetendvalue (animation[i], &end_val); /* add animation to group */ mgeffanimationaddtogroup (group_animation, animation[i] /* running */ mgeffanimationasyncrun (group_animation); /* wait animation end */ mgeffanimationwait ((void *) &hwnd, group_animation); /* delete the animation object */ mgeffanimationdelete (group_animation); return 0; 串行动画组 只要将上个示例中的创建动画组函数调用替换成下面这句, 就可以实现一个串行动画组 : /*... */ group = mgeffanimationcreategroup(mgeff_sequential); /*... */ 本章小结 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd.

45 MGEffV1dot0PGC10 < Main < TWiki Page 7 of 7 Ideas, requests, problems regarding TWiki? Send feedback

46 MGEffV1dot0PGC11 < Main < TWiki Page 1 of 9 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC11 r16-14 Feb :17:22 - XuBinWang 动画回调函数 回调函数函数原型动画结束时的回调函数动画循环次数改变时的回调函数动画运行方向改变时的回调函数动画状态改变时的回调函数使用示例运行结果本章小结 回调函数 在 mgeff 的动画播放或其状态发生改变时, 框架会尝试调用用户设置的回调函数, 以便让用户做出一些相应的处理, 下面介绍一下这些回调函数 : 函数原型 动画结束时的回调函数 如果用户设置了动画结束回调函数, 将在动画播放完后被调用, 一般可以用来在动画结束时释放资源 具体回调函数原型和设置回调的 API 如下 : /* 动画结束时调用的回调原型 */ typedef void (*MGEFF_FINISHED_CB)(MGEFF_ANIMATION handle); 参数说明 : handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; /* 设置动画结束时要调用的回调函数 */ void mgeffanimationsetfinishedcb(mgeff_animation handle, MGEFF_FINISHE 参数说明 : handle - 动画对象句柄 ; cb - 回调函数指针 ; 返回值说明 : void - 无返回值 ; 动画循环次数改变时的回调函数 当动画循环次数发生改变, 而且用户设置了相应的回调函数时,mGEff 会调用这个回调函数 :

47 MGEffV1dot0PGC11 < Main < TWiki Page 2 of 9 /* 动画循环次数发生改变时调用的回调原型 */ typedef void (*MGEFF_CURLOOPCHANGED_CB)(MGEFF_ANIMATION handle); 参数说明 : handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; /* 设置动画循环次数改变时要调用的回调函数 */ void mgeffanimationsetcurloopchangedcb(mgeff_animation handle, MGEFF_C 参数说明 : handle - 动画对象句柄 ; cb - 回调函数指针 ; 返回值说明 : void - 无返回值 ; 动画运行方向改变时的回调函数 当动画的运行方向发生改变, 而且用户设置了相应的回调函数时, 该回调将被 mgeff 调用 : /* 动画运行方向发生改变时调用的回调原型 */ typedef void (*MGEFF_DIRCHANGED_CB)(MGEFF_ANIMATION handle); 参数说明 : handle - 动画对象句柄 ; 返回值说明 : void - 无返回值 ; /* 设置动画运行方向改变时要调用的回调函数 */ void mgeffanimationsetdirchangedcb(mgeff_animation handle, MGEFF_DIRCH 参数说明 : handle - 动画对象句柄 ; cb - 回调函数指针 ; 返回值说明 : void - 无返回值 ; 动画状态改变时的回调函数 当动画的状态发生改变, 而且用户设置了相应的回调函数时, 该回调将被 mgeff 调用 : /* 动画状态发生改变时调用的回调原型 */ typedef void (*MGEFF_STATECHANGED_CB)(MGEFF_ANIMATION handle, enum Eff 参数说明 :

48 MGEffV1dot0PGC11 < Main < TWiki Page 3 of 9 handle - 动画对象句柄 ; neweffstate - 新的状态值 ; oldeffstate - 旧的状态值 ; 返回值说明 : void - 无返回值 ; /* 设置动画状态改变时要调用的回调函数 */ void mgeffanimationsetstatechangedcb(mgeff_animation handle, MGEFF_STA 参数说明 : handle - 动画对象句柄 ; cb - 回调函数指针 ; 返回值说明 : void - 无返回值 ; 使用示例 #include <stdio.h> #include <string.h> #include <minigui/common.h> #include <minigui/gdi.h> #include <minigui/window.h> #include <minigui/minigui.h> #include <mgeff/mgeff.h> /********************************************************************* #define CAPTION "animation_callback" #define BAR_HEIGHT 50 #define DURATION (20 * 1000) #define LOOPCOUNT 3 #define START_VAL 0x00 #define END_VAL 0xFF /********************************************************************* static char g_str[64]; static int g_value = 0x00; static int g_loop = 0; /********************************************************************* /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPAR /* draw a frame */ static void draw_frame (HWND hwnd); /* callback function called when property change */

49 MGEffV1dot0PGC11 < Main < TWiki Page 4 of 9 static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i /* create and run an animation */ static int do_animation (HWND hwnd); /* callback function called when animation finished */ static void finished_callback (MGEFF_ANIMATION handle); /* callback function called when animation loop count is changed */ static void curloopchanged_callback (MGEFF_ANIMATION handle); /* callback function called when animation direction changed */ static void dirchanged_callback (MGEFF_ANIMATION handle); /* callback function called when animation state changed */ static void statechanged_callback (MGEFF_ANIMATION handle, enum EffStat /********************************************************************** int MiniGUIMain (int argc, const char *argv[]) HWND hmainhwnd; MAINWINCREATE createinfo; MSG msg; #ifdef _MGRM_PROCESSES JoinLayer (NAME_DEF_LAYER, "animation", 0, 0); #endif createinfo.dwstyle = WS_VISIBLE WS_BORDER WS_CAPTION; createinfo.dwexstyle = WS_EX_NONE; createinfo.spcaption = CAPTION; createinfo.hmenu = 0; createinfo.hcursor = GetSystemCursor (0); createinfo.hicon = 0; createinfo.mainwindowproc = mainwindowproc; createinfo.lx = 0; createinfo.ty = 0; createinfo.rx = 240; createinfo.by = 320; createinfo.ibkcolor = COLOR_lightwhite; createinfo.dwadddata = 0; createinfo.hhosting = HWND_DESKTOP; hmainhwnd = CreateMainWindow (&createinfo); if (hmainhwnd == HWND_INVALID) return -1; ShowWindow (hmainhwnd, SW_SHOWNORMAL); while (GetMessage (&msg, hmainhwnd))

50 MGEffV1dot0PGC11 < Main < TWiki Page 5 of 9 TranslateMessage (&msg); DispatchMessage (&msg); MainWindowThreadCleanup (hmainhwnd); return 0; /********************************************************************** /* main window proc */ static int mainwindowproc (HWND hwnd, int message, WPARAM wparam, LPARA switch (message) case MSG_CREATE: /* init mgeff library */ mgeffinit (); sprintf (g_str, "you can press any key."); do_animation (hwnd); break; case MSG_KEYDOWN: sprintf (g_str, "you press key, keycode(%d)", wparam); printf ("%s\n", g_str); InvalidateRect (hwnd, NULL, TRUE); break; case MSG_PAINT: draw_frame (hwnd); break; case MSG_CLOSE: DestroyMainWindow (hwnd); PostQuitMessage (hwnd); /* deinit mgeff library */ mgeffdeinit (); break; default: break; return DefaultMainWinProc (hwnd, message, wparam, lparam);

51 MGEffV1dot0PGC11 < Main < TWiki Page 6 of 9 /* draw a frame */ static void draw_frame (HWND hwnd) HDC dc; RECT rc; int client_w, client_h; char str[64]; int color; /* begin draw */ dc = BeginPaint (hwnd); /* get client rect */ GetClientRect (hwnd, &rc); client_w = RECTW (rc); client_h = (RECTH (rc) - BAR_HEIGHT) * g_value / (END_VAL - STA color = g_value; /* set brush and draw area */ SetBrushColor (dc, RGB2Pixel (dc, color, 0x00, 0x00)); FillBox (dc, 0, BAR_HEIGHT, client_w, client_h); /* draw the text */ sprintf (str, "current color: RGB(%d,0,0)", color); TextOut (dc, 0, 0, str); /* print information */ TextOut (dc, 0, BAR_HEIGHT / 3, g_str); /* print curloop */ sprintf (str, "current loop: (%d)", g_loop); TextOut (dc, 0, 2 * BAR_HEIGHT / 3, str); EndPaint (hwnd, dc); /* end draw */ /* callback function called when property change */ static void property_callback (MGEFF_ANIMATION handle, HWND hwnd, int i

52 MGEffV1dot0PGC11 < Main < TWiki Page 7 of 9 /* set animation property */ g_value = *value; /* get current loop */ g_loop = mgeffanimationgetproperty (handle, MGEFF_PROP_CURLOOP) /* update */ InvalidateRect (hwnd, NULL, TRUE); /* create and run an animation */ static int do_animation (HWND hwnd) MGEFF_ANIMATION animation; int animation_id = 1; int duration; int start_val; int end_val; /* set value */ duration = DURATION; start_val = START_VAL; end_val = END_VAL; /* create animation object */ animation = mgeffanimationcreate ((void *) hwnd, (void *) prope /* set animation property */ /* set loopcount */ mgeffanimationsetproperty (animation, MGEFF_PROP_LOOPCOUNT, LOO /* duration */ mgeffanimationsetduration (animation, duration); /* start value */ mgeffanimationsetstartvalue (animation, &start_val); /* end value */ mgeffanimationsetendvalue (animation, &end_val); /* set callback */ mgeffanimationsetfinishedcb (animation, finished_callback); mgeffanimationsetcurloopchangedcb (animation, curloopchanged_ca mgeffanimationsetdirchangedcb (animation, dirchanged_callback); mgeffanimationsetstatechangedcb (animation, statechanged_callba /* running */

53 MGEffV1dot0PGC11 < Main < TWiki Page 8 of 9 mgeffanimationasyncrun (animation); /* wait animation stop */ mgeffanimationwait ((void *) &hwnd, animation); /* delete the animation object */ mgeffanimationdelete (animation); return 0; /* callback function called when animation finished */ static void finished_callback (MGEFF_ANIMATION handle) printf ("finished_callback is called.\n"); /* callback function called when animation loop count is changed */ static void curloopchanged_callback (MGEFF_ANIMATION handle) int cur_loop; printf ("curloopchanged_callback is called.\n"); cur_loop = mgeffanimationgetproperty (handle, MGEFF_PROP_CURLOO printf ("current loop : %d\n", cur_loop); /* callback function called when animation direction changed */ static void dirchanged_callback (MGEFF_ANIMATION handle) int direction; printf ("dirchanged_callback is called.\n"); direction = mgeffanimationgetproperty (handle, MGEFF_PROP_DIREC printf ("current direction : %d\n", direction); /* callback function called when animation state changed */ static void statechanged_callback (MGEFF_ANIMATION handle, enum EffStat int state; printf ("statechanged_callback is called.\n");

54 MGEffV1dot0PGC11 < Main < TWiki Page 9 of 9 state = mgeffanimationgetproperty (handle, MGEFF_PROP_STATE); printf ("current state : %d\n", state); printf ("new state : %d\n", neweffstate); printf ("old state : %d\n", oldeffstate); 运行结果 statechanged_callback is called. current state : 0 new state : 3 old state : 0 statechanged_callback is called. current state : 3 new state : 2 old state : 3 curloopchanged_callback is called. current loop : 1 curloopchanged_callback is called. current loop : 2 curloopchanged_callback is called. current loop : 3 statechanged_callback is called. current state : 2 new state : 0 old state : 2 finished_callback is called. 本章小结 本章介绍了 mgeff 框架中的一些回调函数, 通过设置这些回调函数, 可以在动画的各个阶段以及状态发生改变时被框架所调用, 这就可以让用户在动画的不同阶段做出不同的处理 -- XuBinWang - 12 Jan 2011 Copyright by Beijing FMSoft Technologies Co., Ltd. Ideas, requests, problems regarding TWiki? Send feedback

55 MGEffV1dot0PGC12 < Main < TWiki Page 1 of 9 TWiki > Main Web > MiniGUI > MGEffV1dot0ProgrammingGuide > MGEffV1dot0PGC12 r5-14 Feb :25:00 - XuBinWang 特效器 特效器函数原型创建特效器函数删除特效器函数通过指定 DC 创建一个特效素材源函数往指定特效器里追加一个特效素材源函数创建特效器输出目标函数设置特效器的输出目标从特效器中创建动画内置的特效器内置特效器分类特效器的属性使用示例本章小结 特效器 由于 mgeff 提供的只是动画框架, 具体的动画交给用户去实现 而有些动画特效比较通用, 如果每次都要让用户实现, 即不利于代码复用又无法保证其实现是最优的 所以 mgeff 中引入了 Effector 的概念 简单的讲,Effector 将常用的动画特效 ( 如卷页 ) 实现并封装起来, 以便用户直接使用 特效器的本质是封装特定的动画特效, 而在使用方式上它有一个约定 : 用户创建特效器后传入至少两个素材源 ( 少数特效器需要两个以上素材源 ), 并设置输出目标, 这样在特效器开始运行后会将第一个素材源在指定时间内变化为第二个素材源, 并将这个过程显示在输出目标上 在当前版本的 mgeff 中素材源支持从 MiniGUI 的 DC 上创建, 而输出目标则是 MiniGUI 窗口 ( 或控件 ) 函数原型 mgeff 提供了如下函数操作特效器的创建和运行 其原型如下 : 创建特效器函数 MGEFF_EFFECTOR mgeffeffectorcreate(unsigned long key); 参数说明 : key - 特效器名称的 hash 值, 通过该值作为索引可以对应一个唯一的特效器 返回值说明 : MGEFF_EFFECTOR - 创建成功返回特效器句柄, 失败返回 NULL 删除特效器函数

PowerPoint 演示文稿

PowerPoint 演示文稿 嵌入式系统 嵌入式 GUI 浙江大学计算机学院陈文智 chenwz@zju.edu.cn 提纲 嵌入式 GUI 概述 MiniGUI 概述 MiniGUI 架构 MiniGUI 使用 MiniGUI 编程 1 嵌入式 GUI 概述 GUI 的出现是 PC 应用的一个分水岭 嵌入式平台上的 GUI 具备轻小型 占用资源少 高性能 高可靠性和可配置性等嵌入式平台所特有的优点 一般针对特定的硬件设备或环境,

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

<4D F736F F D20BBF9D3DA F344C696E7578B5C C9E3CFF1CDB7CDBCCFF1B2C9BCAFCAB5CFD62E646F63>

<4D F736F F D20BBF9D3DA F344C696E7578B5C C9E3CFF1CDB7CDBCCFF1B2C9BCAFCAB5CFD62E646F63> 基于 Video4Linux 的 USB 摄像头图像采集实现 Write by daily3( 戴小鼠 ) 著作权 : 戴丽 ( 合肥工业大学 ) (email:daily3@126.com) 做了一段时间的摄像头图像采集, 有了一些心得 在论坛上开的 2410 摄像头问题专贴 (http://www.hhcn.com/cgi-bin/topic.cgi?forum=1&topic=247&show=0)

More information

版权所有 (C) 2008~2010, 北京飞漫软件技术有限公司, 保留所有权利 无论您以何种方式获得该指南的全部或部分文字或图片资料, 无论是普通印刷品还是电子文档, 北京飞漫软件技术有限公司仅仅授权您阅读的权利, 任何形式的格式转换 再次发布 传播以及复制其内容的全部或部分, 或将其中的文字和图

版权所有 (C) 2008~2010, 北京飞漫软件技术有限公司, 保留所有权利 无论您以何种方式获得该指南的全部或部分文字或图片资料, 无论是普通印刷品还是电子文档, 北京飞漫软件技术有限公司仅仅授权您阅读的权利, 任何形式的格式转换 再次发布 传播以及复制其内容的全部或部分, 或将其中的文字和图 ministudio 用户手册 版本 1.0 修订号 0 适用于 ministudio Ver 1.0.x 北京飞漫软件技术有限公司 2010 年 5 月 版权所有 (C) 2008~2010, 北京飞漫软件技术有限公司, 保留所有权利 无论您以何种方式获得该指南的全部或部分文字或图片资料, 无论是普通印刷品还是电子文档, 北京飞漫软件技术有限公司仅仅授权您阅读的权利, 任何形式的格式转换 再次发布

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

More information

Guava学习之Resources

Guava学习之Resources Resources 提供提供操作 classpath 路径下所有资源的方法 除非另有说明, 否则类中所有方法的参数都不能为 null 虽然有些方法的参数是 URL 类型的, 但是这些方法实现通常不是以 HTTP 完成的 ; 同时这些资源也非 classpath 路径下的 下面两个函数都是根据资源的名称得到其绝对路径, 从函数里面可以看出,Resources 类中的 getresource 函数都是基于

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

More information

SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基

SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 odps-sdk 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基 开放数据处理服务 ODPS SDK SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基础功能的主体接口, 搜索关键词 "odpssdk-core" 一些

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

帝国CMS下在PHP文件中调用数据库类执行SQL语句实例

帝国CMS下在PHP文件中调用数据库类执行SQL语句实例 帝国 CMS 下在 PHP 文件中调用数据库类执行 SQL 语句实例 这篇文章主要介绍了帝国 CMS 下在 PHP 文件中调用数据库类执行 SQL 语句实例, 本文还详细介绍了帝国 CMS 数据库类中的一些常用方法, 需要的朋友可以参考下 例 1: 连接 MYSQL 数据库例子 (a.php)

More information

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

无类继承.key

无类继承.key 无类继承 JavaScript 面向对象的根基 周爱 民 / aimingoo aiming@gmail.com https://aimingoo.github.io https://github.com/aimingoo rand = new Person("Rand McKinnon",... https://docs.oracle.com/cd/e19957-01/816-6408-10/object.htm#1193255

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

提纲 1 2 OS Examples for 3

提纲 1 2 OS Examples for 3 第 4 章 Threads2( 线程 2) 中国科学技术大学计算机学院 October 28, 2009 提纲 1 2 OS Examples for 3 Outline 1 2 OS Examples for 3 Windows XP Threads I An Windows XP application runs as a seperate process, and each process may

More information

chap07.key

chap07.key #include void two(); void three(); int main() printf("i'm in main.\n"); two(); return 0; void two() printf("i'm in two.\n"); three(); void three() printf("i'm in three.\n"); void, int 标识符逗号分隔,

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

NOWOER.OM m/n m/=n m/n m%=n m%n m%=n m%n m/=n 4. enum string x1, x2, x3=10, x4, x5, x; 函数外部问 x 等于什么? 随机值 5. unsigned char *p1; unsigned long *p

NOWOER.OM m/n m/=n m/n m%=n m%n m%=n m%n m/=n 4. enum string x1, x2, x3=10, x4, x5, x; 函数外部问 x 等于什么? 随机值 5. unsigned char *p1; unsigned long *p NOWOER.OM /++ 程师能 评估. 单项选择题 1. 下 描述正确的是 int *p1 = new int[10]; int *p2 = new int[10](); p1 和 p2 申请的空间 的值都是随机值 p1 和 p2 申请的空间 的值都已经初始化 p1 申请的空间 的值是随机值,p2 申请的空间 的值已经初始化 p1 申请的空间 的值已经初始化,p2 申请的空间 的值是随机值 2.

More information

绘制OpenCascade中的曲线

绘制OpenCascade中的曲线 在 OpenSceneGraph 中绘制 OpenCascade 的曲线 Draw OpenCascade Geometry Curves in OpenSceneGraph eryar@163.com 摘要 Abstract: 本文简要说明 OpenCascade 中几何曲线的数据, 并将这些几何曲线在 OpenSceneGraph 中绘制出来 关键字 KeyWords:OpenCascade Geometry

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

ebook50-11

ebook50-11 11 Wi n d o w s C A D 53 M F C 54 55 56 57 58 M F C 11.1 53 11-1 11-1 MFC M F C C D C Wi n d o w s Wi n d o w s 4 11 199 1. 1) W M _ PA I N T p W n d C W n d C D C * p D C = p W n d GetDC( ); 2) p W n

More information

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf (%d, & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9 201 201 21 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 1 B 1 C 5 D RPG 10 E 10 F 1 G II 1 1 201 201 C 1 # include 2 int main ( void

More information

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023) ( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.

More information

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf (%d, & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf (%d %d 2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

基于ECO的UML模型驱动的数据库应用开发1.doc

基于ECO的UML模型驱动的数据库应用开发1.doc ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

More information

Table of Contents

Table of Contents 中國人史綱 提要 柏楊的 中國人史綱 是他十年牢獄生活的血淚之作 在極端惡劣的 環境下 從卷帙浩繁的中國史冊中寫成 史綱 除了大脈絡 更重要的 是大關節的操持 這要有史識 柏楊顯然有他紮實的史料工夫 整體的掌 握應不成問題 他以一百年為 一世紀 作為敘述單元 先把中國史分成 非信史與信史 前者從神話 傳說到半信史時代 後者從紀元前九世紀開 始說起 一章一世紀以迄於晚清 這個大脈絡很清楚 而既稱 史之綱要

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

C/C++ - 数组与指针

C/C++ - 数组与指针 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 float candy [ 365]; char code [12]; int states [50]; 2 int array [6] = {1, 2, 4, 6, 8, 10}; 3 // day_mon1.c: # include # define MONTHS 12 int

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information

Microsoft PowerPoint - ds-1.ppt [兼容模式]

Microsoft PowerPoint - ds-1.ppt [兼容模式] http://jwc..edu.cn/jxgl/ HomePage/Default.asp 2 说 明 总 学 时 : 72( 学 时 )= 56( 课 时 )+ 16( 实 验 ) 行 课 时 间 : 第 1 ~14 周 周 学 时 : 平 均 每 周 4 学 时 上 机 安 排 待 定 考 试 时 间 : 课 程 束 第 8 11 12 章 的 内 容 为 自 学 内 容 ; 目 录 中 标 有

More information

untitled

untitled () BEIJING CENTERGATE TECHNOLOGIES (HOLDING) CO., LTD. 2005 0 0 ... 02... 02 ~03... 04~05... 06~08... 09~12... 13~14... 15... 16~25... 26~27... 28~36..... 37~82... 83 1 2 3 4 0.4 0.2 0-0.2-0.4-0.6-0.8-1

More information

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f 27 1 Vol.27 No.1 CEMENTED CARBIDE 2010 2 Feb.2010!"!!!!"!!!!"!" doi:10.3969/j.issn.1003-7292.2010.01.011 OPC 1 1 2 1 (1., 412008; 2., 518052), OPC, WinCC VB,,, OPC ; ;VB ;WinCC Application of OPC Technology

More information

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3 浙江大学 C 程序设计及实验 试题卷 2002-2003 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:30-10:30 注意 : 答题内容必须写在答题卷上, 写在本试题卷上无效 一. 单项选择题 ( 每题 1 分, 共 10 分 ) 1. 下列运算符中, 优先级最低的是 A.

More information

概述

概述 OPC Version 1.8 build 0925 KOCRDK Knight OPC Client Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOC_Init...5 2.2.2 KOC_Uninit...5 2.3...5

More information

epub 33-8

epub 33-8 8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE

More information

SQL Server SQL Server SQL Mail Windows NT

SQL Server SQL Server SQL Mail Windows NT ... 3 11 SQL Server... 4 11.1... 7 11.2... 9 11.3... 11 11.4... 30 11.5 SQL Server... 30 11.6... 31 11.7... 32 12 SQL Mail... 33 12.1Windows NT... 33 12.2SQL Mail... 34 12.3SQL Mail... 34 12.4 Microsoft

More information

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620

More information

C/C++语言 - 分支结构

C/C++语言 - 分支结构 C/C++ Table of contents 1. if 2. if else 3. 4. 5. 6. continue break 7. switch 1 if if i // colddays.c: # include int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days

More information

coverage2.ppt

coverage2.ppt Satellite Tool Kit STK/Coverage STK 82 0715 010-68745117 1 Coverage Definition Figure of Merit 2 STK Basic Grid Assets Interval Description 3 Grid Global Latitude Bounds Longitude Lines Custom Regions

More information

华恒家庭网关方案

华恒家庭网关方案 LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU

More information

引言

引言 BELL 18% 15% 50% 20% BELL 10% 2. 2.1. < 1> 4 TAB < 2> > (1) printf("%d %d %d", a, b, c); (2), "=" "+=" "+" "%" "&&" "&" "

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

ebook 86-15

ebook 86-15 15 G t k + d e l e t e _ e v e n t G n o m e G n o m e 15.1 GnomeDialog G t k + G n o m e D i a l o g 15.1.1 G n o m e D i a l o g g n o m e _ d i a l o g _ n e w ( ) G N O M E _ D I A L O G ( d i a l

More information

nooog

nooog C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1

More information

Microsoft PowerPoint - 4. 数组和字符串Arrays and Strings.ppt [兼容模式]

Microsoft PowerPoint - 4. 数组和字符串Arrays and Strings.ppt [兼容模式] Arrays and Strings 存储同类型的多个元素 Store multi elements of the same type 数组 (array) 存储固定数目的同类型元素 如整型数组存储的是一组整数, 字符数组存储的是一组字符 数组的大小称为数组的尺度 (dimension). 定义格式 : type arrayname[dimension]; 如声明 4 个元素的整型数组 :intarr[4];

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

工程合同管理 一 民事法律关系概述 1-1 主体 拥有权利承担义务的当事人 法律关系三要素 客体 当事人权利义务所指的对象 内容 具体的权利和义务的内容 图 1-1 法律关系的构成要素

工程合同管理 一 民事法律关系概述 1-1 主体 拥有权利承担义务的当事人 法律关系三要素 客体 当事人权利义务所指的对象 内容 具体的权利和义务的内容 图 1-1 法律关系的构成要素 学习目标 1. 2. 3. 4. 5. 导言 第一节民事法律关系 工程合同管理 一 民事法律关系概述 1-1 主体 拥有权利承担义务的当事人 法律关系三要素 客体 当事人权利义务所指的对象 内容 具体的权利和义务的内容 图 1-1 法律关系的构成要素 1. 2. 2 3. 1 2 3 4 3 工程合同管理 1-1 A. B. C. D. C C C A B D 二 民事法律行为的构成要件 1. 1-1

More information

_汪_文前新ok[3.1].doc

_汪_文前新ok[3.1].doc 普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d

More information

The golden pins of the PCI card can be oxidized after months or years

The golden pins of the PCI card can be oxidized after months or years Q. 如何在 LabWindows/CVI 編譯 DAQ Card 程式? A: 請參考至下列步驟 : 步驟 1: 安裝驅動程式 1. 安裝 UniDAQ 驅動程式 UniDAQ 驅動程式下載位置 : CD:\NAPDOS\PCI\UniDAQ\DLL\Driver\ ftp://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/unidaq/dll/driver/

More information

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E Gerotor Motors Series Size CC-A Flange Options-B Shaft Options-C Ports Features 0 0 5 5 1 0 1 0 3 3 0 0 SAE A 2 Bolt - (2) 4 Bolt Magneto (4) 4 Bolt Square (H4) 1.0" Keyed (C) 25mm Keyed (A) 1.0' 6T Spline

More information

untitled

untitled 1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete

More information

DVK530/531扩展板

DVK530/531扩展板 DVK720 扩展板 驱动移植手册 2014.04.03 V1.0 版权声明 本手册所有权由深圳市微雪电子有限公司独家持有 未经本公司的书 面许可, 不得以任何方式或形式进行修改 分发或复制本文档的任何 部分, 否则一切后果由违者自负 版本更新记录 版本日期说明 V1.0 2014.04.03 初始发布 深圳市微雪电子有限公司 www.waveshare.net I 目录 版权声明... I 版本更新记录...

More information

F B ,622,

F B ,622, WUHAN ZHONGBAI GROUP CO., LTD. whzbyxh@whzb.com whzbpb@whzb.com 027-82777083 027-82210291 129 129 430021 24-25F http://www.whzb.com whzb@whzb.com http://www.cninfo.com.cn 000759 1989 11 8 2004 7 14 4201001101263

More information

Microsoft PowerPoint - os_4.ppt

Microsoft PowerPoint - os_4.ppt 行 程 資 科 系 林 偉 川 行 程 概 念 行 程 與 程 式 主 要 的 不 同 點 : 程 式 是 被 放 在 外 部 的 儲 存 裝 置 如 磁 碟 上, 而 行 程 則 被 放 在 記 憶 體 中 程 式 在 儲 存 裝 置 中 是 靜 態 的, 而 行 程 在 記 憶 體 中 是 動 態 的, 它 會 隨 著 一 些 事 件 的 發 生 而 產 生 相 對 的 改 變 行 程, 就 是

More information

Simulator By SunLingxi 2003

Simulator By SunLingxi 2003 Simulator By SunLingxi sunlingxi@sina.com 2003 windows 2000 Tornado ping ping 1. Tornado Full Simulator...3 2....3 3. ping...6 4. Tornado Simulator BSP...6 5. VxWorks simpc...7 6. simulator...7 7. simulator

More information

ebook140-8

ebook140-8 8 Microsoft VPN Windows NT 4 V P N Windows 98 Client 7 Vintage Air V P N 7 Wi n d o w s NT V P N 7 VPN ( ) 7 Novell NetWare VPN 8.1 PPTP NT4 VPN Q 154091 M i c r o s o f t Windows NT RAS [ ] Windows NT4

More information

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / /

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / / 4 AMI AMI AMI SC345604 89 4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / / 91 41-90 41 AMI - AMI - - API MQI MQSeries MQI AMI IBM 91 MQSeries REPOSITORY AMI AMI AMI XML Windows AMI

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

Microsoft Word - 11.doc

Microsoft Word - 11.doc 除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何

More information

《C语言程序设计》教材习题参考答案

《C语言程序设计》教材习题参考答案 教材名称 : C 语言程序设计 ( 第 1 版 ) 黄保和 江弋编著清华大学出版社 ISBN:978-7-302-13599-9, 红色封面 答案制作时间 :2011 年 2 月 -5 月 一 选择题 1. 设已定义 int a, * p, 下列赋值表达式中正确的是 :C)p=&a 2. 设已定义 int x,*p=&x;, 则下列表达式中错误的是 :B)&*x 3. 若已定义 int a=1,*b=&a;,

More information

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un Linux C July 27, 2016 Contents 1 Linux IDE 1 2 GCC 3 2.1 hello.c hello.exe........................... 5 2.2............................... 9 2.2.1 -Wall................................ 9 2.2.2 -E..................................

More information

Microsoft PowerPoint - L17_Inheritance_v4.pptx

Microsoft PowerPoint - L17_Inheritance_v4.pptx C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance

More information

JLX

JLX PRODUCT:LCD MODULE. Model No.: JLX177-006 Product Type: 1.77 inch QVGA TFT Modoule. 产品规格书 晶联讯研发研发部 : Written By Checked By Approved By 客户名称 : 结构电子核准 地址 : 深圳市宝安区西乡宝安大道东华工业区 A3 栋 6 楼电话 :0755-29784961 Http://www.jlxlcd.cn

More information

Microsoft Word - Learn Objective-C.doc

Microsoft Word - Learn Objective-C.doc Learn Objective C http://cocoadevcentral.com/d/learn_objectivec/ Objective C Objective C Mac C Objective CC C Scott Stevenson [object method]; [object methodwithinput:input]; output = [object methodwithoutput];

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

More information

Kubenetes 系列列公开课 2 每周四晚 8 点档 1. Kubernetes 初探 2. 上 手 Kubernetes 3. Kubernetes 的资源调度 4. Kubernetes 的运 行行时 5. Kubernetes 的 网络管理理 6. Kubernetes 的存储管理理 7.

Kubenetes 系列列公开课 2 每周四晚 8 点档 1. Kubernetes 初探 2. 上 手 Kubernetes 3. Kubernetes 的资源调度 4. Kubernetes 的运 行行时 5. Kubernetes 的 网络管理理 6. Kubernetes 的存储管理理 7. Kubernetes 包管理理 工具 Helm 蔺礼强 Kubenetes 系列列公开课 2 每周四晚 8 点档 1. Kubernetes 初探 2. 上 手 Kubernetes 3. Kubernetes 的资源调度 4. Kubernetes 的运 行行时 5. Kubernetes 的 网络管理理 6. Kubernetes 的存储管理理 7. Kubernetes

More information

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E Gerolor Motors Series Size CC-A Flange Options-B Shaft Options-C Ports Features 0 0 12 12 1 1 0 0 2 2 31 31 0 0 SAE A 2 Bolt - (2) 4 Bolt Magneto (4) 4 Bolt Square (H4) 1.0" Keyed (C) 2mm Keyed (A) 1.0'

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc 2 5 8 11 0 1. 13 2. 15 3. 18 1 1. 22 2. 25 3. 27 2 1. 35 2. 38 3. 41 4. 43 5. 48 6. 50 3 1. 56 2. 59 3. 63 4. 65 5. 69 13 22 35 56 6. 74 7. 82 8. 84 9. 87 10. 97 11. 102 12. 107 13. 111 4 114 1. 114 2.

More information

WWW PHP

WWW PHP WWW PHP 2003 1 2 function function_name (parameter 1, parameter 2, parameter n ) statement list function_name sin, Sin, SIN parameter 1, parameter 2, parameter n 0 1 1 PHP HTML 3 function strcat ($left,

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

第7章-并行计算.ppt

第7章-并行计算.ppt EFEP90 10CDMP3 CD t 0 t 0 To pull a bigger wagon, it is easier to add more oxen than to grow a gigantic ox 10t 0 t 0 n p Ts Tp if E(n, p) < 1 p, then T (n) < T (n, p) s p S(n,p) = p : f(x)=sin(cos(x))

More information