[API]
CreateStreamOnHGlobal
OleLoadPicture
GlobalAlloc
GlobalLock
GlobalUnlock
GlobalFree
RtlMoveMemory

[CODE]
Public Function IPictureFromString(ByVal PicData As String) As IPicture
  Dim xLong1 As Long
  Dim hMem  As Long
  Dim lpMem  As Long
  Dim istm As IUnknown '  IStream
  Dim xLongA1(3) As Long
  
  xLong1 = Len(PicData)
  If Not xLong1 = 0& Then
    hMem = GlobalAlloc(2&, xLong1)
    If Not hMem = 0& Then
      lpMem = GlobalLock(hMem)
      If lpMem Then
        Call RtlMoveMemory(ByVal lpMem, ByVal PicData, xLong1)
        Call GlobalUnlock(hMem)
        If CreateStreamOnHGlobal(hMem, 1&, istm) = 0& Then
          xLongA1(0) = &H7BF80980 '"{7BF80980-BF32-101A-8BBB-00AA00300CAB}"
          xLongA1(1) = &H101ABF32
          xLongA1(2) = &HAA00BB8B
          xLongA1(3) = &HAB0C3000
          Call OleLoadPicture(ByVal ObjPtr(istm), xLong1, 0&, VarPtr(xLongA1(0)), IPictureFromString)
          GoTo Success
          End If
        End If
      Call GlobalFree(hMem)
      End If
    End If
Success:
  End Function
