Giter Club home page Giter Club logo

Comments (2)

Hypnodude avatar Hypnodude commented on July 20, 2024

VB6 function to try retrieve the IPicture from the PixelData.Pixels array:

Called as follows:
PictureBox.Picture = ArrayToPicture(Result.Pixels)
where Result is an instance of the PixelData object returned from using writer.write("text to be encoded as a barcode")

Public Function ArrayToPicture(inArray() As Byte) As IPicture

' function creates a stdPicture from the passed array
' Offset is first item in array: 0 for 0 bound arrays
' Size is how many bytes comprise the image
Dim o_hMem  As Long
Dim o_lpMem  As Long
Dim aGUID(0 To 3) As Long
Dim Offset As Long
Dim Size As Long

Dim IIStream As IUnknown

aGUID(0) = &H7BF80980    ' GUID for stdPicture
aGUID(1) = &H101ABF32
aGUID(2) = &HAA00BB8B
aGUID(3) = &HAB0C3000

Offset = 0
Size = UBound(inArray) + 1
    
o_hMem = GlobalAlloc(&H2&, Size)
If Not o_hMem = 0& Then
    o_lpMem = GlobalLock(o_hMem)
    If Not o_lpMem = 0& Then
        CopyMemory ByVal o_lpMem, inArray(Offset), Size
        'MoveMemory ByVal o_lpMem, inArray(Offset), Size
        Call GlobalUnlock(o_hMem)
        If CreateStreamOnHGlobal(o_hMem, 1&, IIStream) = 0& Then
              Call OleLoadPicture(ByVal ObjPtr(IIStream), 0&, 0&, aGUID(0), ArrayToPicture)
        End If
    End If
End If

End Function

from zxing.net.

micjahn avatar micjahn commented on July 20, 2024

Thanks for the report.

from zxing.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.