ShapeGif - 形状对象GIF动画

说明

ShapeGif -形状对象GIF动画

示例代码

//包含炫彩界面库文件
#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CMyWindowGif
{
public:
HWINDOW m_hWindow;
HELE m_hButton;
HXCGUI m_hGif1;
HXCGUI m_hGif2;
CMyWindowGif(){
Init();
}
void Init()
{
m_hWindow = XWnd_Create(0, 0, 350, 200, L"炫彩界面库窗口",NULL, window_style_default);
m_hGif1=XShapeGif_Create(20,50,100,100,m_hWindow);
XShapeGif_SetImage(m_hGif1,XImage_LoadFile(L"image\\gif.gif"));
m_hGif2=XShapeGif_Create(150,50,100,100,m_hWindow);
XShapeGif_SetImage(m_hGif2,XImage_LoadFile(L"image\\gif.gif"));
m_hButton = XBtn_Create(260, 50, 60, 20,L"销毁", m_hWindow);
XEle_RegEventCPP(m_hButton,XE_BNCLICK,&CMyWindowGif::OnBtnClick);
XWnd_ShowWindow(m_hWindow,SW_SHOW);
}
int OnBtnClick(BOOL *pbHandled)
{
if(m_hGif1){ XShape_Destroy(m_hGif1); m_hGif1=NULL; }
if(m_hGif2){ XShape_Destroy(m_hGif2); m_hGif2=NULL; }
XWnd_Redraw(m_hWindow);
return 0;
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
XInitXCGUI(TRUE);
CMyWindowGif MyWindow;
return 0;
}
#define XE_BNCLICK
按钮点击事件.
Definition: XCGUI.h:939
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
HELE WINAPI XBtn_Create(int x, int y, int cx, int cy, const wchar_t *pName, HXCGUI hParent)
按钮_创建 创建按钮元素
Definition: ButtonUI.cpp:1765
HIMAGE WINAPI XImage_LoadFile(const wchar_t *pFileName)
图片_加载从文件 加载图片从文件.
Definition: ImageFrame.cpp:1014
void WINAPI XShape_Destroy(HXCGUI hShape)
形状_销毁 销毁形状对象.
Definition: Shape.cpp:794
void WINAPI XC_ShowLayoutFrame(BOOL bShow)
炫彩_显示布局边界 显示布局对象边界.
Definition: Api.cpp:585
void WINAPI XExitXCGUI()
炫彩_退出 退出界面库释放资源. 不可在dllmain()中卸载, 否则会死锁
Definition: App.cpp:572
void WINAPI XRunXCGUI()
炫彩_运行 运行消息循环,当炫彩窗口数量为0时退出.
Definition: App.cpp:564
BOOL WINAPI XInitXCGUI(BOOL bD2D)
炫彩_初始化 初始化界面库.
Definition: App.cpp:557
void * HXCGUI
资源句柄
Definition: XCGUI.h:92
XEle_RegEventCPP(hEle, nEvent, memberFunction)
元素_注册事件CPP 注册元素事件,将类成员函数作为事件响应函数.函数省略元素自身句柄hEle.
void WINAPI XShapeGif_SetImage(HXCGUI hShape, HIMAGE hImage)
形状GIF_置图片 设置GIF图片.
Definition: Shape.cpp:1825
HXCGUI WINAPI XShapeGif_Create(int x, int y, int cx, int cy, HXCGUI hParent)
形状GIF_创建 创建形状对象GIF.
Definition: Shape.cpp:1813
HWINDOW WINAPI XWnd_Create(int x, int y, int cx, int cy, const wchar_t *pTitle, HWND hWndParent, int XCStyle)
窗口_创建 创建窗口
Definition: WindowUI.cpp:5964
BOOL WINAPI XWnd_ShowWindow(HWINDOW hWindow, int nCmdShow)
@窗口_显示扩展 显示隐藏及控制窗口最大化还原等
Definition: WindowUI.cpp:6387
void WINAPI XWnd_Redraw(HWINDOW hWindow, BOOL bUpdate)
窗口_重绘 重绘窗口.
Definition: WindowUI.cpp:6075

程序截图