WPF DICOM Viewer Question

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
Harwold Groy
Posts: 2
Joined: Mon Apr 08, 2024 2:48 am

WPF DICOM Viewer Question

Post by Harwold Groy »

Hello~

In my wpfDicomviewer prj,

I did just modify short "logo" in the WpfAboutBoxBaseWindow.xaml.

(Replaced with exactly same .png file with VintaSoft logo.png pixel and file size) (Same png folder location in RESOURCE in WpfDemosCommonCode)

and then run in VS...

Any logo did not shown up.

(Even I've tried to same VintaSoft logo only change vintasoft logo's name and tried VintaSoft name and logo itself for recover)

And in the WpfAboutBoxBaseWindow.xaml.cs (This is my question...)

===============================================================================================================================

Code: Select all

public partial class WpfAboutBoxBaseWindow : Window
{

    #region Constructors

    public WpfAboutBoxBaseWindow()
    {
        InitializeComponent();
    }

    public WpfAboutBoxBaseWindow(string productPrefix)
        : this()
    {
        nameLabel.Content = string.Format(nameLabel.Content.ToString(), AssemblyTitle, AssemblyShortVersion);
        imagingSDKVersionLabel.Content = string.Format(imagingSDKVersionLabel.Content.ToString(), ImagingSDKVersion);
        productLinkLabel.Text = string.Format(productLinkLabel.Text.ToString(), productPrefix);
    }
Some " InitializeComponent();", "imagingSDKVersionLabel" and some mores....
Red underlined~~~Ex) The name "nameLabel" does not exist in the current context
But I did not mistyped or mistake except image replacing~~

Can anyone help me?
Of course "using ~~~~" are all same~
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

Re: WPF DICOM Viewer Question

Post by Alex »

Hello,

Please do the following steps:
  • Run Visual Studio.
  • Open VintaSoft DICOM Viewer Demo project ("[SdkInstallPath]\VintaSoft\Imaging .NET v12.4\Examples\WPF\CSharp\WpfDicomViewerDemo\WpfDicomViewerDemo.Net8.csproj") in Visual Studio.
  • Click the "WpfAboutBoxBaseWindow.xaml" and you will see "About" dialog in WPF designer.
  • Click on logo image and you will see XML markup for logo image:

    Code: Select all

    <Image Name="vintasoftLogoImage" HorizontalAlignment="Center" VerticalAlignment="Center" MouseDown="Image_MouseDown" Cursor="Hand" Source="{StaticResource VintasoftLogo}"/>
    
    Logo image uses static resource "VintasoftLogo":

    Code: Select all

        <Window.Resources>
            <BitmapImage x:Key="VintasoftLogo" UriSource="Resources/VintasoftLogo.png" />
        </Window.Resources>
    
Best regards, Alexander
Harwold Groy
Posts: 2
Joined: Mon Apr 08, 2024 2:48 am

Re: WPF DICOM Viewer Question

Post by Harwold Groy »

Thank you for reply.
Excuse me but...

<Border x:Name="VintasoftLogo1" BorderBrush="Black" BorderThickness="1">

"VintasoftLogo1" is correct default?

Changed to "VintasoftLogo" is failed.

And for the "VintasoftLogo1", does not appear any my own logo~ picture.

Can you check it in your code?

I mean...

a)actual logo image => tried my own logo (failed to disply)+ vintasoft logo
(If changed file name, failed/keep original name? Succeeded vinta logo display)

b)name : Exactly same with "VintasoftLogo" but not sure <Border x : ~~~VintasoftLogo"1"?~~~~~>
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

Re: WPF DICOM Viewer Question

Post by Alex »

Hello,

Please do the following steps:
  • Open PNG file "[SdkInstallPath]\VintaSoft\Imaging .NET v12.4\Examples\WPF\CSharp\WpfDicomViewerDemo\WpfDemosCommonCode\Resources\VintasoftLogo.png" in any image editor and change image, for example, flip image vertically.
  • Run Visual Studio.
  • Open origonal version of VintaSoft DICOM Viewer Demo project ("[SdkInstallPath]\VintaSoft\Imaging .NET v12.4\Examples\WPF\CSharp\WpfDicomViewerDemo\WpfDicomViewerDemo.Net8.csproj") in Visual Studio.
  • Compile and run the project.
  • Open "About" dialog and you will see that logo image is changed.
Test above shows how to change logo image in About dialog.

The "About" dialog is WPF dialog will source codes. If you want to change the dialog, please open it in WPF editor and change the dialog layout - this is custom programming operation and you need experience in WPF programming.

Best regards, Alexander
emmayashri
Posts: 1
Joined: Thu Apr 18, 2024 10:22 am

Re: WPF DICOM Viewer Question

Post by emmayashri »

Hey hi, please double check that the nameLabel element is correctly defined in your XAML and that its name matches the one used in your code-behind file.
Post Reply