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

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

Bug Reports Post about errors or bugs encountered.

Image problem with ImageButtons

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-14-2008, 10:49 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default Image problem with ImageButtons

Hello Erel,
I have a problem with images in ImageButtons.
For the IconEdit program I am trying to merge all the images into one binary file and retrieve those in an ImageList in the program, original idea of Oran.
But there is a problem with images in ImageButtons.
I added some Buttons and ImageButtons in the joined ImageEmbedBuilderTest program with different tests and the problem.
- Run the program
- Click on Viewer
- Load the IconEdit.img file there are 48 images in
- Then on top you can display the different images (Item 13 Pen image)
- If you click on Button15 it's the problem the image is not recognized

Below the code for the different Buttons with tests
Code:
Sub Button15_Click    ' problem
  ImageButton3.Image=IL1.Item(13)
End Sub

Sub Button16_Click    ' works
  IL2.Add(AppPath&"\btnPen.bmp")  ' original bitmap file
  ImageButton3.Image=IL2.Item(0)
End Sub

Sub Button17_Click  ' works
  Image1.Image=IL1.Item(13)         ' assign Item(13) to an Image object
  Il2.Add(Image1.Image)                ' assigning it to imageList
  ImageButton3.Image=IL2.Item(0)
End Sub
It seems that there is a bitmap format problem.
Can you please have a look at, thank you in advance.

Klaus
Switzerland
Attached Files
File Type: zip ImageEmbedBuilderTest.zip (36.5 KB, 31 views)
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 01:19 AM
alfcen's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu Islands
Posts: 768
Send a message via Skype™ to alfcen
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hallo Klaus,

It works if you uncheck the Transparent property of ImageButton3.
An image button appears to be sensitive to whether an image is
actually loaded or just being referenced to.

Cheers
Robert
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 05:55 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

As Robert mentioned there is a problem with loading an image when the transparent property is true.
Unlike the Image control the ImageButton doesn't create a copy of the image, therefore you should manually create such a copy if you get the image from an external library or an ImageList:
Code:
Sub Button15_Click
    ImageButton3.Transparent = 
false
    ImageButton3.Image=IL1.Item(
13)
    ImageButton3.Image = ImageButton3.Image 
'Creates a new copy.
    ImageButton3.Transparent = true
End Sub
These two issues will probably be solved in the next update.
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 09:10 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Hallo Robert, Hi Erel
Thank you for your quick replies.
I retrieve now the images in an Image object and then assign it into the ImageList.
It works even without unchecking and check again the Transparency property.

Best regards
Klaus
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
MouseMove over Image - problem DaveW Questions (Windows Mobile) 10 11-04-2008 09:27 AM
True colors images and imagebuttons? N1c0_ds Questions (Windows Mobile) 4 09-15-2008 05:57 PM
Problem: fetch and store image to/from database willisgt Questions (Windows Mobile) 2 05-13-2008 04:10 PM
Image size problem agraham Bug Reports 4 10-24-2007 06:40 PM
Move an image inside an image control Cableguy Questions (Windows Mobile) 5 05-14-2007 08:40 PM


All times are GMT. The time now is 12:57 AM.


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