Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get a screenshot of the PropertyEditor control? DrawToBitmap not working

Solved!
Go to solution

Hi all,

When Display mode for PropertyEditor is set to TextAndPaintValue and DrawToBitmap is carried on (PropertyEditor.DrawToBitmap), only paint value is obtained in the image but text is lost. This happens in windows xp SP3. In windows vista and 7 it works ok. so is it a bug?

 

Thx.

 

 

0 Kudos
Message 1 of 25
(5,581 Views)

Hi,

 

I could not reproduce this issue in Windows XP. Attached is a bitmap I got from Windows XP. Could you post an example that does not work?

 

 

National Instruments
0 Kudos
Message 2 of 25
(5,546 Views)

Yes, but the case that you comment to me is the only case that is working, with colors there is no problem (I kwow that sources based on colors work perfectly), but have you checked with the following configuration? These configuration do not work.

 

Property Editor:

Object =>ScatterPlot

Source => LineStep

 

In the combobox, in windows xp, neither image for lineStep nor text (XYStep, YXStep, XYCentered, YXCentered)  are shown in the combobox. Combobox appears blank (empty). It is happening as well in other sources of property editor like the following:

 

Object => ScatterPLot

Source => LineStyle

 

This is only happening in Windows XP (Clean machine), and also in Windows XP (Service Pack 3). Later versions of Windows like vista, 7 and 8 are working without problems, that is, in the combobox, the image is shown and below it the text.

 

Thanks.

 

PD.: I'll try to post here a little example, a screenshot If I can.

ScatterPlot
0 Kudos
Message 3 of 25
(5,543 Views)

The property editor requires the NationInstruments.UI.Design.dll library to be distributed with the application. I was able to reproduce this only if I did not distribute the library with the application. In that case, I saw only the text on both Win XP and Win 7. After I moved that library to my target system, the image appeared fine both in the UI and in the bitmap. If you create a Setup project to distribute your application, the mstudiouidesign.2010.msm will be automatically detected and included.

 

Do you still see this behavior if you include the Design library with your distribution?

National Instruments
0 Kudos
Message 4 of 25
(5,514 Views)

Hi D_Biel,

 

As far as I know, we are distributing the application with the necessary NI libraries, that is:

 

-NationalInstruments.Common.dll => v8.6.35.131

-NationalInstruments.UI.dll => v8.6.35.189

-NationalInstruments.UI.WindowsForms.dll => v8.6.35.189

-NationalInstruments.Analysis.Enterprise.dll => v8.6.35.189

 

Also, the same libraries are added as references in the project when debugging and developing. Also, I think that distributing NationalInstruments.UI.dll, this library already contains what you say (NationInstruments.UI.Design.dll), right? When adding .NET references, I have not seen any NationalInstruments.UI.Design.dll. We are using NI Measurement 8.6.1. We are using Visual Studio 2010.

 

I am not sure if maybe it is happening because we host propertyeditor as a custom datagridview column in windows forms.

 

Have you checked this in a clean machine? We are not obtaining the same result in the developer machine than in a clean machine.
In a clean machine nothing is visible, neither image nor text. However, in the developer machine, image is displayed, but not the text.

 

Anyway, I'll contact with the person in my company who is in charge of creating the setup and I'll tell you something.

 

Cheers.

 

 

 

 

 

 

 

 

 

0 Kudos
Message 5 of 25
(5,499 Views)

You do not need to include NationalInstruments.UI.Design.dll in your project references because you are not directly referencing that library. However, it is a dependency of NationalInstruments.UI.dll when using certain controls. In this case, the PropertyEditor control does require it for the settings you are using. I did try this on a clean machine and found that I could only get it to work when the Design library was present.

National Instruments
0 Kudos
Message 6 of 25
(5,497 Views)

Hi,

I have checked that the setup for the application is distributed with the following libraries:

 

NationalInstruments.Analysis.Enterprise.dll

NationalInstruments.Common.dll

NationalInstruments.Common.Native.dll

NationalInstruments.UI.dll

NationalInstruments.UI.Styles3D.dll

NationalInstruments.UI.WindowsForms.dll

 

However, it is not working.

0 Kudos
Message 7 of 25
(5,437 Views)

Hi,

I checked that libraries were distributed with the application setup. After installing the application using the setup, the libraries (DLLs) I told you in the previous post are in the same directory where application is installed.

Also, sorry by my ignorance as I am not the person in charge to distribute the setup (I am not expert in creating installers) but are these libraries required to be placed in a concrete place in order images below text to be displayed correctly? I have a doubt: Is it necessary that the assemblies (Not dll) to be placed in \Windows\Assembly directory? I have observed that following assemblies are not in this directory:

 

NationalInstruments.UI

NationalInstruments.UI.Design

NationalInstruments.UI.Styles3D

NationalInstruments.UI.WindowsForms

 

but they are in my machine development.

 

Please, I would highly appreciate if you can help me since I have not had news from you.....

0 Kudos
Message 8 of 25
(5,421 Views)

These assemblies are typically installed to the application directory, but can also be installed to the GAC. Either is fine, so long as the application can locate them. And all of the assemblies don't need to be in the same location necessarily.

 

If these assemblies are present in the correct location, then you must be facing a different issue than I had thought. Could you create a fusion log for your application and send it to me? You can find instructions on how to generate the logs here. Fusion logs are helpful to determine if there was an issue loading a particular assembly.

National Instruments
0 Kudos
Message 9 of 25
(5,417 Views)

Hi,

I think National Instruments UI Design is failling. NationalInstruments.Common.DLL seems to work. So how to solve it? See below:

 

*** Assembly Binder Log Entry  (11/21/2012 @ 3:47:29 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files\MyAppDir\MyAppDir.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = VMENGWINDOWS7\VMENGWINDOWS7x86
LOG: DisplayName = NationalInstruments.UI.Design, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/MyAppDir/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyAppDir.exe
Calling assembly : System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\MyAppDir\MyAppDir.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: NationalInstruments.UI.Design, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).

---------------------------------------------------------------------------------------------------------------------------------------------

*** Assembly Binder Log Entry  (11/21/2012 @ 3:47:28 AM) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files\MyAppDir\MyAppDir.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = VMENGWINDOWS7\VMENGWINDOWS7x86
LOG: DisplayName = NationalInstruments.Common, Version=8.6.35.419, Culture=neutral, PublicKeyToken=18cbae0f9955702a
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/MyAppDir/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyAppDir.exe
Calling assembly : NationalInstruments.UI, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\MyAppDir\MyAppDir.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: NationalInstruments.Common, Version=8.6.35.419, Culture=neutral, PublicKeyToken=18cbae0f9955702a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/MyAppDir/NationalInstruments.Common.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\MyAppDir\NationalInstruments.Common.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: NationalInstruments.Common, Version=8.6.35.419, Culture=neutral, PublicKeyToken=18cbae0f9955702a
LOG: Binding succeeds. Returns assembly from C:\Program Files\MyAppDir\NationalInstruments.Common.dll.
LOG: Assembly is loaded in default load context.

0 Kudos
Message 10 of 25
(5,409 Views)