GithubHelp home page GithubHelp logo

Use in Blazor (wasm)? about nidenticon HOT 3 CLOSED

robthree avatar robthree commented on June 7, 2024
Use in Blazor (wasm)?

from nidenticon.

Comments (3)

RobThree avatar RobThree commented on June 7, 2024 1

You can output a data-uri; an example of this is here. I haven't had the chance to work with Blazor so I don't know how it would work there but I assume similarly.

As for the PlatformNotSupportedException: this may help:

... you can enable support for non-Windows platforms in .NET 6 by setting the System.Drawing.EnableUnixSupport runtime configuration switch to true in the runtimeconfig.json file.

runtimeconfig.template.json template file:

{
   "configProperties": {
      "System.Drawing.EnableUnixSupport": true
   }
}

[appname].runtimeconfig.json output file:

{
   "runtimeOptions": {
      "configProperties": {
         "System.Drawing.EnableUnixSupport": true
      }
   }
}

from nidenticon.

lonix1 avatar lonix1 commented on June 7, 2024

Update:

I tried this, from the examples in the docs page:

var g = new IdenticonGenerator();
var bitmap = g.Create("foo",);

Which fails with:

System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.

from nidenticon.

lonix1 avatar lonix1 commented on June 7, 2024

Yes I figured out the data-uri bit, but unfortunately the failure occurs before that, when the code enters the System.Drawing namespace.

Thanks for that workaround, though I doubt I'd use it if it's targetting Windows... but this bit got my attention:

It's around 30,000 lines of C code that's largely untested

😮😮😮

That made me laugh! Now I won't feel so bad when I don't write many tests - even MS is guilty!!! 😆

PS: if you ever decide to port to blazor, I'll be happy to help test it. :)

from nidenticon.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.