mirror of
https://github.com/Smaug123/ray-tracing-fsharp
synced 2025-10-08 05:18:43 +00:00
19 lines
440 B
Forth
19 lines
440 B
Forth
namespace RayTracing.App
|
|
|
|
open System.Reflection
|
|
open SkiaSharp
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module LoadImage =
|
|
|
|
let fromResource (name : string) : SKBitmap =
|
|
let assy = Assembly.GetExecutingAssembly ()
|
|
|
|
use resource =
|
|
assy.GetManifestResourceNames ()
|
|
|> Seq.filter (fun i -> i.EndsWith name)
|
|
|> Seq.head
|
|
|> assy.GetManifestResourceStream
|
|
|
|
SKBitmap.Decode resource
|