Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

bList Image Resize and Transparency

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2010, 10:24 AM
Junior Member
 
Join Date: Jun 2007
Posts: 17
Default bList Image Resize and Transparency

Using latest version of bList 0.92. My application works fine while testing on windows mobile standard screen size. However when I compile(autoscale) app and run on high resolution HTC Touch HD the images appears small in top left corner and the transparency around the edge of the image is not correct infact all the images appear in a white box.

Is bList meant to rescale images and text when compiled autoscaled?
What has happened to the transparency of the images?
If not what do I need to do to correct this problem?

Thank you.
Reply With Quote
  #2 (permalink)  
Old 02-02-2010, 01:17 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 978
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

The blist is autoscaled, but the images are loaded according to their size, so what fits a qvga will be only a quarter in vga.

This means that you need to change the size of the image prior to loading it to the list.

You can use img.ZoomImage with the zoom factor defined by screenscaley.

This is what I do in my Family tree to show thumbnails on the list:

Code:
imfn = AppPath & "\jpg\" & list.Item(i)& ".jpg"
If FileExist(imfn) Then 
    image2.image = imfn
    ImgSize() = img.ImageSize(image2.Image)
    factor = 
Max(imgsize.hy/320,imgsize.wx/240)
    item.SetImageFromExisting(img.ZoomImage(image2.Image,
8*ScreenScaleY/factor))
    item.ImageTop = 
1
End If
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 02-02-2010 at 01:21 PM.
Reply With Quote
  #3 (permalink)  
Old 02-03-2010, 03:57 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should set the image size explicitly and it will be auto-scaled correctly:
Code:
    bListItem.SetImageFromFile(AppPath & "\btnhome.bmp")
bListItem.ImageLeft = 
10
bListItem.ImageHeight = 
20
bListItem.ImageWidth = 
20
bListItem.ImageTop = 
10
Reply With Quote
  #4 (permalink)  
Old 02-03-2010, 07:31 AM
Junior Member
 
Join Date: Jun 2007
Posts: 17
Default bList Image Resize and Transparency

Thank you both ... works great ...

But the transparency of the image shows up white on the HTC Touch HD while on the IDE under Windows Vista shows fine.

What is causing this?
Reply With Quote
  #5 (permalink)  
Old 02-03-2010, 08:12 AM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by IansResearch View Post
TBut the transparency of the image shows up white on the HTC Touch HD while on the IDE under Windows Vista shows fine.

What is causing this?
I don't know much about the internals of the re-sizing process but I can guess...

If the transparency determination depends on the colour of a given single corner pixel, and the re-sizing process is averaging that pixel with adjacent ones, perhaps the corner pixel ends up a different colour. Then when calculating which pixels are transparent the answer would come out wrong.

Experimentally try extending the transparency pixel colour (if this is how it is being done) to the surrounding area? And/or reduce the number of colours?

Mike.
Reply With Quote
  #6 (permalink)  
Old 02-03-2010, 11:21 PM
Junior Member
 
Join Date: Jun 2007
Posts: 17
Default

Is it possible that PNG (transparency) format is not supported on Windows Mobile 6.1 .NETCF2?

If that is true what format should I use with bList control ?
Reply With Quote
  #7 (permalink)  
Old 02-04-2010, 04:04 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
Is it possible that PNG (transparency) format is not supported on Windows Mobile 6.1 .NETCF2?
Yes, .Net CF do not support PNG transparency.

You can use a solution like this one: http://www.basic4ppc.com/forum/offic...html#post30871 and do all the drawing yourself and that includes on drawing transparent images (by explicitly defining the 'transparent' color).
Reply With Quote
  #8 (permalink)  
Old 02-04-2010, 07:16 AM
Junior Member
 
Join Date: Jun 2007
Posts: 17
Default

Thanks Erel ... thats great...

I wonder could the next version of bList contain additional properties for the list items ImageTransparency (true or false), ImageTransparencyColor (RGB)

This just keeps it all neat. I am presuming that blist library draws the image.

Thank you for your help.

Last edited by IansResearch : 02-04-2010 at 07:25 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
bList v0.9 (beta) released Erel Official Updates 96 08-12-2011 02:24 PM
bList J12345T Questions (Windows Mobile) 4 01-03-2010 04:34 AM
bList v0.9 (beta) released Erel Announcements 0 09-20-2009 05:26 PM
Resize Event Mr.Bamba German Forum 2 03-24-2009 08:43 PM
Sample Resize function IansResearch Code Samples & Tips 0 02-03-2009 05:20 PM


All times are GMT. The time now is 08:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0