Skiasharp: Accessing SKMatrix.PostConcat from VB

Created on 22 Nov 2017  路  7Comments  路  Source: mono/SkiaSharp

Trying to call 'PostConcat' from VB.NET gives me the following error:

'PostConcat' is ambiguous because multiple kinds of members with this name exist in structure 'SkiaSharp.SKMatrix'.

VS bug #736295

status-up-for-grabs type-enhancement

Most helpful comment

I have been working on making the SKMatrix members actually useful in https://github.com/mono/SkiaSharp/pull/1123

Instead of having random static members that aren't particularly intuitive, I have added 3 instance members that are better:

// matrices
SKMatrix a = SKMatrix.CreateTranslation(10, 10);
SKMatrix b = SKMatrix.CreateRotation(45);

SKMatrix pre = a.PreConcat(b);
SKMatrix post = a.PostConcat(b);
SKMatrix concat = SKMatrix.Concat(a, b);

All 7 comments

This appears to be the issue:
https://docs.microsoft.com/en-us/dotnet/visual-basic/misc/bc30345

'<method1>' and '<method2>' cannot overload each other because they differ only
by parameters declared 'ByRef' or 'ByVal'

It appears VB does not support (differentiate) a feature supported by C#.

I am not sure if there is a workaround, but I will investigate what we can do.

I've already found another way of doing what I want without playing with SKMatrix. What's critical about this 'issue' is that none of the methods are visible in VB, 'PostConcat' is completely gone. Maybe you could implement a helper function or extension...

This is something that we will be looking at in the future.

There is a comment here (https://github.com/mono/SkiaSharp/issues/1076#issue-541156546) that could potentially fix this by adding a differently-named overload for VB. This might be all that is needed.

Moving it to v1.68.2 so we can make sure this gets done.

I have been working on making the SKMatrix members actually useful in https://github.com/mono/SkiaSharp/pull/1123

Instead of having random static members that aren't particularly intuitive, I have added 3 instance members that are better:

// matrices
SKMatrix a = SKMatrix.CreateTranslation(10, 10);
SKMatrix b = SKMatrix.CreateRotation(45);

SKMatrix pre = a.PreConcat(b);
SKMatrix post = a.PostConcat(b);
SKMatrix concat = SKMatrix.Concat(a, b);

Work has been done, features been added, previews published. Check out the brand new preview (1.68.2-preview.29) that just left the gates! https://github.com/mono/SkiaSharp/releases/tag/v1.68.2-preview.29

Was this page helpful?
0 / 5 - 0 ratings