| View previous topic :: View next topic |
| Author |
Message |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Tue Feb 16, 2010 1:25 pm Post subject: Icon Background |
|
|
Hi, im using a table with a custom color style.
I have 32x32 icons on it and i want to set the icon background to the same color of the table.
Is this possible?
This is an example code of my table:
| Code: |
DIALOG CREATE,New Dialog,-1,0,633,328
DIALOG ADD,STYLE,STYLE1,,18,,001324,WHITE
DIALOG ADD,TABLE,TABLE1,25,28,583,253,Column 1[150],,Style1
DIALOG ADD,BUTTON,BUTTON1,290,507,64,24,BUTTON1
DIALOG SHOW
#-------------#
# 32x32 icons #
#-------------#
%%T1 = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,2),1,0)
Loadlib comctl32.dll
%x = @lib(comctl32.dll,ImageList_SetIconSize,BOOL:,%%T1,32,32)
Freelib comctl32.dll
#-------------#
#----------#
# No title #
#----------#
LOADLIB USER32.DLL
%%TABLE = Table1
%H = @STRDEL(@WINEXISTS(~%%TABLE),1,1)
IF %H
%O = @LIB(USER32,GetWindowLongA,INT:,%H,-16)
%Z = @LIB(USER32,SetWindowLongA,INT:,%H,-16,@SUM(%O,-600000))
END
FREELIB USER32
#----------#
list add,Table1,Item1@tab()SubItem1|Carpeta.bmp
list add,Table1,Item2@tab()SubItem2|Carpeta.bmp
list add,Table1,Item3@tab()SubItem3|Carpeta.bmp
list add,Table1,Item4@tab()SubItem4|Subs.bmp
list add,Table1,Item5@tab()SubItem5|Subs.bmp
list add,Table1,Item6@tab()SubItem6|Subs.bmp
wait event
|
And this is how it looks...
Any sugestion?
| Description: |
|
| Filesize: |
14.38 KB |
| Viewed: |
1384 Time(s) |

|
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Feb 17, 2010 1:21 am Post subject: |
|
|
marcelo,
Have you looked at the extTable DSU I suggested in your "Table Border" post http://www.vdsworld.com/forum/viewtopic.php?p=35389#35389&sid=568a02c75cf02e5e5a0bab27e69733f0
If you have, look at the imagelist part to create your own Imagelist with actual ICONs instead of bitmaps.
Not that BMPs won't work but, they can be tricky if your bitmap fades into the background. Unless you create/modify the bitmap to be optimized for the same background color as your table element.
If I can find some time, I'll try to create a good example comparing BMPs and ICONS for you.
BTW - Icons make great header images
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Feb 17, 2010 5:38 am Post subject: |
|
|
Ok, I attached an example using your black background and 24x24 images (I didn't have matching sets at 32x32)
You will notice a mark-able difference in quality and transparency.
Try it with different background/foreground colors to see the effect it has on the bitmaps.
I hope this has helped you in some way.
Happy coding
| Description: |
|
| Filesize: |
70.15 KB |
| Viewed: |
1387 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
BMPvsICO.zip |
| Filesize: |
51.35 KB |
| Downloaded: |
1322 Time(s) |
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Wed Feb 17, 2010 8:19 pm Post subject: |
|
|
Thanks a lot Asian!!!
I will test it tonight!
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Tue Mar 02, 2010 3:25 am Post subject: |
|
|
Sorry for the delay, i think i have a problem because i cant make it work....
Your example have either ICO and BMP white backgrounds....
Is this script compatible with VDS 5?
| Description: |
|
| Filesize: |
151.61 KB |
| Viewed: |
1263 Time(s) |

|
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Mar 03, 2010 2:44 am Post subject: |
|
|
Unfortunately, it looks like the transparent background feature doesn't work with VDS 5. I even tried changing the image list background color and it still didn't work. I don't have the VDS 5 IDE anymore so I can't see if selecting the Include XP manifest option will help. I used to have issues with some graphical related APIs in VDS 5 that required MS CommonControls 6.0 or higher even when using the "Include XP Manifest" option which is supposed to call for the use of CommonControls 6.0. In fact, I haven't ever detected any difference with this option selected or not. It might be an issue with the version of Delphi that VDS 5 was created with. It works great with VDS 6.
Sorry if this isn't much help
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Sun Mar 14, 2010 7:24 pm Post subject: |
|
|
Thanks a lot anyway Aslan!!!
Last question, is there a way to force the bmp/ico to not be transparent?
In this case i could put a BMP whit the same color of the list background.
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Mar 16, 2010 2:41 am Post subject: |
|
|
Yes, but it can be tricky.
With your example try making the background of one of your bitmaps BLACK then change just the pixel in the lower left corner to something like DARK RED that is almost black.
For example using MS Paint make the custom color
RED:1
GREEN:0
BLUE:0
This worker for me with the IDE set to VDS 5
I'm not sure how to do it with an ICON.
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Tue Mar 16, 2010 9:34 pm Post subject: |
|
|
| Thanks a lot!!! I'm using BMPs so I will try it right now.
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Wed Mar 17, 2010 2:36 am Post subject: |
|
|
it's too rare...
It works with only one of all my BMPs
All of them have the same background color, size and the first corner with other color....
Is there another important thing to know? (max colors, dpi, etc)?
Seems that i must change my idea to put this icons on this table
Bonus: trying without luk to do this job, i find the way to place a floating list in my dialog.
I dont know if it's a known feature but it works
Sorry for my english.
|
|
| Back to top |
|
 |
marcelo Contributor


Joined: 10 May 2008 Posts: 155
|
Posted: Tue Mar 23, 2010 11:02 pm Post subject: |
|
|
| Aslan wrote: | Yes, but it can be tricky.
With your example try making the background of one of your bitmaps BLACK then change just the pixel in the lower left corner to something like DARK RED that is almost black.
For example using MS Paint make the custom color
RED:1
GREEN:0
BLUE:0
This worker for me with the IDE set to VDS 5
I'm not sure how to do it with an ICON. |
Sorry for the delay.... It works perfect!!! Thanks a lot for your help!!!
Marcelo
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|