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 


Drawing forms contents.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Feb 11, 2015 7:27 pm    Post subject: Drawing forms contents. Reply with quote

I have a form and inside of it a panel with massive width (that has lot's of objects).

I'm trying to copy the 'offscreen' content of the form&panel and draw it into an image (in another form).

I'm not quite sure how the function printToRasterImage works, as it draws for me a black rect (even when using in visible area).

Let's say I have this object

Code:
app = {}
app.init = function()
   local self = app;
   self.form = createForm();
   self.form.width = 600;
   self.form.height = 450;
   self.panel = createPanel(self.form);
   self.panel.width = 1800;
   self.panel.height = 450;
    local lastcol = 0;
    local color = 0;
    local clrs = {0x1186b6,0x2dbdf3,0xefa210,0x9d20dd,0x443dc8,0x2b6905,0x1843eb}
    local mf,mr = math.floor,math.random
   for i=1,25 do
      local obj = createImage(self.panel);
      obj.left = 5 + mf(self.panel.width / 25)*(i-1);
      obj.top = mf(self.panel.height/2);
      obj.Canvas.Brush.Color = (function () while color==lastcol do color = clrs[mr(1,7)] end lastcol = color return color end)();
      obj.Canvas.fillRect(0,0,obj.width,obj.height);
   end
end
app.init();


And I want to draw offscreen (600-1200) do the image object below
Code:
f = createForm();
i = createImage(f);
i.width = f.width;
i.height = f.height;


Without recreating the objects (huge performance impact).

_________________
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: 25296
Location: The netherlands

PostPosted: Thu Feb 12, 2015 4:57 am    Post subject: Reply with quote

i'm not sure that's possible, if it's not visible it won't get rendered(painted)

why not use a different design? e. g. create that second form from the start and fill that with the extra controls insteads

_________________
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: Thu Feb 12, 2015 9:59 am    Post subject: Reply with quote

Dark Byte wrote:
i'm not sure that's possible, if it's not visible it won't get rendered(painted)

why not use a different design? e. g. create that second form from the start and fill that with the extra controls insteads


I'm working on some side fun project.
Thing is, lot's of objects being created which cause heavy performance, so I'm trying to clone part of main window (creating like a preview), which shouldn't use too much resources (as there is no need to mix 4 or images into 1 object and change pixelformat).

_________________
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
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