View Issue Details

IDProjectCategoryView StatusLast Update
0000916NoesisGUIC++ SDKpublic2023-08-03 04:07
Reporterheinrichdutoit Assigned Tojsantos  
PrioritynormalSeverityminor 
Status feedbackResolutionopen 
Product Version1.2.6f3 
Target Version3.0 
Summary0000916: Black lines between elements in Canvas
Description

When using either a Rectangle or Border to display elements from a collection within a Canvas black lines appear between the elements even if the elements are next to each other.

Steps To Reproduce

<Style x:Key="MapView_Style" TargetType="{x:Type ItemsControl}">
<Style.Resources>
<GainConverter x:Key="GainConverter" />
</Style.Resources>
<Setter Property="ItemsPanel" >
<Setter.Value>
<ItemsPanelTemplate>
<Canvas ClipToBounds="False" Margin="0,0,0,0" UseLayoutRounding="False">
</Canvas>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate" >
<Setter.Value>
<DataTemplate>
Width}" Height="{Binding Height}" UseLayoutRounding="False" Margin="0"/>

                    <Rectangle  Width="{Binding Width}" Height="{Binding Height}" UseLayoutRounding="False" Margin="0">
                        <Rectangle.Fill>                            
                              <ImageBrush ImageSource="{Binding TextureSource}" Stretch="Fill"/> 
                              <ImageBrush ImageSource="cpps.jpg" Stretch="Fill" />   
                        </Rectangle.Fill> 
                    </Rectangle>

            </DataTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle" >
        <Setter.Value>
            <Style>
                <!-- <Setter Property="Canvas.Left" Value="{Binding Path=X1, Converter={StaticResource GainConverter}, ConverterParameter=1}"/>
                <Setter Property="Canvas.Top" Value="{Binding Path=Y2, Converter={StaticResource GainConverter}, ConverterParameter=-1}"/> -->
                <Setter Property="Canvas.Left" Value="{Binding Path=X1}"/>
                <Setter Property="Canvas.Top" Value="{Binding Path=Y2, Converter={StaticResource GainConverter}, ConverterParameter=-1}"/>
                <!-- <Setter Property="UseLayoutRounding" Value="False"/> -->
            </Style>
        </Setter.Value>
    </Setter>
</Style>
Attached Files
PlatformAny

Relationships

related to 0001291 resolvedsfernandez Textures rendering issues (unexplainable seams) 

Activities

stonstad

stonstad

2019-03-06 18:30

reporter   ~0005505

Example of similar behavior using an ImageBrush. The thinking around this is that tiled image pixels are wrapping along the x-axis, despite a 1:1 correspondence between rectangle width and source image width.

screenshot1.png (162,865 bytes)   
screenshot1.png (162,865 bytes)   
Sample.zip (49,479 bytes)
nokola

nokola

2019-03-07 03:21

reporter   ~0005509

I have noticed similar issue, reproduces only on iPhone X for me

jsantos

jsantos

2019-03-07 17:16

manager   ~0005512

Last edited: 2019-03-07 17:23

This is a different issue. I am able to reproduce the same behavior in WPF. Changing the TileMode to None makes the line disappear although that's not a valid solution...

ai_enabled

ai_enabled

2023-07-05 01:11

updater   ~0008585

I also have the same issue (also using 9-patch image approach so it can be stretched in any direction to fit the contents). Please see the screenshot (the issue is a thin orange line above each of the two buttons) https://drive.google.com/file/d/1v3x_0bZNeprDaMQqohpE6y5w2-apLdeX/view?usp=sharing

Is there any workaround?

I wish we can just disable the texture wrapping in one direction—perhaps you can add a NoesisGUI XAML extension for this purpose? Something like this:


noesis:TextureWrapDirection="WrapU"

with the options: WrapU/WrapV/WrapUV

Regards!

P.S. Cannot attach a file due to "Server responded with 0 code" when I submit the message.

jsantos

jsantos

2023-07-06 11:37

manager   ~0008590

Vladimir, could you attach a minimal XAML reproducing the issue for your scenario?

I will revisit this again as soon as possible.

ai_enabled

ai_enabled

2023-07-26 00:44

updater   ~0008610

Last edited: 2023-08-03 04:07

Hi Jesús,
please see the attached sample WPF app.
Using "UseLayoutRounding" makes the issue much less apparent in WPF, but it's still highly noticeable in NoesisGUI even with this setting enabled (and the issue is getting much worse when MSAA is disabled).

The long horizontal line on top and bottom of the button is caused by the texture wrapping around. Hence I've suggested an extension property to restrict texture wrapping ("clamp" render mode). As a workaround for these horizontal lines I'm using RenderOptions.BitmapScalingMode="NearestNeighbor" and simply stretching the texture instead of tiling it (this way wrapping never happens). It's not a good solution but better than seeing these odd lines caused by wrapping.

Regards!

WpfApp9PatchImage.7z (42,845 bytes)

Issue History

Date Modified Username Field Change
2016-06-22 10:38 heinrichdutoit New Issue
2016-06-28 18:46 sfernandez Assigned To => sfernandez
2016-06-28 18:46 sfernandez Status new => assigned
2016-06-28 18:46 sfernandez Target Version => 1.2.6f6
2018-11-01 02:14 jsantos View Status public => private
2018-11-21 13:17 jsantos Assigned To sfernandez => jsantos
2018-11-21 13:17 jsantos Target Version 1.2.6f6 => 2.2.0
2018-11-21 13:17 jsantos View Status private => public
2018-11-21 13:17 jsantos Platform => Any
2019-03-06 18:03 jsantos Relationship added related to 0001291
2019-03-06 18:30 stonstad File Added: screenshot1.png
2019-03-06 18:30 stonstad File Added: Sample.zip
2019-03-06 18:30 stonstad Note Added: 0005505
2019-03-07 03:21 nokola Note Added: 0005509
2019-03-07 17:16 jsantos Note Added: 0005512
2019-03-07 17:23 jsantos Note Edited: 0005512
2019-03-18 22:09 sfernandez Target Version 2.2.0 => 2.2.1
2019-04-05 12:03 sfernandez Target Version 2.2.1 => 2.2.2
2019-04-30 10:14 sfernandez Target Version 2.2.2 => 2.2.3
2019-06-18 16:54 sfernandez Target Version 2.2.3 => 2.2.4
2019-08-26 15:25 jsantos Target Version 2.2.4 => 2.2.5
2019-12-30 10:33 sfernandez Target Version 2.2.5 => 3.0.0
2020-05-08 12:29 jsantos Target Version 3.0.0 => 3.0
2023-07-05 01:11 ai_enabled Note Added: 0008585
2023-07-06 11:37 jsantos Note Added: 0008590
2023-07-06 11:37 jsantos Status assigned => feedback
2023-07-26 00:44 ai_enabled Note Added: 0008610
2023-07-26 00:44 ai_enabled File Added: WpfApp9PatchImage.7z
2023-08-03 04:07 ai_enabled Note Edited: 0008610