字画卷动类的实现代码
来源:互联网 发布:沈航网络认证客户端 编辑:程序博客网 时间:2024/04/28 04:10
// public API // create the window; remove WS_VSCROLL to avoid showing scrollbar, remove WS_TABSTOP to disable keyboard scrolling. BOOL Create(const RECT& rect, CWnd* pParentWnd, UINT uStyle = WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|WS_GROUP, UINT nID = 0); // activate/deactivate wrapping mode: void SetWrapping(BOOL bWrap); // Sets the color used for the background (if no pattern is set) or margins (if pattern is set and not tiled) void SetBgColor(COLORREF clrBg); // Sets the color used for text void SetFgColor(COLORREF clrBg); // Sets the font; size is in points, see LOGFONT documentation for weight constants void SetFont(const CString& strName, int nSize, int nWeight); // Sets the text to be displayed void SetText(const CString& strText); // Sets the bitmap to be displayed above the text CBitmap* SetLogo(CBitmap* pbmpLogo); // Sets the background pattern CBitmap* SetPattern(CBitmap* pbmpPattern, BOOL bTile); // Sets the time between frames (autoscrolling speed) (will revert to default if less than 0) (milliseconds) void SetScrollDelay(int nScrollDelay); // Sets the delay when autoscrolling pauses (will disable pausing if set less than scroll delay) (milliseconds) void SetScrollPause(int nScrollPause);
1.引入工程 CScrollerCtrl 类
2.
CScrollerCtrl m_scroller;
3.在OnInitDialog中
m_scroller.SetPattern(CBitmap::FromHandle((HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE_BITMAP, 0,0, LR_SHARED)), FALSE); //设置的是背景图案 m_scroller.SetBgColor(RGB(255,255,255)); //设置背景颜色 m_scroller.SetFgColor(RGB(0,127,0)); // 设置前景色 m_scroller.SetLogo(CBitmap::FromHandle((HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP3), IMAGE_BITMAP, 0,0, LR_SHARED)));// 画册logo // text CString strIntro; strIntro.LoadString(IDS_TEST); m_scroller.SetText(strIntro); //设置内容 CRect rect; GetClientRect(&rect); m_scroller.Create(rect, this); SetScrollDelay(1000);//设置卷动速度
demo下载 地址:下载地址
- 字画卷动类的实现代码
- 4.使用模运算来实现世界的卷动
- 几幅精美的字画
- unity制作卷动的波浪
- 笨木头的跑跑笔记四 实现地图的随精灵卷动功能
- cocos2d-x-3.0学习笔记之如何实现地图的卷动
- Android:将数字画在图片上合成一张图的两种实现方法(一)
- Android:将数字画在图片上合成一张图的两种实现方法(二)
- [Unity实战]制作卷动的波浪
- 那些办公室和家里不能挂的字画
- VC里平滑地卷动字幕的SetTimer时间设置
- 卷动列
- 『收藏天地』[字画]"百鱼图"------陆续历经1年时间,刚刚完成的.
- android 字画背景 shape
- 京都字画网
- 建立一个可调节的连续卷动的电影胶片(一)
- 建立一个可调节的连续卷动的电影胶片(二)
- 让每次弹出的div随页面的卷动而保持相对位置不变
- C语言中可变参数宏
- 进程和线程有什么区别?什么是多线程?
- java获取当前类的绝对路径
- oj32 An problem about date
- 程序员成熟的标志
- 字画卷动类的实现代码
- C#中(int)、int.Parse()、int.TryParse、Convert 区别
- Java 运行时监控,第 3 部分: 监控应用程序生态系统的性能与可用性
- 递归求解集合的所有子集
- 设计模式笔记之Factory Pattern
- 防止蜘蛛攻击机器人
- 右键菜单清理
- VC解除注册表、IE主页的锁定
- HTML5 Canvas 基于OO的动画实例