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 


Open pictures with open dialog

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Jun 16, 2016 9:48 pm    Post subject: Open pictures with open dialog Reply with quote

Hi
I make this lua script for "OpenDialog":

Code:
function ButtonOpenClick(sender)
    local child1 = control_getParent( sender ); -- button to panel
    local child2 = control_getParent( child1 ); -- panel to form

    if( frmCheat_ldCheat == nil ) then
        print( "its nil" );
    end

     openDialog_execute( frmCheat_ldCheat );
end


Q1:Now how to make script for open pictures types only(Pictures Types(jpg,png,...))?
Q2:How to make with "OpenDialog" script that when open the picture the dimensions of the form to the size of the picture dimensions?

Thanks for your answer
*SJL002*
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Jun 17, 2016 5:15 am    Post subject: Reply with quote

a1:
if you're using the form designer, then go to the ldCheat object (using the treeview in the object inspector) , go to the filter properties and click on the ... button
in there you can give it a name and in filter the extension you wish (multiple)

e.g:
Code:

All image files  |      *.png;*.jpg
Jpg files        |      *.jpg
Png files        |      *.png
Dot files        |      *....


but you can also set the property at runtime
e.g:
Code:

frmCheat.ldCheat.Filter="All image files|*.png;*.jpg|Jpg files|*.jpg|Png files|*.png|Dot files|*...."


a2:
Code:

if frmCheat.ldCheat.execute() then
  local p=createPicture()
  p.loadFromFile(frmCheat.ldCheat.FileName)
  frmCheat.ClientWidth=p.Bitmap.Width
  frmCheat.ClientHeight=p.Bitmap.Height

  --and do other things with p like assigning p to a image.Picture or something
end

_________________
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
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Fri Jun 17, 2016 6:56 pm    Post subject: Reply with quote

It's very nice , Thanks Dark Byte for your help.
but i have other problem when click on button and open a picture. But a picture not show in form. Help

Thanks for your answer
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Fri Jun 17, 2016 7:45 pm    Post subject: Reply with quote

DB has already given you the answer to that question.
Dark Byte wrote:
--and do other things with p like assigning p to a image.Picture or something

If you can't figure it out from that, then read main.lua and try to learn from it. Considering you've already been told that multiple times in the past (and you're still using those old undoccumented functions), it's clear you haven't and probably never will do that.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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