Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Use Iconfile from Stream for UDF

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sun Jul 26, 2015 4:14 am    Post subject: Use Iconfile from Stream for UDF Reply with quote

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 Smile
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Jul 26, 2015 5:12 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sun Jul 26, 2015 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Jul 26, 2015 3:04 pm    Post subject: Reply with quote

If you could load up icons like that, you probably can load up fonts and replace it too right?
_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sun Jul 26, 2015 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Jul 27, 2015 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Mon Jul 27, 2015 11:05 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
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 cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites