Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, May 8, 2017 2:03:48 PM(UTC)
huey.hoague

Groups: Registered
Posts: 18


Hadi you are the man!! that gets me into the neighborhood I needed to get to for my viewer. I do still need to crack the get image from stream instead of the imageViewer.imageUrl = "put image here";
I am looking at the HttpContent code you put below to see if I can figure out how to load that to the imageViewer
Since this pretty much covers the partial view question, do you want to answer the image from stream in html5 or put that in a new thread.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, May 9, 2017 8:40:29 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 218

Was thanked: 12 time(s) in 12 post(s)

Huey,

I have created a new topic with your new question since it is a new issue and will answer you here

Thanks,
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Tuesday, May 9, 2017 2:39:21 PM(UTC)
huey.hoague

Groups: Registered
Posts: 18


Okay thanks - I have looked at the
imageViewer.Image = new StreamContent(image stream here);

I have seen the canvas properties and other properties of the imageViewer. None are showing an obvious way to load a binary array or stream to.
 
#4 Posted : Thursday, May 11, 2017 12:58:19 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 218

Was thanked: 12 time(s) in 12 post(s)

Sorry for the delay on replying to this as I was doing some research into seeing how this would be possible to send a Stream from the server to the client to display in the Image Viewer control.

In order to achieve this you have 2 different methods to do so:

1. Write a separate controller method to base64 the data (slow)
2. Use some javascript magic to request the data differently

In order to do the second option you will have to use XMLHttpRequest instead, which is a pretty complicated subject since its features vary from browser to browser. You have to get the result as an ArrayBuffer, then figure out the mimetype for png/gif/jpeg/svg from the data, and create a Base64 string or Data URI to set into your image. That can branch off to a lot of different scenarios really quick.

We have the Leadtools.ImageLoader class just for this in JavaScript. It allows you to load images in three separate ways – regular URL in an SRC, Ajax, or Ajax to XML (for SVG). You want Ajax to Data URL.
You can see this in the documentation: https://www.leadtools.co...cript/l/imageloader.html
Specifically, see the table here on how AjaxDataUrl works: https://www.leadtools.co.../imageloaderurlmode.html
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
#5 Posted : Thursday, May 11, 2017 2:34:27 PM(UTC)
huey.hoague

Groups: Registered
Posts: 18


So the HTML5 Image Viewer can only show normal web images? I have a tiffs I need to show. I know I can do a convert to PNG or something but one of the things I have always liked about Leadtools is we usually can use with Tiffs.

Right now the priority is to show what your product can do, I can deal with complicated faster methods once we have product in house but if the base64 method is easier to design and get working I am all for it. I am actually getting a base 64 image from the service and may just pass that on to the ImageLoader. I will need to convert to png and then convert the image to base 64 if Tiffs can not be shown. I need to set some property to mime type
and then set some other property to the base 64 image and then call the run method of the ImageLoader. I then set the ImageView image property to the element property of the ImageLoader. I am still having issues with your help pages so am not absolutely sure which properties these are that would be set with these values.

As a side not my business only IE11 right now and within a year will be Edge for anybody with windows 10 and then IE11 for everyone else. So I will not need to worry about odd browsers.
 
#6 Posted : Friday, May 12, 2017 9:59:38 AM(UTC)
huey.hoague

Groups: Registered
Posts: 18


Hey I got image loaded from base64 image
Right now to show demo I loaded the base64 string in a file in my resources. in my home controller I set this value to a ViewBag field
ViewBag.image = LEADTOOLS_Partial_View_Demo.Properties.Resources.tiff_base64;

In the index.cshtml I added a button
<li><input type="button" value="LoadNew" onclick="LoadNew('@ViewBag.image')"></li>

In the View.js I added a LoadNew function
function LoadNew(stuff)
{

// Load an image in the viewer
imageViewer.imageUrl = stuff;
}

that gets me home. Thanks for your help.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.113 seconds.