(JavaScript API) LONGRANGE.Camera Image Dimensions

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
edwardtn
Posts: 33
Joined: Fri Aug 28, 2015 11:53 pm

(JavaScript API) LONGRANGE.Camera Image Dimensions

Post by edwardtn »

I am trying to define the resulting size of an image using the code below:

Code: Select all

var opts = {};
opts.enableVideo = false;
opts.saveToPhotoGallery = false;
opts.enableAnnotation = true;
opts.size = { width: "640", height: "480" };
I searched the forum and found a link to a page illustrating how to set the dimensions for a portrait vs. landscape image.

http://www.longrangemobile.com/docs/lrp ... /image.htm

Can this also be done through the LONGRANGE.Camera JavaScript API? Is there a way to specify .LD/.PT?
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: (JavaScript API) LONGRANGE.Camera Image Dimensions

Post by tsupartono »

Hi Edward,
Yes you can specify the landscape/portrait image dimension when using the JavaScript API.

The size.width and size.height properties have sub-properties "portrait" and "landscape".
You can specify both portrait and landscape value, or just either one (portrait or landscape, in which case the value of the other orientation will be derived).

Code: Select all

opts.size = { width: {landscape: "640"}, height: {landscape: "480"} };
The code above indicates that images should be resized to 640x480 when they are in landscape, and 480x640 when in portrait

The code below indicates that images should be resized to 300x200 for landscape, and 150x250 for portrait:

Code: Select all

opts.size = { width: {landscape: "300", portrait: "150"}, height: {landscape: "200", portrait: "250"} };
I'll also send you an updated JavaScript API guide that contains these properties.
edwardtn
Posts: 33
Joined: Fri Aug 28, 2015 11:53 pm

Re: (JavaScript API) LONGRANGE.Camera Image Dimensions

Post by edwardtn »

Thank you. I received your email. This works perfectly.

Regards,

Edward
Post Reply