soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SImageWnd Class Reference

图片控件类 More...

#include <SCmnCtrl.h>

Public Member Functions

 SImageWnd ()
 构造函数
 
virtual ~SImageWnd ()
 析构函数
 
BOOL SetSkin (ISkinObj *pSkin, int iFrame=0, BOOL bAutoFree=TRUE) OVERRIDE
 设置skin
 
ISkinObjGetSkin () OVERRIDE
 获取资源
 
void SetImage (IBitmapS *pBitmap, FilterLevel fl=kNone_FilterLevel) OVERRIDE
 设置绘制图片
 
IBitmapSGetImage () OVERRIDE
 获取当前设置的IBitmapS对象
 
BOOL SetIcon (int nSubID) OVERRIDE
 设置图标
 

Protected Member Functions

virtual void OnColorize (COLORREF cr)
 处理颜色化事件
 
virtual void OnScaleChanged (int scale)
 处理缩放变化事件
 
virtual SIZE MeasureContent (int nParentWid, int nParentHei)
 测量内容大小
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 
void OnPaint (IRenderTarget *pRT)
 绘制控件
 

Protected Attributes

int m_iTile
 绘制是否平铺, 0–位伸(默认),1–不变常规绘制, 2–平铺
 
BOOL m_bManaged
 是否要自动释放当前的m_pSkin对象
 
int m_iIcon
 绘制状态索引
 
SAutoRefPtr< ISkinObjm_pSkin
 ISkinObj对象
 
SAutoRefPtr< IBitmapSm_pImg
 使用代码设定的图片
 
FilterLevel m_fl
 绘制图片的放大精度
 
bool m_bKeepAspect
 保持纵横比
 

Detailed Description

图片控件类

用于显示图片。 @usage <img skin="skin" sub="0"/>

Definition at line 391 of file SCmnCtrl.h.

Constructor & Destructor Documentation

◆ SImageWnd()

SImageWnd::SImageWnd ( )

构造函数

Definition at line 571 of file SCmnCtrl.cpp.

◆ ~SImageWnd()

SImageWnd::~SImageWnd ( )
virtual

析构函数

Definition at line 582 of file SCmnCtrl.cpp.

Member Function Documentation

◆ GetImage()

IBitmapS * SImageWnd::GetImage ( )

获取当前设置的IBitmapS对象

Returns
当前设置的IBitmapS对象

Definition at line 680 of file SCmnCtrl.cpp.

◆ GetSkin()

ISkinObj * SImageWnd::GetSkin ( )

获取资源

Returns
ISkinObj指针

Definition at line 722 of file SCmnCtrl.cpp.

◆ MeasureContent()

SIZE SImageWnd::MeasureContent ( int nParentWid,
int nParentHei )
protectedvirtual

测量内容大小

Parameters
nParentWid父容器宽度
nParentHei父容器高度
Returns
内容大小

Reimplemented from SWindow.

Definition at line 696 of file SCmnCtrl.cpp.

◆ OnColorize()

void SImageWnd::OnColorize ( COLORREF cr)
protectedvirtual

处理颜色化事件

Parameters
cr颜色

Reimplemented from SWindow.

Definition at line 709 of file SCmnCtrl.cpp.

◆ OnPaint()

void SImageWnd::OnPaint ( IRenderTarget * pRT)
protected

绘制控件

Parameters
pRT绘制设备句柄

Definition at line 591 of file SCmnCtrl.cpp.

◆ OnScaleChanged()

void SImageWnd::OnScaleChanged ( int scale)
protectedvirtual

处理缩放变化事件

Parameters
scale缩放比例

Reimplemented from SWindow.

Definition at line 716 of file SCmnCtrl.cpp.

◆ SetAttribute()

virtual HRESULT SImageWnd::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlineprotectedvirtual

Reimplemented from SWindow.

Definition at line 498 of file SCmnCtrl.h.

◆ SetIcon()

BOOL SImageWnd::SetIcon ( int nSubID)

设置图标

Parameters
nSubID子图在Skin中的索引号
Returns
成功–TRUE 失败–FALSE

Definition at line 685 of file SCmnCtrl.cpp.

◆ SetImage()

void SImageWnd::SetImage ( IBitmapS * pBitmap,
FilterLevel fl = kNone_FilterLevel )

设置绘制图片

Parameters
pBitmap图片对象
flFilterLevel

Definition at line 673 of file SCmnCtrl.cpp.

◆ SetSkin()

BOOL SImageWnd::SetSkin ( ISkinObj * pSkin,
int iFrame = 0,
BOOL bAutoFree = TRUE )

设置skin

Parameters
pSkinskin对象
iFrameskin的子图索引
bAutoFree控件管理pSkin标志,为TRUE时调用方可以释放该Skin
Returns
成功–TRUE 失败–FALSE

Definition at line 636 of file SCmnCtrl.cpp.

Member Data Documentation

◆ m_bKeepAspect

bool SImageWnd::m_bKeepAspect
protected

保持纵横比

Definition at line 496 of file SCmnCtrl.h.

◆ m_bManaged

BOOL SImageWnd::m_bManaged
protected

是否要自动释放当前的m_pSkin对象

Definition at line 471 of file SCmnCtrl.h.

◆ m_fl

FilterLevel SImageWnd::m_fl
protected

绘制图片的放大精度

Definition at line 491 of file SCmnCtrl.h.

◆ m_iIcon

int SImageWnd::m_iIcon
protected

绘制状态索引

Definition at line 476 of file SCmnCtrl.h.

◆ m_iTile

int SImageWnd::m_iTile
protected

绘制是否平铺, 0–位伸(默认),1–不变常规绘制, 2–平铺

Definition at line 466 of file SCmnCtrl.h.

◆ m_pImg

SAutoRefPtr<IBitmapS> SImageWnd::m_pImg
protected

使用代码设定的图片

Definition at line 486 of file SCmnCtrl.h.

◆ m_pSkin

SAutoRefPtr<ISkinObj> SImageWnd::m_pSkin
protected

ISkinObj对象

Definition at line 481 of file SCmnCtrl.h.


The documentation for this class was generated from the following files: