Documentation
¶
Overview ¶
Package imagex 图片操作.
Index ¶
- type Image
- func NewByExtractIcon(pFileName string) *Image
- func NewByFile(pFileName string) *Image
- func NewByFileAdaptive(pFileName string, leftSize, topSize, rightSize, bottomSize int32) *Image
- func NewByFileRect(pFileName string, x, y, cx, cy int32) *Image
- func NewByHBITMAP(hBitmap uintptr) *Image
- func NewByHICON(hIcon uintptr) *Image
- func NewByHandle(handle int) *Image
- func NewByImage(pImage uintptr) *Image
- func NewByMem(pBuffer []byte) *Image
- func NewByMemAdaptive(pBuffer []byte, leftSize, topSize, rightSize, bottomSize int32) *Image
- func NewByMemRect(pBuffer []byte, x, y, cx, cy int32) *Image
- func NewByName(name string) *Image
- func NewByNameEx(fileName, name string) *Image
- func NewByRes(id int32, pType string, bStretch bool, hModule uintptr) *Image
- func NewByResAdaptive(id int32, pType string, leftSize, topSize, rightSize, bottomSize int32, ...) *Image
- func NewBySrc(hImageSrc int) *Image
- func NewBySvg(hSvg int) *Image
- func NewBySvgFile(pFileName string) *Image
- func NewBySvgString(str string) *Image
- func NewBySvgStringUtf8(str string) *Image
- func NewBySvgStringW(str string) *Image
- func NewByZip(pZipFileName string, pFileName string, pPassword string) *Image
- func NewByZipAdaptive(pZipFileName string, pFileName string, pPassword string, x1, x2, y1, y2 int32) *Image
- func NewByZipMem(data []byte, pFileName string, pPassword string) *Image
- func NewByZipRect(pZipFileName string, pFileName string, pPassword string, x, y, cx, cy int32) *Image
- func NewByZipRes(id int32, pFileName string, pPassword string, hModule uintptr) *Image
- func (i *Image) AddRef() *Image
- func (i *Image) Destroy() *Image
- func (i *Image) EnableAutoDestroy(bEnable bool) *Image
- func (i *Image) EnableCenter(bCenter bool) *Image
- func (i *Image) EnableTranColor(bEnable bool) *Image
- func (i *Image) GetDrawType() xcc.Image_Draw_Type_
- func (i *Image) GetHeight() int32
- func (i *Image) GetImageSrc() int
- func (i *Image) GetImageSrcObj() *Image
- func (i *Image) GetRefCount() int32
- func (i *Image) GetSvg() int
- func (i *Image) GetSvgObj() *svg.Svg
- func (i *Image) GetWidth() int32
- func (i *Image) IsAdaptive() bool
- func (i *Image) IsCenter() bool
- func (i *Image) IsStretch() bool
- func (i *Image) IsTile() bool
- func (i *Image) Release() *Image
- func (i *Image) SetDrawType(nType xcc.Image_Draw_Type_) bool
- func (i *Image) SetDrawTypeAdaptive(leftSize, topSize, rightSize, bottomSize int32) bool
- func (i *Image) SetRotateAngle(fAngle float32) float32
- func (i *Image) SetScaleSize(width, height int32) *Image
- func (i *Image) SetSplitEqual(nCount, iIndex int32) *Image
- func (i *Image) SetTranColor(color uint32) *Image
- func (i *Image) SetTranColorEx(color uint32, tranColor byte) *Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct {
objectbase.ObjectBase
}
Image 炫彩图片.
func NewByExtractIcon ¶ added in v1.3.352
图片_加载文件图标, 加载文件图标, 从一个EXE文件或DLL文件或图标文件; 例如:*.exe文件的图标, 失败返回 nil.
pFileName: 文件名.
func NewByFileAdaptive ¶ added in v1.3.352
图片_加载从文件自适应, 加载图片从文件, 自适应图片, 失败返回 nil.
pFileName: 图片文件.
leftSize: 坐标.
topSize: 坐标.
rightSize: 坐标.
bottomSize: 坐标.
func NewByFileRect ¶ added in v1.3.352
图片_加载从文件指定区域, 加载图片, 指定区位置及大小, 失败返回 nil.
pFileName: 图片文件.
x: 坐标.
y: 坐标.
cx: 宽度.
cy: 高度.
func NewByHBITMAP ¶ added in v1.3.352
图片_加载从HBITMAP, 创建一个炫彩图片句柄, 从一个现有的位图句柄 HBITMAP, 失败返回 nil.
hBitmap: 位图句柄.
func NewByHICON ¶ added in v1.3.352
图片_加载从HICON, 创建一个炫彩图片句柄, 从一个现有的图标句柄 HICON, 失败返回 nil.
hIcon: 图标句柄.
func NewByImage ¶ added in v1.3.352
图片_加载从Image, 加载图片从 GDI+ 的Image对象, 失败返回 nil.
pImage: GDI图片对象指针Image*.
func NewByMemAdaptive ¶ added in v1.3.352
图片_加载从内存自适应, 加载流图片压缩包, 自适应图片(九宫格), 失败返回 nil.
pBuffer: 图片数据.
leftSize: 坐标.
topSize: 坐标.
rightSize: 坐标.
bottomSize: 坐标.
func NewByMemRect ¶ added in v1.3.352
图片_加载从内存指定区域, 加载流图片, 指定区位置及大小, 失败返回 nil.
pBuffer: 图片数据.
x: 坐标.
y: 坐标.
cx: 宽度.
cy: 高度.
func NewByNameEx ¶ added in v1.3.352
NewByNameEx 从指定的资源文件中, 根据 name 创建对象, 失败返回 nil.
pFileName: 资源文件名.
name: 资源名称.
func NewByRes ¶ added in v1.3.352
图片_加载从资源, 失败返回 nil.
id: 资源 ID.
pType: 资源类型.
bStretch: 是否拉伸图片.
hModule: 从指定模块加载, 例如: DLL, EXE; 如果为空, 从当前 EXE 加载.
func NewByResAdaptive ¶ added in v1.3.352
func NewByResAdaptive(id int32, pType string, leftSize, topSize, rightSize, bottomSize int32, hModule uintptr) *Image
图片_加载从资源自适应, 加载图片从资源, 自适应图片, 失败返回 nil.
id: 资源 ID.
pType: 资源类型.
leftSize: 坐标.
topSize: 坐标.
rightSize: 坐标.
bottomSize: 坐标.
hModule: 从指定模块加载, 例如: DLL, EXE; 如果为空, 从当前 EXE 加载.
func NewByZip ¶ added in v1.3.352
图片_加载从ZIP, 加载图片从 ZIP 压缩包, 失败返回 nil.
pZipFileName: ZIP 压缩包文件名.
pFileName: 图片文件名.
pPassword: ZIP 压缩包密码.
func NewByZipAdaptive ¶ added in v1.3.352
func NewByZipAdaptive(pZipFileName string, pFileName string, pPassword string, x1, x2, y1, y2 int32) *Image
图片_加载从ZIP自适应, 加载图片从ZIP压缩包, 自适应图片, 失败返回 nil.
pZipFileName: ZIP 压缩包文件名.
pFileName: 图片文件名.
pPassword: ZIP 压缩包密码.
x1: 坐标.
x2: 坐标.
y1: 坐标.
y2: 坐标.
func NewByZipMem ¶ added in v1.3.352
图片_加载从内存ZIP, 失败返回 nil.
data: 图片数据.
pFileName: 图片名称.
pPassword: zip 压缩包密码.
func NewByZipRect ¶ added in v1.3.352
func NewByZipRect(pZipFileName string, pFileName string, pPassword string, x, y, cx, cy int32) *Image
图片_加载从ZIP指定区域, 加载ZIP图片, 指定区位置及大小, 失败返回 nil.
pZipFileName: ZIP 文件.
pFileName: 图片名称.
pPassword: 密码.
x: 坐标.
y: 坐标.
cx: 宽度.
cy: 高度.
func NewByZipRes ¶ added in v1.3.380
图片_加载从资源ZIP, 失败返回 nil.
id: RC 资源 ID.
pFileName: 图片文件名.
pPassword: ZIP 压缩包密码.
hModule: 模块句柄, 可填0.
func (*Image) GetDrawType ¶
func (i *Image) GetDrawType() xcc.Image_Draw_Type_
图片_取绘制类型, 获取图片绘制类型, 返回: xcc.Image_Draw_Type_.
func (*Image) GetImageSrcObj ¶ added in v1.3.399
图片_取图片源, 返回图片对象, 失败返回 nil.
func (*Image) SetDrawType ¶
func (i *Image) SetDrawType(nType xcc.Image_Draw_Type_) bool
图片_置绘制类型, 设置图片绘制类型.
nType: 图片绘制类型, xcc.Image_Draw_Type_.
func (*Image) SetDrawTypeAdaptive ¶
图片_置绘制类型自适应, 设置图片自适应(九宫格).
leftSize: 坐标.
topSize: 坐标.
rightSize: 坐标.
bottomSize: 坐标.