Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 删除图像的边框_Silverlight - Fatal编程技术网

Silverlight 删除图像的边框

Silverlight 删除图像的边框,silverlight,Silverlight,我想删除单击图像时显示的图像边框。 **<Image x:Name="ImagePresenter" Source="{StaticResource IconDocument}" />** <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" R

我想删除单击图像时显示的图像边框。

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>
****

将图像添加到Silverlight用户控件只会导致图像不显示边框

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>
Xaml:

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>


我想这对你没有帮助。你能不能在你的问题中再详细一点,看看我能不能找到更好的答案?

我不太清楚你的问题,因为silverlight不会在图像中添加任何边框,除非代码中有提示

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>
尝试将StrokeThickness设置为零。(如果需要,修改模板以将strokethickness设置为零)

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>

希望这有帮助

是的,默认情况下,图像没有边框。因为我定义的样式中有两列,所以它为每一列创建了两个矩形(一个用于文本块,另一个用于图像)。为了解决这个问题,我使用了一列定义,并且成功了。:)

**<Image x:Name="ImagePresenter"  Source="{StaticResource IconDocument}"  />**

          <Rectangle x:Name="focusElement" Opacity="0" Stroke="{StaticResource color_506_brush}" StrokeThickness="1" IsHitTestVisible="False" RadiusX="4" RadiusY="4"/>
        </Grid>
      </Grid>
    </ControlTemplate>
  </Setter.Value>
</Setter>

本机映像没有边框。看起来您是指由上面发布的ControlTemplate部分定义的控件。我们需要看到更多有用的东西