Einhugur macOS Bridge plugin.

NSImage.FromURL Method

Loads image from a URL.

shared FromURL(
   url as String,
   lazy as Boolean) as EinhugurMacOSBridge.NSImage

Parameters

url
The URL to load from.
lazy
If set to true, then image is lazy loaded, that is won’t be loaded right away but will load when it’s drawn for first time. This parameter is optional and default value is false.

Returns

EinhugurMacOSBridge.NSImage

Remarks

Note that on lazy loaded image then fail or not fail is only evaluated by the file ending given by the URL.

Example:

#if TargetMacOS
    using EinhugurMacOSBridge
   
    Dim image as NSImage = NSImage.FromURL("https://einhugur.com/Pics/EinhugurMono.png")
   
    if image <> nil then
       mEinhugurLogo = image.ToPicture(image.Width, image.Height)
    end if
#endif

See Also

NSImage Class