• 大小: 684KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: C#
  • 标签: Basler  

资源简介

使用Basler相机软件自带动态库,相机软件版本Basler_pylon_5.0.12.11830,为了Demo可以正常运行,建议安装推荐版本的相机软件。

资源截图

代码片段和文件信息

using HalconDotNet;
using PylonC.NET;
using PylonC.NETSupportLibrary;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace BaslerCamera_Demo
{
    public class CameraID
    {
        public const string BaslerCameraSN = null;
    }

    public class BufferSendEventArgs : EventArgs
    {
        public PylonBuffer cambuffer { get; set; }//获取相机的图片的BUFFER
        public int X { get; set; }
        public int Y { get; set; }
    }

    public class BaslerCamera
    {
        public event EventHandler BufferSend;

        public ImageProvider m_imageProvider = new ImageProvider();                   /* Create one image provider. */
        public BufferSendEventArgs args = new BufferSendEventArgs();
        public PYLON_DEVICE_HANDLE hDev = new PYLON_DEVICE_HANDLE();                  /* Handle for the pylon device. */

        public Dictionary> buffers;      /* Holds handles and buffers used for grabbing. */
        public PYLON_STREAMGRABBER_HANDLE hGrabber;           /* Handle for the pylon stream grabber. */
        public PYLON_WAITobject_HANDLE hWait;                 /* Handle used for waiting for a grab to be finished. */
        public PylonGrabResult_t grabResult;                  /* Stores the result of a grab operation. */

        public uint numDevices;                               /* Number of available devices. */
        public uint payloadSize;                              /* Size of an image frame in bytes. */
        public uint NUM_BUFFERS;                              /* Number of buffers used for grabbing. */
        public int nGrabs;                                    /* Counts the number of buffers grabbed. */
        public uint nStreams;                                 /* The number of streams provides by the device. */
        public bool isAvail;                                  /* Used for checking feature availability. */
        public bool isReady;                                  /* Used as an output parameter. */
        int i;                                                /* Counter. */

        public bool m_bBusy;                                  /* 相机工作状态 */
        public bool m_bCameraIsOK;                            /* 相机是否存在 */
        public bool m_bCameraOpen;                            /* 相机是否打开 */
        public string m_cameraSerialNum;                      /* 相机SN码 */
        public double m_dExposureTime;                        /* 曝光 */
        public double m_dGain;                                /* 增益 */
        public double frameRate;                              /* 实时采图帧率 */
        public bool m_bTrigger;

        public BaslerCamera(string cameraSerialNum)
        {
            m_cameraS

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2018-09-20 11:12  BaslerCamera_Demo\BaslerCamera_Demo\App.config

     文件      39147  2018-09-27 11:03  BaslerCamera_Demo\BaslerCamera_Demo\BaslerCamera.cs

     文件       4667  2018-09-22 14:46  BaslerCamera_Demo\BaslerCamera_Demo\BaslerCamera_Demo.csproj

     文件      35840  2018-09-27 10:54  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.exe

     文件        187  2018-09-20 11:12  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.exe.config

     文件      65024  2018-09-27 10:54  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.pdb

     文件      23168  2018-09-27 10:57  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.vshost.exe

     文件        187  2018-09-20 11:12  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.vshost.exe.config

     文件        490  2018-04-12 07:35  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\BaslerCamera_Demo.vshost.exe.manifest

     文件         48  2018-09-27 10:56  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\data\Config.ini

     文件      61440  2010-08-25 11:21  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\ExtMdl.dll

     文件    1287824  2016-11-25 14:21  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\halcondotnet.dll

     文件    4108744  2016-11-24 05:52  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\halcondotnet.xml

     文件      67016  2018-04-03 11:45  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\PylonC.NET.dll

     文件      28672  2018-09-20 11:02  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\PylonC.NETSupportLibrary.dll

     文件     325576  2018-04-03 11:45  BaslerCamera_Demo\BaslerCamera_Demo\bin\Debug\PylonC_MD_VC120_v5_0.dll

     文件      22714  2018-09-27 10:51  BaslerCamera_Demo\BaslerCamera_Demo\FrmMain.cs

     文件      18161  2018-09-27 10:44  BaslerCamera_Demo\BaslerCamera_Demo\FrmMain.Designer.cs

     文件       5990  2018-09-27 10:44  BaslerCamera_Demo\BaslerCamera_Demo\FrmMain.resx

     文件       3689  2018-09-27 10:57  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.csproj.FileListAbsolute.txt

     文件        979  2018-09-27 10:46  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.csproj.GenerateResource.Cache

     文件      38593  2018-09-27 10:42  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.csprojResolveAssemblyReference.cache

     文件      35840  2018-09-27 10:54  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.exe

     文件        180  2018-09-27 10:46  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.FrmMain.resources

     文件      65024  2018-09-27 10:54  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.pdb

     文件        180  2018-09-23 18:08  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\BaslerCamera_Demo.Properties.Resources.resources

     文件      26249  2018-09-27 10:29  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7698  2018-09-27 10:29  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2018-09-20 11:12  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2018-09-20 11:12  BaslerCamera_Demo\BaslerCamera_Demo\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

............此处省略23个文件信息

评论

共有 条评论