There are conflicts with the newer versions of oleexp regarding to WIC. The new oleexp already has WIC declarations which are incompatible with wicvb.tlb. I can't compile this TLB because of UUID redefinitions and this TLB requires some OLEEXP types.
ADDED:
The sources of the typelib are in the attachment. I've updated the references to OLEEXP5.1 but wicvb.tlb won't work so SaveImage project won't work too. You could remove wicvb.tlb from the references and use OLEEXP interfaces declarations instead with the small modifications of the code.
I have no experience in using this Direct 2d, can you send the "saved image" project modified to work without problem and new versions of oleexp like as 5.1?
about your attached i saw these errors after open and run demos projects with some defaults with 4.3 oleexp and replaced with oleexp 5.1 :
I've removed the OLEEXP references from the typelibraries (some types was redefinited like UUID and some changed to void*/IUnknown). Some projects use OLEEXP but you can use any version now because it's a VB reference not a tlb reference.
wicvb.tlb refers to the types from OLEEXP4.3 whenas D2D refers to the types declared in OLEEXP5.1
I'm talking about the version you posted in #159 that doesn't reference wicvb.tlb, and using it with oleexp 5.1.
Sidenote: If people ever wonder why oleexp is a massive single library, it's because of issues like this. The trick, would it be ok if I incorporated your D2D libraries into oleexp? I'll of course credit you.
Last edited by fafalone; Dec 7th, 2022 at 04:44 AM.
if u can incorporate wic+d2d into oleexp it would be best, at least to avoid this kind of situations.
the other alternative is to make d2d+wic its own tlb that don't need any dependencies from oleexp or other
another thing.
d2d is compatible with windows 7, so all the new features we get in windows 10 (more interpolation modes, SVG rendering etc) are not implemented.
if so it could make it not working in windows 7 anymore.
do u think its possible to add more features without messing with compatibility?
so, say,
if u system is windows 10 u can use a better interpolation mode, but if windows 7, it will use the default D2D1_INTERPOLATION_MODE_LINEAR
because I can't use
D2D1_INTERPOLATION_MODE_CUBIC,
D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR,
D2D1_INTERPOLATION_MODE_ANISOTROPIC,
D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC,
Because it's easier to check success/handle failure when you can access the HRESULT directly instead of having to rely on VB raising runtime errors and jumping into a handler.
I made sure to use them in the callback interfaces... are there others that are used with Implements that aren't using all HRESULT?
It'll be a day or two before I post the version with it merged... there's quite a bit of syntax incompatible with MKTYPLIB; oleexp can't be compiled with midl.
Last edited by fafalone; Dec 7th, 2022 at 08:10 AM.
I made sure to use them in the callback interfaces... are there others that are used with Implements that aren't using all HRESULT?
It'll be a day or two before I post the version with it merged... there's quite a bit of syntax incompatible with MKTYPLIB; oleexp can't be compiled with midl.
For example when use wicvb.tlb (uses HRESULT):
Code:
' // Create WIC bitmap that is saved to file
Set cBitmap = cWicFactory.CreateBitmap(Me.ScaleWidth, Me.ScaleHeight, _
WIC.GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnLoad)
' // Inverse half pixels
Set cLock = cBitmap.Lock(WIC.WICRect(0, 0, Me.ScaleWidth, Me.ScaleHeight / 2), WICBitmapLockWrite)
If i'd use OLEEXP WIC definitions (without HRESULT):
Code:
' // Create WIC bitmap that is saved to file
If cWicFactory.CreateBitmap(Me.ScaleWidth, Me.ScaleHeight, _
WIC.GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnLoad, cBitmap) < 0 Then
' error handle
End If
' // Inverse half pixels
If cBitmap.Lock(WIC.WICRect(0, 0, Me.ScaleWidth, Me.ScaleHeight / 2), WICBitmapLockWrite, cLock) < 0 Then
' error handle
End If
The second one is like C-style coding. Nothing bad just i prefer to use [out, retval] and etc in VB.
I've removed the OLEEXP references from the typelibraries (some types was redefinited like UUID and some changed to void*/IUnknown). Some projects use OLEEXP but you can use any version now because it's a VB reference not a tlb reference.
thanks i downloaded from post 166,all project attached work good exepct these 3 projects :
custom font project error:
custom render project error:
save image error :
Is it not possible that these 3 projects work without the need for oleexp 5.1 (without depened)?
[ ... active on skype and discord ... ] ,[always strive to achieve your dreams] , [always try,dont stop,never say never]
I believe The trick was saying he removed the oleexp dependency *from the TLBs*, so you can use any version because only VB is referencing it and VB doesn't depend on it being byte-for-byte identical.
If you remove it entirely you'll have to replace all the constants/declares that are in it.
i removed oleexp from refrences of that 3 projects and fixed these project like as this :
in custom font :
Code:
' orginal depend on oleexp
'Err.Raise E_INVALIDARG
' without oleexp
Err.Raise &H80070057
in save image :
i redeclared this type without need oleexp now :
Code:
Private Type SAFEARRAYBOUND
cElements As Long
lLbound As Long
End Type
but about custom render project ,how can redeclare this sub movememory as i shown in post 174
Code:
Private Function IDWriteTextRendererImp_GetCurrentTransform( _
ByVal pClientDrawingContext As Long) As DWVBLib.DWRITE_MATRIX
MoveMemory IDWriteTextRendererImp_GetCurrentTransform, mcRenderTarget.GetTransform, _
Len(IDWriteTextRendererImp_GetCurrentTransform)
End Function
i can just see this sub like as this :
Code:
Sub MoveMemory(pDest As Any, pSource As Any, ByteLen As Long)
i have another question too to i wanna do something like this :
i want show a png pic with direct 2d like as layred window and then i rotate it like as 3d with rotate effect or skew effect like this :
for example i want just rotate that png on Y and then show it like as layred window
how can do that? i hv no experience about direct 2d and show like as layred window useing direct 2d,any sample about it?
am i need use direct 2d for that rotate 3d or any sample without need direct 2d?
Last edited by Black_Storm; Dec 8th, 2022 at 06:45 PM.
[ ... active on skype and discord ... ] ,[always strive to achieve your dreams] , [always try,dont stop,never say never]
how can do that? i hv no experience about direct 2d and show like as layred window useing direct 2d,any sample about it?
am i need use direct 2d for that rotate 3d or any sample without need direct 2d?
Open ImageDrawings project and replace transform to: