|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Mar 12, 2017 7:42 pm Post subject: Eliminating White Part From PNG Image |
|
|
Hi there,
When I add an PNG image type to a form, it show not clear. There are white part on image sharp. How to eliminating these white part ?
I remember old topic about Form Layered Attribute and also about Form Transparent, but that topics more about hoe to make transparent. What I need is just to clear and smooth display the PNG image.
Thank
|
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Sun Mar 12, 2017 8:44 pm Post subject: |
|
|
check the png itself.
it's possible those white parts are actually in the png, but don't show when on a white background
_________________
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 |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Mar 13, 2017 2:57 am Post subject: |
|
|
Thanks akumakuja28 :
Yes I know this code to set form to transparent :
Code: | function FormLayeredAttributes(form,colorkey,alpha,flag)
if form==nil then return false end
colorkey = colorkey or 0xFFFFFF
alpha = alpha or 0xFF
flag = flag or 1
if cheatEngineIs64Bit() then
handle = readQwordLocal(userDataToInteger(form)+0x538)
script = [[
alloc(thread,128)
createthread(thread)
thread:
lea rsp,[rsp-40]
mov rcx,handle
mov edx,FFFFFFEC
call user32.GetWindowLongA
mov r8d,eax
or r8d,00080000
mov rcx,handle
mov edx,FFFFFFEC
call user32.SetWindowLongA
mov rcx,handle
mov edx,colorkey
mov r8d,alpha
mov r9d,flag
call user32.SetLayeredWindowAttributes
lea rsp,[rsp+40]
ret
]]
script=script:gsub('handle', string.format('%X',handle)):gsub('colorkey', string.format('%X',colorkey))
script=script:gsub('alpha', string.format('%X',alpha)):gsub('flag', string.format('%X',flag))
autoAssemble(script,true)
else
handle = bAnd( readQwordLocal(userDataToInteger(form)+0x330) , 0xFFFFFFFF)
script = [[
alloc(thread,128)
createthread(thread)
thread:
push -14
push handle
call user32.GetWindowLongA
or eax,80000
push eax
push -14
push handle
call user32.SetWindowLongA
push flag
push alpha
push colorkey
push handle
call user32.SetLayeredWindowAttributes
ret
]]
script=script:gsub('handle', string.format('%X',handle)):gsub('colorkey', string.format('%X',colorkey))
script=script:gsub('alpha', string.format('%X',alpha)):gsub('flag', string.format('%X',flag))
autoAssemble(script,true)
end
end
LWA_COLORKEY = 1
LWA_ALPHA = 2
UDF1.CEImage1.OnMouseDown = function() UDF1.DragNow() end
function CEButton1Click(sender)
closeCE()
end
UDF1.BorderStyle = 'bsNone'
UDF1.Visible=true
UDF1.Color = 0xFFFFFF
UDF1.Constraints.MinWidth = UDF1.CEImage1.Width
UDF1.Constraints.MinHeight = UDF1.CEImage1.Height
FormLayeredAttributes(UDF1, 0xFFFFFF, 240, LWA_COLORKEY + LWA_ALPHA)
|
Also we can use AlphaBlend = true amd set for Form.AlphaBlendValue = integer, to make form transparent, of if we doesn't care with image go to transparent too.
Any way, i have check what DB said and found conclusion, then PNG image will contain white part / blur part depending by image size. (image attached). Then, maybe there are a function which to adjusting image pixels when it resize. I just googling for it.
Regards
Description: |
|
Filesize: |
25.19 KB |
Viewed: |
7096 Time(s) |
|
Description: |
|
Filesize: |
14.46 KB |
Viewed: |
7096 Time(s) |
|
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Mon Mar 13, 2017 6:46 am Post subject: |
|
|
You're looking to resample the image, or apply anti aliasing to it, to blur the pixels.
This currently cannot be done easily, I did try to experiment with it but quite difficult.
You could replace the TBitmap with BGRABitmap library which contains some anti aliasing feaures and some other.
Another method is add a function to the bitmap class to return scanline pointer or access Pixels or raw image,then use cheat engine to modify or/and apply anti-aliasing manually in memory and invalidate the image.
All these require modification of C.E.
Another option would create the very same image in different dimensions after it's been resampled (by photoshop etc.) and use them instead.
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Mar 13, 2017 8:24 am Post subject: |
|
|
DaSpamer wrote: | You're looking to resample the image, or apply anti aliasing to it, to blur the pixels.
This currently cannot be done easily, I did try to experiment with it but quite difficult.
You could replace the TBitmap with BGRABitmap library which contains some anti aliasing feaures and some other.
Another method is add a function to the bitmap class to return scanline pointer or access Pixels or raw image,then use cheat engine to modify or/and apply anti-aliasing manually in memory and invalidate the image.
All these require modification of C.E.
Another option would create the very same image in different dimensions after it's been resampled (by photoshop etc.) and use them instead. |
Yes, no setPixelTo or Anti-Aliasing in CE for this time. Maybe shall use Lua-GD or Lua-CD, IUP or other lua lib for GUI. Meanwhile, I have used the option, by change image dimension and resizing to exact dimension value I need, using MS-Picture Manager and after resized image displaying clear and smooth.
|
|
Back to top |
|
|
|
|
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
|
|