0

I have a wpf application that displays a bitmapImage in an image control that is inside a viewbox. I use binding to set the image to a bitmapImage object that I create within the code. After creating the bitmapimage, I call OnPropertyChanged to get the image to update. For some reason, when rendered, a line appears through the colored part of my image. I also save the image to disk and it looks fine with no line, so it seems that I am drawing it correctly. I notice the line is affected when I play with RenderOptions.BitmapScalingMode. The line barely appears in high quality so it seems to improve things but I can still barely see the line though (see links to pics below). I am wondering if anyone knows any other settings I should look at?

Note: also tried Also tried SnapsToDevicePixels="True" on the viewbox and UseLayoutRounding="True"

Low Quality

High quality

Exported Image

Tried setting: RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

Tried RenderOptions.SetEdgeMode(m_detectedSampleImage, EdgeMode.Aliased). No luck

UPDATE: Looking at the exported image in the web browser, I do see the line. But when looking at the exported image in ImageJ, I do NOT see the line!

3
  • Can you add your original image to your question? There must be a small white line in it that the scaling algorithm picks up. Commented May 25, 2023 at 23:21
  • Added the exported image. Its interesting I see the line in the web browser. I was looking at it in ImageJ originally and it looked fine... hmmm Not sure what to make of that Commented May 26, 2023 at 9:40
  • 1
    It is unclear what your exact question is now. The line is obviously part of the bitmap, so you won't get rid of it by any RenderOptions. Just fix the image and consider deleting the question. Commented May 26, 2023 at 13:27

1 Answer 1

0

Looking at the image in the browser it appears the line is there. Seems ImageJ did a good job of hiding it which is weird because ImageJ displays it bigger by default. Anyway, back to the beginning to make sure I'm drawing the bitmap correctly

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.