mirror of
https://github.com/Smaug123/ray-tracing-fsharp
synced 2025-10-11 06:48:39 +00:00
20 lines
458 B
Forth
20 lines
458 B
Forth
namespace RayTracing.App
|
|
|
|
open System.Drawing
|
|
open System.Reflection
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module LoadImage =
|
|
|
|
let fromResource (name : string) : Bitmap =
|
|
let assy = Assembly.GetExecutingAssembly ()
|
|
|
|
use resource =
|
|
assy.GetManifestResourceNames ()
|
|
|> Seq.filter (fun i -> i.EndsWith name)
|
|
|> Seq.head
|
|
|> assy.GetManifestResourceStream
|
|
|
|
let b = new Bitmap (resource)
|
|
b
|