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 


Bitmap picture dissapears after resizing bitmap

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

Joined: 29 Mar 2021
Posts: 64

PostPosted: Fri Dec 02, 2022 3:06 am    Post subject: Bitmap picture dissapears after resizing bitmap Reply with quote

How can i not lose, or get back the bitmap picture when i resize the bitmap?

Code:

local size = 5
if f then f.destroy() end
f = createForm()
f.setSize(100*size, 100*size)
f.BorderStyle = 'bsSizeable'
f.ShowInTaskbar = 'stAlways'

--- IMG PIC ---
img = createImage(f)
img.Align = 'alClient'
img.Stretch = true

pic = createPicture()
pic.Bitmap.Width = img.Width
pic.Bitmap.Height = img.Height

local canvas = pic.Bitmap.Canvas
canvas.Brush.Color = clRed
canvas.fillRect(0, 0, 250, 250)

img.Picture = pic

--[[
pic.Bitmap.Width = pic.Bitmap.Width + 1 -- after resizing the whole picture dissapears
img.Picture = pic -- when i set img.Picture as pic again
]]


https://ibb.co/h8dvshh
https://ibb.co/m0YxvkG
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Dec 04, 2022 6:45 am    Post subject: Reply with quote

Just draw again

Code:
pic.Bitmap.Width = pic.Bitmap.Width + 1
canvas.fillRect(0, 0, 250, 250)
img.Picture = pic

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Tue Dec 06, 2022 8:40 am    Post subject: Reply with quote

Corroder wrote:
Just draw again

Code:
pic.Bitmap.Width = pic.Bitmap.Width + 1
canvas.fillRect(0, 0, 250, 250)
img.Picture = pic


I tried this before but it caused more problems for me, i found a fix for it now by setting img.Stretch = true
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