bList Image Resize and Transparency

IansResearch

Member
Licensed User
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. :sign0085:
 

derez

Expert
Licensed User
Longtime User
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:

B4X:
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
 
Last edited:

IansResearch

Member
Licensed User
Thank you both ... works great ... :sign0060:

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?
 

mjcoon

Well-Known Member
Licensed User
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.
 

IansResearch

Member
Licensed User
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 ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

IansResearch

Member
Licensed User
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:
Top