These are chat archives for AvaloniaUI/Avalonia

11th
Jun 2018
Rayyan Tahir
@RayyanTahir
Jun 11 2018 10:01
I found it in Avalonia.Win32.Interop namespace, but it is not public and I cannot access it. So I created a PR to make it public. AvaloniaUI/Avalonia#1671
Steven Kirk
@grokys
Jun 11 2018 10:30
@RayyanTahir what are you needing virtual key codes for?
Rayyan Tahir
@RayyanTahir
Jun 11 2018 10:31
I have a screen sharing and controlling app like TeamViewer that needs virtual key codes to execute them
Steven Kirk
@grokys
Jun 11 2018 10:32
ok, you're aware they're not cross-platform, right? ;)
Rayyan Tahir
@RayyanTahir
Jun 11 2018 10:32
Oh :P
Do the other platforms (MacOS & Linux) have virtual key codes as well?
ahopper
@ahopper
Jun 11 2018 10:39
Just imported all the MahApps icon packs to Avalonia drawings, only one path in entypo failed
Steven Kirk
@grokys
Jun 11 2018 10:41
hmm ok @RayyanTahir maybe it could work x-plat then
thing is, that class is in our Win32 assembly currently
and looking at the mac ones, they seem to be different to the win32 ones
so i'm not sure how we'd abstract that, or even if we'd want to?
because we're abstracting that away for you
Rayyan Tahir
@RayyanTahir
Jun 11 2018 10:44
Hmmm would key conversions work? Like Mac has a Cmd button and I think that's translated to Window's Window icon button?
Benedikt Schroeder
@Gillibald
Jun 11 2018 10:47
@ahopper what path failed? I would like to try the data on my rewrite.
ahopper
@ahopper
Jun 11 2018 10:48
the entypo instagram one
M18.94586,6.28931a6.60561,6.60561,0,0,0-.41833-2.18463,4.41189,4.41189,0,0,0-1.03809-1.59412,4.41189,4.41189,0,0,0-1.59412-1.03809,6.60561,6.60561,0,0,0-2.18463-.41833C12.75073,1.01038,12.44427,1,10,1s-2.75073.01038-3.71069,0.05414a6.60561,6.60561,0,0,0-2.18463.41833A4.41189,4.41189,0,0,0,2.51056,2.51056,4.41189,4.41189,0,0,0,1.47247,4.10468a6.60561,6.60561,0,0,0-.41833,2.18463C1.01038,7.24927,1,7.55573,1,10s0.01038,2.75073.05414,3.71069a6.60561,6.60561,0,0,0,.41833,2.18463,4.41189,4.41189,0,0,0,1.03809,1.59412,4.41109,4.41109,0,0,0,1.59412,1.03809,6.60561,6.60561,0,0,0,2.18463.41833C7.24927,18.98969,7.55573,19,10,19s2.75073-.01031,3.71069-0.05414a6.60561,6.60561,0,0,0,2.18463-.41833,4.60208,4.60208,0,0,0,2.6322-2.6322,6.60561,6.60561,0,0,0,.41833-2.18463C18.98962,12.75073,19,12.44427,19,10S18.98962,7.24927,18.94586,6.28931Zm-1.61993,7.34747a4.97824,4.97824,0,0,1-.30994,1.67114A2.98017,2.98017,0,0,1,15.30792,17.016a4.9786,4.9786,0,0,1-1.67114.30994C12.68787,17.3692,12.40326,17.37836,10,17.37836s-2.68787-.00916-3.63678-0.05243A4.9786,4.9786,0,0,1,4.69208,17.016a2.78769,2.78769,0,0,1-1.03485-.67322A2.78769,2.78769,0,0,1,2.984,15.30792a4.97824,4.97824,0,0,1-.30994-1.67114C2.6308,12.68774,2.62164,12.40314,2.62164,10s0.00916-2.68774.05243-3.63678A4.9786,4.9786,0,0,1,2.984,4.69208a2.78769,2.78769,0,0,1,.67322-1.03485A2.78769,2.78769,0,0,1,4.69208,2.984a4.9786,4.9786,0,0,1,1.67114-.30994C7.31226,2.6308,7.59686,2.62164,10,2.62164s2.68774,0.00916,3.63678.05243a4.9786,4.9786,0,0,1,1.67114.30994,2.78769,2.78769,0,0,1,1.03485.67322A2.78769,2.78769,0,0,1,17.016,4.69208a4.9786,4.9786,0,0,1,.30994,1.67114c0.04327,0.949.05243,1.2337,0.05243,3.63678S17.3692,12.68774,17.32593,13.63678ZM10,5.37836A4.62164,4.62164,0,1,0,14.62164,10,4.62169,4.62169,0,0,0,10,5.37836ZM10,13a3,3,0,1,1,3-3A3,3,0,0,1,10,13Zm5.88422-7.8042a1.08,1.08,0,1,1-1.08-1.08A1.08,1.08,0,0,1,15.88422,5.1958Z
sorry didn't realize how long it was
it is in the icons directory of my code commented out
Benedikt Schroeder
@Gillibald
Jun 11 2018 10:52
Thats fine
ahopper
@ahopper
Jun 11 2018 10:55
do you mean it works with your new code or that my mess is fine ? :smile:
ahopper
@ahopper
Jun 11 2018 11:02
I tried directly putting some svg fonts directly into drawings, they worked but were all upside down.
Benedikt Schroeder
@Gillibald
Jun 11 2018 11:14
I ment that the length is fine
Have to check if i get any errors
Benedikt Schroeder
@Gillibald
Jun 11 2018 11:31
The path itself parses fine but isn't rendered properly. Probably some error in my conversion.
ahopper
@ahopper
Jun 11 2018 11:39
The paths are just directly extracted from the MahApps wpf icons. This is how it is displayed in wpf
image.png
Steven Kirk
@grokys
Jun 11 2018 11:43
@RayyanTahir what i mean is i don't think we should be doing that conversion. we already abstract away virtual key codes. if you want to deal with them in your app then i think you should handle that yourself
Rayyan Tahir
@RayyanTahir
Jun 11 2018 11:45
@grokys right. Thanks
Benedikt Schroeder
@Gillibald
Jun 11 2018 11:49
@ahopper I could fix the problem. Now it renderes fine.
Is there a way to scale a Path?
Rayyan Tahir
@RayyanTahir
Jun 11 2018 11:51
@Gillibald I think you're looking for ScaleTransform in Path.RenderTransform?
Benedikt Schroeder
@Gillibald
Jun 11 2018 11:51
Ahh didn't realise that property exists ty
Rayyan Tahir
@RayyanTahir
Jun 11 2018 11:51
np :)
Does anyone know if Avalonia provides a way to create a 24-bit Bitmap from raw rgb data?
Benedikt Schroeder
@Gillibald
Jun 11 2018 12:05
test.PNG
Thats what avalonia produces
Benedikt Schroeder
@Gillibald
Jun 11 2018 12:11
Looks like we have to contribute a fix to SharpDX before we can use color fonts with Direct2D1
Rayyan Tahir
@RayyanTahir
Jun 11 2018 12:19
@Gillibald Does Avalonia on Windows use SharpDX for rendering fonts?
ahopper
@ahopper
Jun 11 2018 12:27
@Gillibald looks good is that with unreleased code?
Benedikt Schroeder
@Gillibald
Jun 11 2018 12:28
On Windows SharpDX is used by default. Text is rendered and layouted by DirectWrite.
Rayyan Tahir
@RayyanTahir
Jun 11 2018 12:28
@Gillibald Right, so I have an avalonia application where I am using font for images and I can assign them color. Is that what you were trying to do when you said color fonts?
Benedikt Schroeder
@Gillibald
Jun 11 2018 12:29
@ahopper Thats unreleased code. This is the PR to that code: AvaloniaUI/Avalonia#1661
ahopper
@ahopper
Jun 11 2018 12:31
color fonts are more fun than that https://www.colorfonts.wtf/
Benedikt Schroeder
@Gillibald
Jun 11 2018 12:31
Avalonia uses a IDWriteTextRenderer to process the text. That needs some more implementation effort. We need a TextRenderer to support effects.
Rayyan Tahir
@RayyanTahir
Jun 11 2018 12:31
Oh now I see what you mean. That's nice