Discussion Forums  >  Images, Documents, File Locations

Replies: 11    Views: 148

bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
04/27/12 12:30 PM (13 years ago)

Different image sizes in custom HTML - iPhone vs iPad

Hi guys! Been searching the forums and browsing the best I can - but can't seem to find an answer to this; I have (several) custom HTML screens. I'd like to display a larger image on the ipad than on iPhone / Android. Is there a way to achieve this? Thanks! B
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/27/12 12:58 PM (13 years ago)
By retrieving device data then having the code choose accordingly. Or by having the HTML scale according to screen size.
 
bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
like
04/27/12 01:58 PM (13 years ago)
Thanks Fred :) Ive been googling around abit trying to find some examples - and not sure if the cache is fooling me, but nothing seems to happen. this is what I'm trying; <img alt="" src="ins-bille-640.png" style="max-width: 100%; max-height: 100%;"/> or <img alt="" src="ins-bille-640.png" "width: 100%;"/> Wouldn't that suffice? Best regards Bernt
 
bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
like
04/27/12 02:10 PM (13 years ago)
double post ---
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
04/27/12 06:18 PM (13 years ago)
You must be reading my mind. I'm working on a tool right now that will allow separate html files to be used in a "html doc" screen for iphone vs ipad. I had a successful test last night, and I'm documenting it as we speak. I know its somewhat redundant to have 2 different html doc sources, but the simplest case, you can duplicate the html doc and just change the image names. Or if you're real fancy, you can totally optimize a separate html doc for each device. If this is something you're interested in, I should have something ready tonight or tomorrow.
 
bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
like
04/27/12 10:28 PM (13 years ago)
Hei Stobe and Fred The above example did work. the "Width: 100%" styling did the trick. Now Im playing around with PNG overlays for framing in JPGs as the size is 1 / 10th from a PNG. Stobe. I'll be happy to check out the docs. (pure newbie here) B
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
04/28/12 12:14 PM (13 years ago)
hey guys, im having trouble putting images in my html docs, where do store the images, like which folder? and how do i write the code in html for example you put: <img alt="" src="ins-bille-640.png" style="max-width: 100%; max-height: 100%;"/> so if i have my images in bt_images, what do i write
 
bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
like
04/28/12 09:44 PM (13 years ago)
Ceerup - you dont need to specify placement as long as it resides within bt_images (or a subfolder). Just use the image name. And <img alt="" src="ins-bille-640.png" "width: 100%;"/> is sufficient. Best regards B
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
04/28/12 09:51 PM (13 years ago)
bern, thank you...what does the width 100% do? also do you know what folder i should store my header image picture in
 
bernienor
Lost but trying
Profile
Posts: 23
Reg: Dec 01, 2011
Oslo
530
like
04/30/12 07:34 AM (13 years ago)
Hi Ceerup, It scales the image depending on the width of the browser. That way it can support iPad and iPhone using the same image, just scaled automatically. This is for iOS. Im running into trouble with Android, so dont take my word for it on that platform. I assume header images (never used them) are to be placed in the same folder as everyt other image you use. Hope it helps! Bernt
 
sxywebgirl
Aspiring developer
Profile
Posts: 158
Reg: Apr 12, 2013
Altadena, CA
7,530
like
06/11/13 03:29 PM (12 years ago)
@bernienor, I'm wanting to auto scale images for both iOS and Android. Did you figure out what works for Android?? -sxywebgirl
 
sxywebgirl
Aspiring developer
Profile
Posts: 158
Reg: Apr 12, 2013
Altadena, CA
7,530
like
06/21/13 08:01 PM (12 years ago)
@bernienor, I'm wanting to auto scale images for both iOS and Android. Did you figure out what works for Android?? -sxywebgirl
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.