C # question (a) Halcon mixed program encountered

  1. Target platforms
    case halcon install a 64-bit, x64 target platform must be used and can not use x86

  2. Target framework
    can not use the .Net Framework Client version, there are some necessary procedures rallies missing tests using .Net Framework 4.0 can be normal.

  3. HObject and C # object conversion problems with each other.
    In the mixed program, this should be a big problem, the reason why I had been unaware of the problem, because although I was doing mixed programming, but I actually just some operators halcon in the environment using C # play a bit,
    the image display controls in wpf using halcon also provided.
    The current problem I have encountered is the conversion issue HObject and BitmapImage, I used a Image control in wpf, Source should be ImageSource type.
    According to online information point of view, this process may involve two conversion: HObject convert Bitmap, Bitmap converted to ImageSource.
    In the case of time-consuming and does not consider there to save the picture needs to find a way to avoid the type of conversion: the preserved HObject types of pictures, and then read into ImageSource.
    But in the case to consider the issue and does not require time-consuming to save the picture, read and write files estimate is inefficient, must find a method that can be converted.
    Reference document: https://blog.csdn.net/qq_20161893/article/details/78580036
    https://blog.csdn.net/jiuzaizuotian2014/article/details/81279423
    https://codeday.me/bug/20180824/228349 .html
    https://docs.microsoft.com/en-us/dotnet/api/system.drawing.bitmap.gethbitmap?view=netframework-4.8

    Problems encountered during testing point, when converted to Bitmap occasional memory corruption problems, the specific approach still have to look Think again. unsafe use is not very pleasant.

Guess you like

Origin www.cnblogs.com/yutou2016/p/11310836.html