Unit11.dfm

<< Click to Display Table of Contents >>

Navigation:  Demos > XIV > Delphi > WebCam >

Unit11.dfm

object IWForm11: TIWForm11

 Left = 0

 Top = 0

 Width = 944

 Height = 738

 RenderInvisibleControls = False

 OnRender = IWAppFormRender

 AllowPageAccess = True

 ConnectionMode = cmAny

 ExtraHeader.Strings = (

 ''

 

 'video { border: 1px solid #ccc; display: block; margin: 0; paddi' +

 'ng: 0; }'

 

 'canvas { border: 1px solid #ccc; display: block; margin: 0; padd' +

 'ing: 0; }'

 ''

 ''

 ''

 'var video = null;'

 'var canvas = null;'

 'var canvasContext = null;'

 'var webimage = null;'

 'var statusLabel = null;'

 ''

 'function initVideo() {'

 #9'video = document.getElementById("monitor");'

 #9'canvas = document.getElementById("canvas");'

 #9'canvasContext = canvas.getContext("2d");'

 #9'webimage = document.getElementById("IMGCAM");'

 #9'statusLabel = document.getElementById("LBLSTATUS");'

 

 #9'navigator.webkitGetUserMedia({video:true}, gotStream, noStream)' +

 ';'

 '}'

 ''

 'function setStatus(aStatus) {'

 #9'statusLabel.innerHTML = aStatus;'

 '}'

 ''

 'function gotStream(stream) {'

 #9'video.onerror = function () {'

 #9#9'stream.stop();'

 #9#9'streamError();'

 #9'};'

 ' video.srcObject = stream;'

 

 #9'//video.src = webkitURL.createObjectURL(stream); -> Deprecated' +

 ' '

 '}'

 ''

 'function noStream() {'

 #9'setStatus('#39'No camera available.'#39');'

 '}'

 ' '

 'function streamError() {'

 #9'setStatus('#39'Camera error.'#39');'

 '}'

 ''

 'function copyVideo() {'

 #9'canvasContext.drawImage(video, 0, 0, 420, 340);'

 #9'webimage.src = canvas.toDataURL("image/jpeg", 0.5);'

 #9'setStatus('#39'Video is working'#39');'

 ' }'

 ' ')

 Background.Fixed = False

 HandleTabs = False

 LeftToRight = True

 LockUntilLoaded = True

 LockOnSubmit = True

 ShowHint = True

 DesignLeft = 8

 DesignTop = 8

 object imgCam: TIWImage

 Left = 496

 Top = 76

 Width = 420

 Height = 340

 RenderSize = False

 StyleRenderOptions.RenderSize = False

 BorderOptions.Width = 0

 TabOrder = -1

 UseSize = False

 FriendlyName = 'imgCam'

 TransparentColor = clNone

 JpegOptions.CompressionQuality = 90

 JpegOptions.Performance = jpBestSpeed

 JpegOptions.ProgressiveEncoding = False

 JpegOptions.Smoothing = True

 RenderEmptyAsSpan = False

 end

 object monitor: TIWLabel

 Left = 24

 Top = 76

 Width = 420

 Height = 340

 Font.Color = clNone

 Font.Size = 10

 Font.Style = []

 HasTabOrder = False

 AutoSize = False

 FriendlyName = 'monitor'

 Caption = 

 '