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

  • SEARCH
  • Home
  • 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 7931839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:50:15+00:00 2026-06-03T20:50:15+00:00

My custom picture box contains a scrollviewer and an image. A dependecy property Image

  • 0

My custom picture box contains a scrollviewer and an image.
A dependecy property Image of type string is used to set the image.

public static DependencyProperty ImageProperty = DependencyProperty.Register(
"Image", typeof(string), typeof(CustomPictureBox), new FrameworkPropertyMetadata("", new  PropertyChangedCallback(OnImageChanged)));


private static void OnImageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
  CustomPictureBox cpb = (CustomPictureBox)d;
  if (e.Property == ImageProperty)
  {
    string newvalue = e.NewValue as string;
    if (!(string.IsNullOrEmpty(newvalue)))
    {
      var bmp = new BitmapImage();
      bmp.BeginInit();
      bmp.UriSource = new Uri(newvalue);
      bmp.CacheOption = BitmapCacheOption.OnLoad;
      bmp.EndInit();

      cpb.imgPicture.Source = bmp;
    }
    else
      cpb.imgPicture.Source = null;
  }
}

An image is acquired via frame grabber and stored to a given location with name “camera_image.tif”. The Image property is set to this filename.
When I start a new image acquisition, I set the Image property via binding to null and the picture box updates to show no image.
When the image acquisition is done, I set it to the “camera_image.tif” again. The problem is that the new image never shows up. Instead it is always the first acquired image that is displayed within the picture box. When I check the image file, it contains the new content.

How could I get the picture box to refresh the image?

Regards,

tabina

  • 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-03T20:50:17+00:00Added an answer on June 3, 2026 at 8:50 pm

    I found the answer here:

    Reloading an image in wpf
    and here.
    WPF Image.Source caching too aggressively

    bmp.CacheOption = BitmapCacheOption.OnLoad;
    bmp.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
    

    is the solution I was looking for!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a Picture box in a user control window(Windows custom control library). and
I am trying to create a custom dialog box that displays an image in
I'm using a custom view which has a background picture and is used to
I've built a custom component that basically has a picture box and label in
Morning all, I've created a custom control with an image property. That image property
I am using a custom control that inherits from a picture box to simulate
Custom string format to xml help needed. Java and C#. [Node(X)][CHILD0(Y)][OBJECT1(A)][Key1(1)][Key2(2)] [Node(X)][CHILD0(Y)][OBJECT1(B)][Key1(1)][Key2(2)][Key3(3)] [Node(X)][CHILD0(Y)][OBJECT1(C)][Key1(4)] [Node(X)][CHILD0(Y)][OBJECT2(A)][Key1(1)][Key2(2)][Key3(3)]
I'm trying to make a checkbox that has a custom check image. I need
I have made a custom control which consists of a richtextbox and a picture
For example if i have to create custom list view about type of food,

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.