forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Icon Background

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Tue Feb 16, 2010 1:25 pm    Post subject: Icon Background Reply with quote

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?



preview.jpg
 Description:
 Filesize:  14.38 KB
 Viewed:  1384 Time(s)

preview.jpg


Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Feb 17, 2010 1:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Feb 17, 2010 5:38 am    Post subject: Reply with quote

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 Wink



BMPvsICO.png
 Description:
Quick look
 Filesize:  70.15 KB
 Viewed:  1387 Time(s)

BMPvsICO.png



BMPvsICO.zip
 Description:
Source code

Download
 Filename:  BMPvsICO.zip
 Filesize:  51.35 KB
 Downloaded:  1322 Time(s)

Back to top
View user's profile Send private message Send e-mail
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Wed Feb 17, 2010 8:19 pm    Post subject: Reply with quote

Thanks a lot Asian!!!
I will test it tonight!
Back to top
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Tue Mar 02, 2010 3:25 am    Post subject: Reply with quote

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?



Clipboard01.jpg
 Description:
 Filesize:  151.61 KB
 Viewed:  1263 Time(s)

Clipboard01.jpg


Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Mar 03, 2010 2:44 am    Post subject: Reply with quote

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 Crying or Very sad
Back to top
View user's profile Send private message Send e-mail
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Sun Mar 14, 2010 7:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Mar 16, 2010 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Tue Mar 16, 2010 9:34 pm    Post subject: Reply with quote

Thanks a lot!!! I'm using BMPs so I will try it right now.
Back to top
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Wed Mar 17, 2010 2:36 am    Post subject: Reply with quote

Surprised Surprised Surprised it's too rare...
It works with only one of all my BMPs Smile Smile
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 Sad Sad

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 Smile Smile Smile

Sorry for my english.
Back to top
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Tue Mar 23, 2010 11:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group