This is a migrated thread and some comments may be shown as answers.

Loading images from stream/bitmap (not via url)

1 Answer 433 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Yngve
Top achievements
Rank 1
Yngve asked on 21 Apr 2017, 02:01 PM

Hi,

 

I was wondering if there's an option to load images in a Kendo Diagram without the use of referencing a URL, as is done here:

g.append(new dataviz.diagram.Image({
            source: "../content/dataviz/diagram/people/" + dataItem.image,
            x: 3,
            y: 3,
            width: 68,
            height: 68
          }));

 

Is it possible to load it via a bitmap or stream and pass it from the controller onto the view?

 

 

 

 

d

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 25 Apr 2017, 10:52 AM
Hi Yngve,

The Image source can also be a data URI containing a base64-encoded image:
http://dojo.telerik.com/@tsveti/ilAKiP/2

So, if you have the image on the server as a byte array, you could convert it to base64 format and return it to the view to use in the Diagram.

Regards,
Tsvetina
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Diagram
Asked by
Yngve
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or