本帖最后由 wlp 于 2025-1-1 11:14 编辑
截图.zip
(1.51 MB, 下载次数: 24)
什么是非注册com,举个例子:DirectX9, DirectX10, DirectX11,DirectX12那种非注册com只能根据c++接口定义调用,不能用易语言 "对象".查看(),cha询到所有方法,只能自己手动实现
这个代码是编码器,还有一个方法是解码器(没实现),两个相互配合就可以做图片格式转换其他格式就不搞了,太麻烦了,默认格式是:bmp(32位RGBA)
这种非注册com组件,用易语言的对象没法调用,只是提供一个方法
这种com接口结构怎么算呢,比如:A继承B
c++里面是
struct B {
a: int
b: int
}
struct A: B {
a: int
b: int
c: int
}
易语言里面就这么写 (谁是父类,谁就塞前面,b是a的父类)
{
b_a
b_b
a_a
a_b
a_c
}
‘--------------这里可以修改图片格式 ----------------
GUID_ContainerFormatBmp =
_UUID ( “{0af1d87e-fcfe-4188-bdeb-a7906471cbe3}” ) hr =
IWICImagingFactory_CreateEncoder ( pFactory,
取变量数据地址 ( GUID_ContainerFormatBmp
) , 0,
取变量数据地址 ( pEncoder
) )
‘----------------原始的guid--------------------------
DEFINE_GUID(GUID_ContainerFormatBmp, 0x0af1d87e, 0xfcfe, 0x4188, 0xbd, 0xeb, 0xa7, 0x90, 0x64, 0x71, 0xcb, 0xe3);
DEFINE_GUID(GUID_ContainerFormatPng, 0x1b7cfaf4, 0x713f, 0x473c, 0xbb, 0xcd, 0x61, 0x37, 0x42, 0x5f, 0xae, 0xaf);
DEFINE_GUID(GUID_ContainerFormatIco, 0xa3a860c4, 0x338f, 0x4c17, 0x91, 0x9a, 0xfb, 0xa4, 0xb5, 0x62, 0x8f, 0x21);
DEFINE_GUID(GUID_ContainerFormatJpeg, 0x19e4a5aa, 0x5662, 0x4fc5, 0xa0, 0xc0, 0x17, 0x58, 0x02, 0x8e, 0x10, 0x57);
DEFINE_GUID(GUID_ContainerFormatTiff, 0x163bcc30, 0xe2e9, 0x4f0b, 0x96, 0x1d, 0xa3, 0xe9, 0xfd, 0xb7, 0x88, 0xa3);
DEFINE_GUID(GUID_ContainerFormatGif, 0x1f8a5601, 0x7d4d, 0x4cbd, 0x9c, 0x82, 0x1b, 0xc8, 0xd4, 0xee, 0xb9, 0xa5);
DEFINE_GUID(GUID_ContainerFormatWmp, 0x57a37caa, 0x367a, 0x4540, 0x91, 0x6b, 0xf1, 0x83, 0xc5, 0x09, 0x3a, 0x4b);
DEFINE_GUID(GUID_ContainerFormatDds, 0x9967cb95, 0x2e85, 0x4ac8, 0x8c, 0xa2, 0x83, 0xd7, 0xcc, 0xd4, 0x25, 0xc9);
DEFINE_GUID(GUID_ContainerFormatAdng, 0xf3ff6d0d, 0x38c0, 0x41c4, 0xb1, 0xfe, 0x1f, 0x38, 0x24, 0xf1, 0x7b, 0x84);
DEFINE_GUID(GUID_ContainerFormatHeif, 0xe1e62521, 0x6787, 0x405b, 0xa3, 0x39, 0x50, 0x07, 0x15, 0xb5, 0x76, 0x3f);
DEFINE_GUID(GUID_ContainerFormatWebp, 0xe094b0e2, 0x67f2, 0x45b3, 0xb0, 0xea, 0x11, 0x53, 0x37, 0xca, 0x7c, 0xf3);
DEFINE_GUID(GUID_ContainerFormatRaw, 0xfe99ce60, 0xf19c, 0x433c, 0xa3, 0xae, 0x00, 0xac, 0xef, 0xa9, 0xca, 0x21);
’-----------------------下面是chatgpt帮转换的有可能不对----------------------
GUID_ContainerFormatBmp = {0af1d87e-fcfe-4188-bdeb-a7906471cbe3}
GUID_ContainerFormatPng = {1b7cfaf4-713f-473c-bbcd-6137425faeaf}
GUID_ContainerFormatIco = {a3a860c4-338f-4c17-919a-fba4b5628f21}
GUID_ContainerFormatJpeg = {19e4a5aa-5662-4fc5-a0c0-1758028e1057}
GUID_ContainerFormatTiff = {163bcc30-e2e9-4f0b-961d-a3e9fdb788a3}
GUID_ContainerFormatGif = {1f8a5601-7d4d-4cbd-9c82-1bc8d4eeb9a5}
GUID_ContainerFormatWmp = {57a37caa-367a-4540-916b-f183c5093a4b}
GUID_ContainerFormatDds = {9967cb95-2e85-4ac8-8ca2-83d7ccd425c9}
GUID_ContainerFormatAdng = {f3ff6d0d-38c0-41c4-b1fe-1f3824f17b84}
GUID_ContainerFormatHeif = {e1e62521-6787-405b-a339-500715b5763f}
GUID_ContainerFormatWebp = {e094b0e2-67f2-45b3-b0ea-115337ca7cf3}
GUID_ContainerFormatRaw = {fe99ce60-f19c-433c-a3ae-00acefa9ca21}