Microsoft Small Basic

Program Listing:
Embed this in your website
' Flickr Sample
' Version 0.3
' Copyright © 2015-2016 Nonki Takahashi. The MIT License.
' Last update 2016-04-03
' Program ID PWW374-1
'
title = "Flickr Sample 0.3"
GraphicsWindow.Title = title
Not = "True=False;False=True;"
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.BackgroundColor = "#333333"
GraphicsWindow.FontName = "Trebuchet MS"
GraphicsWindow.MouseDown = OnMouseDown
While "True"
  GraphicsWindow.Clear()
  GraphicsWindow.Title = title
  GraphicsWindow.BrushColor = "White"
  GraphicsWindow.DrawText(260, 200, "Loading...")
  url = Flickr.GetRandomPicture("toy")
  GraphicsWindow.BrushColor = "Black"
  tbox = Controls.AddTextBox(10, 400)
  Controls.SetSize(tbox, gw - 20, 22)
  Shapes.SetOpacity(tbox, 50)
  Controls.SetTextBoxText(tbox, url)
  GraphicsWindow.Title = title + " - " + url
  img = ImageList.LoadImage(url)
  iw = ImageList.GetWidthOfImage(img)
  ih = ImageList.GetHeightOfImage(img)
  gwph = gw / gh
  iwph = iw / ih
  If gwph < iwph Then
    scale = gw / iw
    x = 0
    y = Math.Floor((gh - ih * scale) / 2)
  Else
    scale = gh / ih
    x = Math.Floor((gw - iw * scale) / 2)
    y = 0
  EndIf
  GraphicsWindow.DrawResizedImage(img, x, y, iw * scale, ih * scale)
  mouseDown = "False"
  While Not[mouseDown]
    Program.Delay(300)
  EndWhile
EndWhile
Sub OnMouseDown
  mouseDown = "True"
EndSub
Copyright (c) Microsoft Corporation. All rights reserved.