View previous topic :: View next topic |
Author |
Message |
sir-gunny Advanced Cheater Reputation: 0
Joined: 15 Mar 2012 Posts: 80
|
Posted: Sun Jul 26, 2015 4:14 am Post subject: Use Iconfile from Stream for UDF |
|
|
Hi.
How can i load a attached *.ico file to my form?
Code: | UDF1.Icon.loadFromStream(findTableFile("Icon128.ico").Stream) |
It doesn'd work.
Pls help me. THX
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Jul 26, 2015 5:12 am Post subject: |
|
|
Code: | function showPropertyList(o)
if o==nil then print("object is nil");return end
print( 'object class: '..o.ClassName)
local propertyList = getPropertyList(o)
if propertyList==nil then print("property list empty");return end
print( 'properties:' )
print( propertyList.Text )
end
showPropertyList(UDF1.Font)
showPropertyList(UDF1.Icon) |
Output:
Code: | object class: TFont
properties:
CharSet
Color
Height
Name
Orientation
Pitch
Quality
Size
Style
object class: TIcon
property list empty
|
You can't change icon with Lua. For now. Maybe in future CE version.
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sun Jul 26, 2015 5:35 am Post subject: |
|
|
Don't rely on the published properies alone
Icon inherits from RasterImage, which Inherits from Graphic
That means it has the properties of both RasterImage and Graphic. (e.g Canvas )
Also, the Icon property of a form has a special setter method so it can also take Picture objects
so try:
Code: |
p=createPicture()
p.loadFromStream(findTableFile("Icon128.ico").Stream,".ico")
UDF1.Icon=p
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sun Jul 26, 2015 3:04 pm Post subject: |
|
|
If you could load up icons like that, you probably can load up fonts and replace it too right?
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sun Jul 26, 2015 3:59 pm Post subject: |
|
|
fonts are different things. They first need to be installed in windows before they will take effect.
Of course, if they are installed, then all you need to do is use xxx.Font.Name="fontname"
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jul 27, 2015 7:03 am Post subject: |
|
|
OK. I didn't find any informations about icon in main.lua
"main.lua" suggestion:
Code: | Form Class: (Inheritance: ScrollingWinControl->CustomControl->WinControl->Control->Component->Object)
properties
AllowDropFiles: boolean - Allows files to be dragged into the form
ModalResult: integer - The current ModalResult value of the form. Note: When this value gets set the modal form will close
Menu: MainMenu - The main menu of the form
Icon: Icon - The icon of the form.
...
...
...
...
Icon (Inheritance: CustomIcon->RasterImage->Graphic) - {maybe one example here} |
_________________
|
|
Back to top |
|
|
sir-gunny Advanced Cheater Reputation: 0
Joined: 15 Mar 2012 Posts: 80
|
Posted: Mon Jul 27, 2015 11:05 am Post subject: |
|
|
Dark Byte wrote: | Don't rely on the published properies alone
Icon inherits from RasterImage, which Inherits from Graphic
That means it has the properties of both RasterImage and Graphic. (e.g Canvas )
Also, the Icon property of a form has a special setter method so it can also take Picture objects
so try:
Code: |
p=createPicture()
p.loadFromStream(findTableFile("Icon128.ico").Stream,".ico")
UDF1.Icon=p
|
|
BIG THX
|
|
Back to top |
|
|
|