![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a Image button loaded with a PNG image 64x64 pix. At run time the image will show a gray background. Transparent property is set to TRUE.
When I click the image Button the Image background is then transparent, which should it been when the program started. What do I need to set in order in the imageButton property (if any) so it does not have a gray background at start up? You help will be appreciated. Thank You. |
|
||||
|
Hi,
PNG images have an alpha cannel, wich control their transparencie... Try to use a BMP version of the same image... As I understand, the transparency feature works by getting the o,o (x,y)pixel color, and then set them all to the same collor as the background...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
Guys thanks for the quick response, you guys are great..
I converted the image to BMP, same problem. Can you share some code example here: How to set the pixel transparency (X,Y) pixel in the image property. I do have transparency set to TRUE. I have the same issue with (PNG, GIF and now BMP), I want to use PNG because they smaller, these are converted ICON to PNG.. ![]() Thanks |
|
||||
|
Can u upload the project as is...?
could then help more efectively...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
I found the problem, when I resized the PNG images I must lost some property format or did not save correctly. The original PNG was 128x128 pix. Anyway, I used the original and resize the ImageBtn to 48x48pix and the image looks fine now.
This problem started wanting to display ICONS (ico) formats. Thanks for all your help.. |
|
|||
|
well guys, I thought I had the problem fixed with the images resizing, still have the same issue.
Attached is the sample code with the images, you can see the edges of the image in gray.. I need to have a panel on top of the form because I may have different panels. Thanks.. gs4322 |
|
||||
|
I have modified your program with 4 ImageButtons.
The upper two's parent control is Form1 the lower two's parent control is Panel1 the left two with .png images the right two with .bmp images And Button1 to toggle between transparent ant not transparent. As you can see, the upper two buttons show the Form1 background color the lower two show the Panel1 background color. An image control can not be a parent control so the image button cannot show it's image. A panel control can be a parent control but doesn't have an image property. So, as Erel told, you must put the image on Form1 ant the image buttons parent control must also be Form1. The top right buttons transparent color is almost the same as the Form1 background color that's why there seems not be any change in toggling. Hope this explains how this works. Klaus Switzerland |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AddEvent & ImageButton in IDE | agraham | Bug Reports | 1 | 09-10-2008 09:31 PM |
| ImageButton MouseOver | superbabicka | Questions & Help Needed | 0 | 06-29-2008 09:19 PM |
| imagebutton error | kolbe | Questions & Help Needed | 3 | 03-11-2008 03:20 PM |
| transparent background,label | cdeane | Questions & Help Needed | 4 | 09-20-2007 06:45 AM |
| Label with transparent background | BerndB | Basic4ppc Wishlist | 6 | 07-03-2007 04:00 PM |