Possible Library Conflict -- 2019-10-10-163010
2019-10-10-163010
All --
I am working on an app that has been working well.
I am attempting to add
'CONNECT WITH THE CAMERA CAPTURE COMMANDS With Capture.CaptureCommands.Preview(Nothing) 'If the PREVIEW is ON If (.previewon = True) _ Then 'CHANGE THE CAMERA STATUS TRAFFIC SIGNAL pictureBox_LivePreviewTraffic.BackgroundImage = _ Image.FromFile( MacroDir & "\Traffic-Grn.jpg" ) Else 'CHANGE THE CAMERA STATUS TRAFFIC SIGNAL pictureBox_LivePreviewTraffic.BackgroundImage = _ Image.FromFile( MacroDir & "\Traffic-Red.jpg" ) End If End With
to the APP.
I find to support the
IMAGE.FROMFILE COMMAND
that I have to add
Imports System.Drawing
to the .IPP FILE for the PROJECT.
Unfortunately this seems to interfere with the
ANCHOR =
line that is commented out in the code below.
With Adjust.ImageCommands.Canvas(Nothing) ' .Anchor = Image.CanvasAnchor.TopLeft .Size = New System.Drawing.Size(MyImageWidth,MyImageHeight+(MyImageHeight*.2)) .Background = System.Drawing.Color.FromArgb(CType(255, Byte),CType(255, Byte),CType(255, Byte)) .AverageBackground = False .Visible = True .Run(doc1, image2) End With
I was able to patch this up with
'ADJUST THE CANVAS SIZE AND LEARN THE IMAGE INFO FOR THE NEW IMAGE Dim image2 With Adjust.ImageCommands.Canvas(Nothing) ' .Anchor = Image.CanvasAnchor.TopLeft .Anchor = 0 .Size = New System.Drawing.Size(MyImageWidth,MyImageHeight+(MyImageHeight*.2)) .Background = System.Drawing.Color.FromArgb(CType(255, Byte),CType(255, Byte),CType(255, Byte)) .AverageBackground = False .Visible = True .Run(doc1, image2) End With
because of the info within

Everything is working now but I am wondering if there is a better way to address / resolve what seems to be a conflict regarding the IMAGE in
.Anchor = Image.CanvasAnchor.TopLeft
that seems to be broken by
Imports System.Drawing
and the IMAGE in
Image.FromFile( MacroDir & "\Traffic-Grn.jpg" )
that is supported by
Imports System.Drawing
Thanks.
0
Best Answer
-
Hi Matt,
This is a namespace conflict, when the same property exists in different namespaces. One of the solutions to fix that is to use full namespace definition, e.g. "System.Drawing.Image.FromFile(...)" instead of adding "Imports System.Drawing".
Yuri
0
Answers
-
2019-10-11-090939Yuri --Thank you for your response and your guidance on this.I will implement your suggestion.-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions