Click here to Skip to main content
15,887,214 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF Ribbon bar issue Pin
trey white7-Dec-09 8:35
trey white7-Dec-09 8:35 
AnswerRe: WPF Ribbon bar issue Pin
trey white7-Dec-09 11:09
trey white7-Dec-09 11:09 
QuestionError in RoutedEventHandler() Pin
Anu_Bala7-Dec-09 0:04
Anu_Bala7-Dec-09 0:04 
QuestionUsing WPF Browser application in website. Pin
Hema Bairavan6-Dec-09 18:02
Hema Bairavan6-Dec-09 18:02 
QuestionSimple templated grid row. Pin
Dunge6-Dec-09 9:21
Dunge6-Dec-09 9:21 
QuestionScaleTransform sometimes produces glaring artifacts [modified] Pin
fjparisIII5-Dec-09 13:47
fjparisIII5-Dec-09 13:47 
AnswerRe: ScaleTransform sometimes produces glaring artifacts [modified] Pin
Insincere Dave6-Dec-09 13:55
Insincere Dave6-Dec-09 13:55 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII6-Dec-09 14:35
fjparisIII6-Dec-09 14:35 
Insincere Dave wrote:
I don't complete understand the situation


Do you mean the situation in my application? The user invokes my image scaling operation, supplying me with a bitmap of a photograph. He specifies a pixel rectangle into which to scale the supplied image. He's supplying an image from his camera so the image could be anything up to 6000 pixels on a side. But my scaling function is intended to scale the image down for 1:1 viewing on conventional monitors, so something smaller than 2600 pixels on a side. ScaleTransform has no problem with scaling down to that size. But one of my beta customers wanted to scale from 4288 to 3008, and all hell broke loose.

Insincere Dave wrote:
are you enlarging or shrinking the images?


Well, as you could see from my attached data, I was doing both. I can push things where artifacts appear for both enlarging or shrinking the images. However, the boundaries where the artifacts appear are outside of the documented purpose of my application. Therefore in my own testing I never ran into the problem. Only when one of my beta testers "pushed the envelope" as described above did the problem arise. I then set about to characterize the problem, which the six tests I document tries to do.

In previous years, I wrote a version of my current application in MFC/GDI+ that does not have this problem, and of course Photoshop doesn't have the problem. It' only when I try to scale an image into a box larger than 2900Hx2900W when the input image is larger than that box that artifacts occur. The scaled images are completely clean as long as they fit within that box. If the image exceeds that box by even 4 pixels in either width or height, the artifacts suddenly appear, and they're glaring.

If the default for .NET 4.0 was changed to improve performance, this sounds like the default for 3.5 was HighQuality and the default for 4.0 is LowQuality, which to me would be a step backwards. I'm using 3.5. I couldn't actually see from the MSDN documentation what the default is.


Insincere Dave wrote:
You may want to post a picture too.



You mean the scaled output? I didn't know you could post pictures on this site. Can you? If so, how? Or do you mean post a Web link outside of this forum to a scaled image with the artifacts I'm generating? The scaled images with artifacts have large blotches of solid color, sometimes in parallel stripes running in various directions, and the colors seemingly have no relationship to the underlying color. In fact, the underlying colors may involve gradients, but the artifacts are single-color, solid blotches.

EDIT: The above paragraph was written from my faulty memory of what the artifacts look like. I have one of the images before me right now and can give a more accurate description (not that this is going to provide any additional insight):

The scaled images with artifacts have large, irregular blotches consisting of closely spaced vertical lines in a color that seems unrelated to what the real color should be. For example: closely spaced vertical lines of bright green where smooth yellow gradients should be, and closely spaced vertical lines of bright cyan where caucasian skin color should be. There are large extents of the image that have no artifacts at all in them, but from looking at the image, I can't determine what might be causing artifacts to appear in some places and not in others. The larger the input image, the greater the extent of the artifacts in the corresponding scaled image.
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII7-Dec-09 6:32
fjparisIII7-Dec-09 6:32 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
Insincere Dave7-Dec-09 13:43
Insincere Dave7-Dec-09 13:43 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII7-Dec-09 14:46
fjparisIII7-Dec-09 14:46 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
Insincere Dave7-Dec-09 16:30
Insincere Dave7-Dec-09 16:30 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII8-Dec-09 7:15
fjparisIII8-Dec-09 7:15 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII9-Dec-09 4:54
fjparisIII9-Dec-09 4:54 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
Insincere Dave9-Dec-09 6:19
Insincere Dave9-Dec-09 6:19 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII9-Dec-09 7:20
fjparisIII9-Dec-09 7:20 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII9-Dec-09 9:20
fjparisIII9-Dec-09 9:20 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
Insincere Dave9-Dec-09 9:48
Insincere Dave9-Dec-09 9:48 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII9-Dec-09 10:01
fjparisIII9-Dec-09 10:01 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
fjparisIII9-Dec-09 11:05
fjparisIII9-Dec-09 11:05 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
Insincere Dave9-Dec-09 14:58
Insincere Dave9-Dec-09 14:58 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
fjparisIII9-Dec-09 15:16
fjparisIII9-Dec-09 15:16 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
Insincere Dave9-Dec-09 15:29
Insincere Dave9-Dec-09 15:29 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
fjparisIII10-Dec-09 7:35
fjparisIII10-Dec-09 7:35 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
Insincere Dave10-Dec-09 8:27
Insincere Dave10-Dec-09 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.