Developer forum

Forum » Templates » How to get focal point in PageViewModel?

How to get focal point in PageViewModel?

Daniel Hansen
Reply

I have a problem not being able to get the imagepath with the selected focal point in a pageviewmodel. How do i get access to the focal point values? 


Replies

 
Lars Larsen
Lars Larsen
Reply

Hi Daniel

Have you checked out this thread?

 
Daniel Hansen
Reply

Hi Lars, 

Yes i have been looking at the current thread - but did not find the answer. 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Daniel

The pageview model it self does not have any images. So you probably have an item on that page where you have a field which is of type file which has an image with a focal point?

Then you have to get a "FileViewModel" which you can do something like this:

PageView.Item.GetFile("MyImage").GetFocalPointParameters()

See the fileviewmode https://doc.dynamicweb.com/api/html/19e8ec30-927a-32fa-dade-9b2fecb63ac3.htm

BR Nicolai

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Do you think it would be useful to also add Width and Height properties/methods to the FileViewModel ?

Might be useful to know original file properties when resizing images.

Thank you,

Adrian 

 
Nicolai Pedersen
Reply

Hi Adrian

It will come with a performance hit, so I would rather not implement that feature as it is not needed very often.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Understood.

Thank you very much.
Adrian

 

You must be logged in to post in the forum