Welcome to the Xceed Community | Help
Community Search  
More Search Options

Image scaling in TableflowView and CardView

Sort Posts: Previous Next
  •  06-14-2010, 8:24 AM Post no. 27157

    Image scaling in TableflowView and CardView

    Is there a way to prevent image scaling in TableflowView and especially in CardView? My application uses a webservice to retrieve the data and the server makes sure the images are scaled to the correct size. Before upgrading to version 4 prof I used the TableView and the image column showed the image with just a little margin and changed the height of the row accordingly, seems like the TableflowView behaves differently here.

    And when using the CardView, I want the user to be able to change the width of the cards but then the images are just scaled up. The result is that the cards become way too big and the images become blurry.

  •  06-14-2010, 10:30 AM Post no. 27160 in reply to 27157

    Re: Image scaling in TableflowView and CardView

    My first suspicion would be that it has something to do with the Horizontal/VerticalContentAlignment properties for the card control template but I don't know what xaml you could play with to get at that.

    Alain
  •  06-15-2010, 2:21 PM Post no. 27177 in reply to 27160

    Re: Image scaling in TableflowView and CardView

     Our default viewer for images in CellContentTemplate gives the image all the place that it could get.
    In order to change that, you can redo the CellContentTemplate's DataTemplate.

    Here's an example that redoes the cell content template to a String field that contains a URL to the image, it sets the StretchMode to "None" which simply stops the stretching and achieves the behavior you need:  

     <xcdg:DataGridControl.Columns>

                    <xcdg:Column   FieldName="ImageURL"

                                 Title="Image">

                        <xcdg:Column.CellContentTemplate    >

                            

                            <DataTemplate>

                                <Image Stretch="None" SnapsToDevicePixels="True"

                                       x:Name="Image1" 

                                       Source="{xcdg:CellEditorBinding }" />

                            </DataTemplate>

                        </xcdg:Column.CellContentTemplate>

                    </xcdg:Column>

                </xcdg:DataGridControl.Columns>

    By default our viewer in CellContentTemplate are taking all the place he have.
    But you can set and CellContentTemplate you want.  So you can make one that will not resize your image ... etc.


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
  •  07-02-2010, 8:59 AM Post no. 27384 in reply to 27177

    Re: Image scaling in TableflowView and CardView

    Thanks very much for that Michel, will give this a try later today - sorry for the late reply I was on holiday :)
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.