'Renders a resized image
Private Sub Draw_imageresized(ArgumentMap As Map)
Dim Property As ControlProperties = ArgumentMap.Get("Property")
Dim Graphic As GraphicObject = ArgumentMap.Get("GraphicObject")
'define and initialize the image view
Dim Image1 As B4XImageView
Image1.Initialize(Me,"")
'Determine if we are going to resize to the full screen
If Property.DisplayName.ToLowerCase = "fullscreen" Then
Image1.mBase.Top = Settings.Top
Image1.mBase.Left = Settings.Left
Image1.mBase.Width = Settings.Width
Image1.mBase.Height = Settings.Height
Else
Image1.mBase.Top = Property.Top*Settings.ScaleY
Image1.mBase.Left = Property.Left*Settings.ScaleX
Image1.mBase.Width = Property.Width*Settings.ScaleX
Image1.mBase.Height = Property.Height*Settings.ScaleY
End If
'Store the image into a file from the Object ID of the current graphic object, then import and rescale.
Image1.Bitmap = fx.LoadImageSample(File.DirTemp,CallSub3(Callback, "ReturnImageAsFile", Graphic.ObjectID, Graphics), Image1.mBase.Width, Image1.mBase.Height)
'Attach the image to the main parent view
ScorePanel.AddNode(Image1.mBase, Image1.mBase.Left, Image1.mBase.Top, Image1.mBase.Width, Image1.mBase.Height)
End Sub