override default icons...
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
override default icons...
Is there a way to override the default icons with my own?
Thanks
Simon
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: override default icons...
Hello Simon,
Yes it is possible by replacing the IUIX_Icon of the needed IUIX_Cmd.
Please use forum search for the "Icon" keyword for more details.
Cheers,
Alex
Yes it is possible by replacing the IUIX_Icon of the needed IUIX_Cmd.
Please use forum search for the "Icon" keyword for more details.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: override default icons...
Alex,
Would you be able to give me a quick example of how to override the default icon, for say the bookmark icon in the attached image. I know that you prefer to have forum users supply some code, but I am really stuck with this.
Thanks in advance
Simon
Would you be able to give me a quick example of how to override the default icon, for say the bookmark icon in the attached image. I know that you prefer to have forum users supply some code, but I am really stuck with this.
Thanks in advance
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: override default icons...
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: override default icons...
Hi Alex,
Thanks I have got it working, but one last question this is using a physical file location. Is it possible to use an image from my project Resources?
Thanks
Simon
Thanks I have got it working, but one last question this is using a physical file location. Is it possible to use an image from my project Resources?
Code: Select all
Public Sub changeIconImg()
Dim cmd As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.view.bookmarks")
Dim myIcon As PDFXEdit.IUIX_Icon = GetIcon("D:\Icons\Logo_24.png")
cmd.Icon = myIcon
End Sub
Code: Select all
Public Function GetIcon(IconPath As String) As PDFXEdit.IUIX_Icon
Dim Icon As PDFXEdit.IUIX_Icon = Nothing
If System.IO.File.Exists(IconPath) Then
Dim name As PDFXEdit.IAFS_Name = fsInst.DefaultFileSys.StringToName(IconPath)
Dim file As PDFXEdit.IAFS_File = fsInst.DefaultFileSys.OpenFile(name, CInt(PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_Read) Or CInt(PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_ShareRead))
Icon = uiInst.CreateIconFromIStream(file.GetStream())
End If
Return Icon
End Function
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: override default icons...
Hello Simon,
Well your project's Resources also have a physical location, for example:
Cheers,
Alex
Well your project's Resources also have a physical location, for example:
Code: Select all
string sFileName = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Resources\\calculator.png";
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: override default icons...
Alex,
Don't worry I figured it out. Thanks for all your help
Don't worry I figured it out. Thanks for all your help
Code: Select all
Dim cmd As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.view.bookmarks")
Dim Icon As PDFXEdit.IUIX_Icon = Nothing
Dim i As Bitmap = Bitmap.FromHbitmap(My.Resources.Logo_24.GetHbitmap())
Icon = uiInst.CreateIconFromHandle(CUInt(i.GetHicon()))
cmd.Icon = Icon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: override default icons...
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ