Ticket T473527
Visible to All Users

Loading Scalable Vector Graphic (SVG) images in PictureEdit Control

created 8 years ago (modified 7 years ago)

How do I load SVG type images into the DevExpress PictureEdit Control? I've searched documentation and I can't find any samples on how to do it.
Many Thanks.

Answers approved by DevExpress Support

created 8 years ago (modified 6 years ago)

Hello Mark,
Updated
_____________________________________________________________________________________
----------------------------------------------------------------------------------------------------------------------------------------------
In recent versions,PictureEdit supports displaying SVG images out of the box. To display an SVG image, it is enough to assign the SVG image to either the SvgImage or  EditValue property.
_____________________________________________________________________________________
----------------------------------------------------------------------------------------------------------------------------------------------

SVG images can be loaded and converted to the Image type using our classes. For example, the following code loads the "sample.svg" image and assigns it to a PictureEdit:

C#
var svgBitmap = DevExpress.Utils.Svg.SvgBitmap.FromFile("sample.svg"); Image img = svgBitmap.Render(null, 1.0D); pictureEdit1.Image = img;

I've attached a simple project demonstrating how it works. Note that v16.2 is required since we added SVG support in this version.

I hope you find this information useful.

    Comments (2)
    MB MB
    Mark Bissett 2 8 years ago

      That's great Andrew. I'll give this a test once I migrate to 16.2.
      Many thanks for your quick response and the sample.

      Andrew Ser (DevExpress Support) 8 years ago

        You are welcome, Mark! Feel free to reactivate this ticket if you have any further questions.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.