Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:20:35+00:00 2026-06-14T18:20:35+00:00

I cannot find rigth namespace of that Image^ class I use CLI. It is

  • 0

I cannot find rigth namespace of that Image^ class I use CLI. It is from http://msdn.microsoft.com/en-us/library/aa970689.aspx that site. The problem is that microsoft does not publicated what I suppose to import, so I even do not know what class they have on their mind.

What include I suppose to add to make this work(Image class)?

Error   1   error C3083: 'Controls': the symbol to the left of a '::' must be a type    C:\Users\Duke\Documents\Visual Studio 2010\Projects\Jpg\Jpg\Jpg.cpp 9   1   Jpg
Error   2   error C2039: 'Image' : is not a member of 'System::Windows' C:\Users\Duke\Documents\Visual Studio 2010\Projects\Jpg\Jpg\Jpg.cpp 9   1   Jpg
Error   3   error C2871: 'Image' : a namespace with this name does not exist    C:\Users\Duke\Documents\Visual Studio 2010\Projects\Jpg\Jpg\Jpg.cpp 9   1   Jpg

    #include "stdafx.h"
    #include "Form1.h"
    #using <mscorlib.dll> //requires CLI
    using namespace System;
    using namespace System::IO;
    using namespace System::Windows::Media::Imaging;
using namespace System::Windows::Controls::Image;
        Stream^ imageStreamSource = gcnew FileStream("C:\Users\Duke\Desktop\heart.jpg", FileMode::Open, FileAccess::Read, FileShare::Read);

                JpegBitmapDecoder^ decoder = gcnew JpegBitmapDecoder(imageStreamSource, BitmapCreateOptions::PreservePixelFormat, BitmapCacheOption::Default);
                BitmapSource^ bitmapSource = decoder->Frames[0];//< --mamy bitmape
                // Draw the Image
                Image^ myImage = gcnew Image();
                myImage->Source = bitmapSource;
                myImage->Stretch = Stretch::None;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:20:36+00:00Added an answer on June 14, 2026 at 6:20 pm

    Given that you’re working with WIC classes (eg. BitmapDecoder and BitmapSource), you’ll want to avoid anything involving the System::Drawing namespace which is all old-school GDI. Either make no reference to those namespaces in your using directives, or explicitly use the whole System::Windows::Media namespace.

    The specific Image class you’re after is probably System::Windows::Controls::Image (docs here).

    You’ll need to add a reference to the WIC wrappers and a few supporting assemblies in your project in order to link to the appropriate DLLs.

    • PresentationCore has all of the main image codecs and manipulation classes that you want, this is mentioned in the JpegBitmapDecoder documentation.
    • WindowsBase is needed for a few additional dependencies used by the WIC wrappers (Freezable and DispatcherObject).
    • System.Xaml may also arise as a dependency… in a WIC-using C# project I have here, building without that assembly generates an error due to the absense of System.Windows.Markup.IUriContext. This may be an artefact of my use of the WIC assemblies, however (but I certainly make no use of Xaml nor IUriContext).
    • PresentationFramework provides the Image class and its dependencies, as mentioned in the appropriate documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my boss wants me to code an URLrewriting for, let's say http://our.domain.com/SomeText -- that
One of my problem is that I often cannot find the right information/documentation for
Cannot find any example on Google.
I cannot find any info on agner.org on the latency or throughput of the
I cannot find the solution for this problem, here is the simplified example: On
I cannot find a way to get a Book's Ratings through the Books API
I cannot find where the sqlcmd is? i just want the prompt. please help!
I cannot find a dictionary entry by key. I have an interface like the
I cannot find a simple example about my question above: how can i detect
I cannot find EntityConfiguration. The same question for RC was here but I thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.