imagex

package
v1.3.390 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 4 Imported by: 7

Documentation

Overview

Package imagex 图片操作.

Index

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

func NewByExtractIcon(pFileName string) *Image

图片_加载文件图标, 加载文件图标, 从一个EXE文件或DLL文件或图标文件; 例如:*.exe文件的图标.

pFileName: 文件名.

func NewByFile added in v1.3.352

func NewByFile(pFileName string) *Image

图片_加载从文件.

pFileName: 图片文件.

func NewByFileAdaptive added in v1.3.352

func NewByFileAdaptive(pFileName string, leftSize, topSize, rightSize, bottomSize int32) *Image

图片_加载从文件自适应, 加载图片从文件, 自适应图片.

pFileName: 图片文件.

leftSize: 坐标.

topSize: 坐标.

rightSize: 坐标.

bottomSize: 坐标.

func NewByFileRect added in v1.3.352

func NewByFileRect(pFileName string, x, y, cx, cy int32) *Image

图片_加载从文件指定区域, 加载图片, 指定区位置及大小.

pFileName: 图片文件.

x: 坐标.

y: 坐标.

cx: 宽度.

cy: 高度.

func NewByHBITMAP added in v1.3.352

func NewByHBITMAP(hBitmap uintptr) *Image

图片_加载从HBITMAP, 创建一个炫彩图片句柄, 从一个现有的位图句柄HBITMAP.

hBitmap: 位图句柄.

func NewByHICON added in v1.3.352

func NewByHICON(hIcon uintptr) *Image

图片_加载从HICON, 创建一个炫彩图片句柄, 从一个现有的图标句柄HICON.

hIcon: 图标句柄.

func NewByHandle added in v1.3.352

func NewByHandle(handle int) *Image

从句柄创建对象.

func NewByImage added in v1.3.352

func NewByImage(pImage uintptr) *Image

图片_加载从Image, 加载图片从GDI+的Image对象.

pImage: GDI图片对象指针Image*.

func NewByMem added in v1.3.352

func NewByMem(pBuffer []byte) *Image

图片_加载从内存, 加载流图片.

pBuffer: 图片数据.

func NewByMemAdaptive added in v1.3.352

func NewByMemAdaptive(pBuffer []byte, leftSize, topSize, rightSize, bottomSize int32) *Image

图片_加载从内存自适应, 加载流图片压缩包, 自适应图片(九宫格).

pBuffer: 图片数据.

leftSize: 坐标.

topSize: 坐标.

rightSize: 坐标.

bottomSize: 坐标.

func NewByMemRect added in v1.3.352

func NewByMemRect(pBuffer []byte, x, y, cx, cy int32) *Image

图片_加载从内存指定区域, 加载流图片, 指定区位置及大小.

pBuffer: 图片数据.

x: 坐标.

y: 坐标.

cx: 宽度.

cy: 高度.

func NewByName added in v1.3.352

func NewByName(name string) *Image

根据资源文件中的name创建对象, 失败返回nil.

pName: 资源名称.

func NewByNameEx added in v1.3.352

func NewByNameEx(fileName, name string) *Image

从指定的资源文件中, 根据name创建对象, 失败返回nil.

pFileName: 资源文件名.

pName: 资源名称.

func NewByRes added in v1.3.352

func NewByRes(id int32, pType string, bStretch bool, hModule uintptr) *Image

图片_加载从资源.

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

图片_加载从资源自适应, 加载图片从资源, 自适应图片.

id: 资源ID.

pType: 资源类型.

leftSize: 坐标.

topSize: 坐标.

rightSize: 坐标.

bottomSize: 坐标.

hModule: 从指定模块加载, 例如:DLL, EXE; 如果为空, 从当前EXE加载.

func NewBySrc added in v1.3.352

func NewBySrc(hImageSrc int) *Image

图片_加载从图片源.

hImageSrc: 图片源句柄.

func NewBySvg added in v1.3.352

func NewBySvg(hSvg int) *Image

图片_加载从SVG.

hSvg: SVG句柄.

func NewBySvgFile added in v1.3.352

func NewBySvgFile(pFileName string) *Image

图片_加载从SVG文件.

pFileName: 文件名.

func NewBySvgString added in v1.3.352

func NewBySvgString(pString string) *Image

图片_加载从SVG字符串.

pString: 字符串.

func NewBySvgStringUtf8 added in v1.3.352

func NewBySvgStringUtf8(pString string) *Image

图片_加载从SVG字符串UTF8, 更推荐使用 imagex.NewBySvgStringW.

pString: 字符串.

func NewBySvgStringW added in v1.3.352

func NewBySvgStringW(pString string) *Image

图片_加载从SVG字符串W.

pString: 字符串.

func NewByZip added in v1.3.352

func NewByZip(pZipFileName string, pFileName string, pPassword string) *Image

图片_加载从ZIP, 加载图片从ZIP压缩包.

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压缩包, 自适应图片.

pZipFileName: ZIP压缩包文件名.

pFileName: 图片文件名.

pPassword: ZIP压缩包密码.

x1: 坐标.

x2: 坐标.

y1: 坐标.

y2: 坐标.

func NewByZipMem added in v1.3.352

func NewByZipMem(data []byte, pFileName string, pPassword string) *Image

图片_加载从内存ZIP.

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图片, 指定区位置及大小.

pZipFileName: ZIP文件.

pFileName: 图片名称.

pPassword: 密码.

x: 坐标.

y: 坐标.

cx: 宽度.

cy: 高度.

func NewByZipRes added in v1.3.380

func NewByZipRes(id int32, pFileName string, pPassword string, hModule uintptr) *Image

图片_加载从资源ZIP.

id: RC资源ID.

pFileName: 图片文件名.

pPassword: ZIP压缩包密码.

hModule: 模块句柄, 可填0.

func (*Image) AddRef

func (i *Image) AddRef() *Image

图片_增加引用计数.

func (*Image) Destroy

func (i *Image) Destroy() *Image

图片_销毁, 强制销毁图片, 谨慎使用, 建议使用 XImage_Release() 释放.

func (*Image) EnableAutoDestroy

func (i *Image) EnableAutoDestroy(bEnable bool) *Image

图片_启用自动销毁, 启用或关闭自动销毁, 当与UI元素关联时有效.

bEnable: 启用自动销毁TRUE.

func (*Image) EnableCenter

func (i *Image) EnableCenter(bCenter bool) *Image

图片_启用居中, 启用或关闭图片居中显示,默认属性图片有效.

bCenter: 是否居中显示.

func (*Image) EnableTranColor

func (i *Image) EnableTranColor(bEnable bool) *Image

图片_启用透明色, 启用或关闭图片透明色.

bEnable: 启用TRUE.

func (*Image) GetDrawType

func (i *Image) GetDrawType() xcc.Image_Draw_Type_

图片_取绘制类型, 获取图片绘制类型, 返回: xcc.Image_Draw_Type_.

func (*Image) GetHeight

func (i *Image) GetHeight() int32

图片_取高度.

func (*Image) GetImageSrc

func (i *Image) GetImageSrc() int

图片_取图片源.

func (*Image) GetRefCount

func (i *Image) GetRefCount() int32

图片_取引用计数.

func (*Image) GetSvg added in v1.3.310

func (i *Image) GetSvg() int

图片_取SVG, 返回SVG句柄.

hImage: 图片句柄.

func (*Image) GetWidth

func (i *Image) GetWidth() int32

图片_取宽度.

func (*Image) IsAdaptive

func (i *Image) IsAdaptive() bool

图片_判断自适应, 是否为自适应图片句柄.

func (*Image) IsCenter

func (i *Image) IsCenter() bool

图片_判断居中, 判断图片是否居中显示.

func (*Image) IsStretch

func (i *Image) IsStretch() bool

图片_判断缩放, 是否为拉伸图片句柄.

func (*Image) IsTile

func (i *Image) IsTile() bool

图片_判断平铺, 是否为平铺图片.

func (*Image) Release

func (i *Image) Release() *Image

图片_释放引用计数, 释放引用计数, 当引用计数为0时, 自动销毁.

func (*Image) SetDrawType

func (i *Image) SetDrawType(nType xcc.Image_Draw_Type_) bool

图片_置绘制类型, 设置图片绘制类型.

nType: 图片绘制类型, Image_Draw_Type_.

func (*Image) SetDrawTypeAdaptive

func (i *Image) SetDrawTypeAdaptive(leftSize, topSize, rightSize, bottomSize int32) bool

图片_置绘制类型自适应, 设置图片自适应(九宫格).

leftSize: 坐标.

topSize: 坐标.

rightSize: 坐标.

bottomSize: 坐标.

func (*Image) SetRotateAngle

func (i *Image) SetRotateAngle(fAngle float32) float32

图片_置旋转角度, 设置旋转角度, 返回先前角度.

fAngle: 选择角度.

func (*Image) SetScaleSize added in v1.3.350

func (i *Image) SetScaleSize(width, height int32) *Image

图片_置缩放大小, 启用缩放属性后有效, 值大于0有效.

width: 宽度.

height: 高度.

func (*Image) SetSplitEqual

func (i *Image) SetSplitEqual(nCount, iIndex int32) *Image

图片_置等分.

nCount: 等分数量.

iIndex: 索引.

func (*Image) SetTranColor

func (i *Image) SetTranColor(color int) *Image

图片_置透明色, 指定图片透明颜色.

color: ARGB 颜色.

func (*Image) SetTranColorEx

func (i *Image) SetTranColorEx(color int, tranColor byte) *Image

图片_置透明色扩展, 指定图片透明颜色及透明度.

color: ARGB 颜色.

tranColor: 透明色的透明度.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL