Forum Index

Welcome to the SDL Passolo User Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to change icons with a macro?

 
Post new topic   Reply to topic     Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Tommyknocker



Joined: 09 Mar 2010
Posts: 2

PostPosted: Tue Mar 09, 2010 3:25 pm    Post subject: How to change icons with a macro? Reply with quote

Hello,

I would like to change some icons in my Passolo project with a macro.
I tried the following to replace two icons (with ID 4 and ID 128)

Code:

' Loop all resources
For i = 1 To trn.ResourceCount
    Dim res As PslResource
    Set res = trn.Resource(i)
    If res.IsBinary And res.Type = "IconGroup" Then
      Select Case res.ID
      Case 4
         res.ImportBinary("C:\icon.ico")
      Case 128
         res.ImportBinary("C:\icon.ico")
      End Select
    End If
Next i


But this does not work.
Can anyone help me?
Is there an error in the code or is it the complete wrong way to change icons with a macro?

Thank you for your help
Back to top
View user's profile Send private message
Uwe
Site Admin


Joined: 28 Jan 2005
Posts: 247
Location: Bonn, Germany

PostPosted: Wed Mar 10, 2010 4:19 pm    Post subject: Reply with quote

Hi,

your macro is ok.

The problem is: with Win32 icons are stored in different resource types:

IconGroup to list the available icon images and one Icon resource for every image. It's not possible to create additional resources when importing icons. So you cannot import an icon that has different image count or resolution.
Back to top
View user's profile Send private message
Tommyknocker



Joined: 09 Mar 2010
Posts: 2

PostPosted: Thu Mar 11, 2010 6:18 pm    Post subject: Reply with quote

Thank you very much.
The problem was a different image count and different resolutions!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General Discussion All times are GMT + 1 Hour
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


Powered by phpBB © 2001, 2005 phpBB Group