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

WPF

 
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 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII7-Dec-09 6:32
fjparisIII7-Dec-09 6:32 
Insincere Dave wrote:
I would try changing the attached property RenderOptions.BitmapScalingMode and see if one of the modes eliminates the artifacts.


I tried this suggestion. Here is my first attempt with maxDestinationHeight set to 3008 and maxDestinationWidth set to 3008:

TransformedBitmap scaledBitmap = new TransformedBitmap();
if (maxDestinationHeight > 2900 || maxDestinationWidth > 2900)
{
    RenderOptions.SetBitmapScalingMode(scaledBitmap, BitmapScalingMode.HighQuality);
}
scaledBitmap.BeginInit();
scaledBitmap.Source = bitmapSource;
scaledBitmap.Transform = new ScaleTransform(scaleFactor, scaleFactor);
scaledBitmap.EndInit();

I actually tried all the values that IntelliSense suggested. Besides HighQuality, I also tried Fant (whatever that means), Linear, LowQuality, NearestNeighbor, and the last, Unspecified. All values produce exactly the same artifacts as as my code without an explicit SetBitmapScalingMode. I looked through the other attached properties in RenderOptions and only EdgeMode.Aliased suggested itself, but it also produced exactly the same aliases.

Then I tried the following code with all the BitmapScalingMode values, and every one of them produced exactly the same glaring artifacts.

TransformedBitmap scaledBitmap = new TransformedBitmap();
scaledBitmap.BeginInit();
scaledBitmap.Source = bitmapSource;
scaledBitmap.Transform = new ScaleTransform(scaleFactor, scaleFactor);
if (maxDestinationHeight > 2900 || maxDestinationWidth > 2900)
{
    RenderOptions.SetBitmapScalingMode(scaledBitmap.Transform, BitmapScalingMode.HighQuality);
}
scaledBitmap.EndInit();

Hopefully I'm doing something wrong that you can easily spot.
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 
GeneralRe: ScaleTransform sometimes produces glaring artifacts SOLVED!!! Pin
fjparisIII10-Dec-09 12:07
fjparisIII10-Dec-09 12:07 

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.