Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 05 09:38
    cwensley labeled #1946
  • May 05 09:38
    cwensley labeled #1945
  • May 05 09:38
    cwensley labeled #1944
  • May 05 09:38
    cwensley labeled #1943
  • May 05 09:38
    cwensley labeled #1942
  • May 03 20:08
    InfinityGhost opened #1947
  • May 02 10:01
    cwensley labeled #1929
  • May 02 10:01
    cwensley labeled #1925
  • May 02 09:43

    cwensley on develop

    Fix possible NRE with Graphics.… Merge pull request #1946 from c… (compare)

  • May 02 09:43
    cwensley closed #1946
  • May 02 09:35
    cwensley opened #1946
  • Apr 30 22:38

    cwensley on develop

    Wpf: Fix setting selected index… Merge pull request #1945 from c… (compare)

  • Apr 30 22:38
    cwensley closed #1945
  • Apr 30 22:30
    cwensley opened #1945
  • Apr 28 19:23

    cwensley on develop

    Mac: Fix some issues with AutoS… Merge pull request #1944 from c… (compare)

  • Apr 28 19:23
    cwensley closed #1944
  • Apr 28 19:14
    cwensley opened #1944
  • Apr 28 17:46

    cwensley on develop

    Mac: Fix vertical alignment of … Merge pull request #1943 from c… (compare)

  • Apr 28 17:46
    cwensley closed #1943
  • Apr 28 17:37
    cwensley synchronize #1943
Jordan Peck
@Auburn
Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.
linux-x64 and win-x64 are fine, and Google isn't giving any helpful answers
It works if I do a self contained binary, but I don't really want that
Curtis Wensley
@cwensley
Do you have TrimMode set to link?
Jordan Peck
@Auburn
Not sure, this is my command dotnet publish .\FastNoiseLite.csproj -c Release -r osx-x64 --no-self-contained
It's probably whatever the default is
Looks like the default is copyused
Curtis Wensley
@cwensley
Should be.. try adding /p:MacBundleDotNet=False to your command
Jordan Peck
@Auburn
That works thanks
Curtis Wensley
@cwensley
I shouldn't be enabling it if SelfContained is set to false.. hm.
Geoff McQueen
@geoff-m
Is there an equivalent of InvokeRequired()?
i.e. a way to check that the current thread is the UI thread, or a way to schedule work for execution on the UI thread?
Curtis Wensley
@cwensley
Hm there’s no InvokeRequired() however to invoke you use Application.Instance.Invoke/AsyncInvoke. Calling Invoke on the main thread will execute it directly vs scheduling it for later.
Geoff McQueen
@geoff-m
I see. Thanks.
Jordan Peck
@Auburn
Got some more troubles with my MacOS binary, it doesn't want to run without being a .app
Unhandled exception. System.InvalidOperationException: Could not detect platform. Are you missing a platform assembly?

 ---> System.InvalidOperationException: Platform type 'Eto.Mac.Platform, Eto.Mac64' was loaded but is not valid in the current context.  E.g. Mac platforms require to be in an .app bundle to run
Curtis Wensley
@cwensley
@Auburn yes that is normal. Mac applications require an .app bundle to run. This is an OS limitation/requirement.
Jordan Peck
@Auburn
Should it still be possible to run it using dotnet ./myappbinary
Curtis Wensley
@cwensley
No, because it doesn't satisfy the "running in an .app bundle" requirement. I have recently added a change that will let you run it via "dotnet run myProject.csproj" though, which should make things easier.
Curtis Wensley
@cwensley
If you want to run it via command line, or for debugging, you can execute myApp.app/Contents/MacOS/myApp
Jordan Peck
@Auburn
So there is no way to make it framework dependant then?
Curtis Wensley
@cwensley
You can, this is what Eto.Platform.Mac64 nuget package does for you in Debug mode by default.
it still has an executable, just not the whole framework included.
If you're building for release, just set MacBundleDotNet to false in your .csproj.
Jordan Peck
@Auburn
With MacBundleDotNet=false it still produces a 77MB .app
All the system.x.dlls are still there
Curtis Wensley
@cwensley
Are you running dotnet build or dotnet publish?
Jordan Peck
@Auburn
publish
Curtis Wensley
@cwensley
try just build, the nuget package runs the publish for you (you can disable that via MacAutoPublishBundle=false
Jordan Peck
@Auburn
oh I had --self-contained that was causing dotnet to bundle
Curtis Wensley
@cwensley
ah
that'd do it.. 😄
philstopford
@philstopford
@cwensley : just asking - are you making progress on the OpenTK / Veldrid projects? :)
realonepiecefreak
@onepiecefreak3
@cwensley I'm not entirely sure if it's a problem with my code yet, or with Eto.Forms. I have code that converts a System.Drawing.Bitmap to an Eto.Drawing.Bitmap. However converting said image to Eto seems to get rid of alpha completely. It seems that the alpha value is always set to 255 and therefore gets completely ignored.
However, this does not happen, if I load up the image with Eto directly, instead of going through System.Drawing. Which makes me believe that at least not the platform assembly or similar underlying handlers are the actual cause.
// Initialize images
var img = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(@"path_to_png");
var etoImg = new Bitmap(@"path_to_png");

// Convert System.Drawing to Eto.Drawing
var sysImg = new Bitmap(image.Width, image.Height,PixelFormat.Format32bppRgba, image.ToColors().Select(x => Eto.Drawing.Color.FromArgb(x.R, x.G, x.B, x.A)).ToArray());

// Now that both images are in Eto, one can try to render them with an ImageView
imgView.Image = sysImg;
// imgView.Image = etoImg;
imgView.Invalidate();
realonepiecefreak
@onepiecefreak3
The ToColors extension is a bit more complex, but it basically locks the System.Drawing.Bitmap and returns its content as an IEnumerable<System.Drawing.Color>. This code is fully tested and returns the correct colors, with the correct alpha values.
Since it is based on my underlying framwork and contains many dependencies to other parts of it, pasting it here will not help.
I hope someone can help me getting rid of this rendering problem
andrewheumann
@andrewheumann
Hey all -- what's the latest and greatest thinking on a webview control with Eto? I've searched back aways... seems like there has been some progress w/ CefSharp on windows? picoe/Eto#554 but I couldn't find any documentation of how to plug this in... also there was talk of using WebView2 on windows -- has there been any movement on that? I'm open to anything, ideally easy as possible to just pop up a decent browser window that will work on mac and windows.
Curtis Wensley
@cwensley
@andrewheumann yes WebView2 can be used with the latest Eto.Wpf and Eto.WinForms packages. You just need to install Microsoft.Web.WebView2 nuget package with your app.
axx
@axx0
Hi, I'd like to make a checkbox with a custom appearance (paint it in a different style and change appearance of the tick). What is the easiest way to do that?
Curtis Wensley
@cwensley
@axx0 use a Drawable and handle the Paint event.
axx
@axx0

@axx0 use a Drawable and handle the Paint event.

OK so I should make a Drawable surface over the checkbox and paint the new checkbox there?

axx
@axx0
Worked fine. I'll do the same with slider.
Ghost
@ghost~60378dde6da0373984632c25
Hi
Does Eto work with .NET 5?
Because whenever I create a new project I get 0x80041feb error
Curtis Wensley
@cwensley
@StarlkYT yes, it does work with .NET 5 on all platforms. Which platform are you trying to run on? Are you getting the error creating the project, compiling, or running?