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 


Is it possible to use Alpha Blend on different object?

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

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sun Sep 06, 2020 10:21 am    Post subject: Is it possible to use Alpha Blend on different object? Reply with quote

Is there any other object other than "Form" that uses the Alpha Blend?
Or the alpha code for a different object?

For example;
Code:
UDF1.CEPanel1.AlphaBlend=true
UDF1.CEPanel1.AlphaBlendValue=155


If there is a solution, thanks in advance.

EDIT :

I found a code generated by @ mgr.inz.Player and @Dark Byte.
Is it possible to use this code in panel instead of picture?

Code:
function TBlendFunction(SourceConstantAlpha)
  return byteTableToDword({0,0,SourceConstantAlpha,1})
end

function getCanvasHandle(canvas)
  canvas.getPixel(0,0)
  return readPointerLocal(userDataToInteger(canvas)+0xc8)
end

function demo(alpha)
  pngImage = createImage(nil)
  pngImage.Picture.PNG.loadFromStream(findTableFile('example.png').Stream)

  tmpImage = createImage(nil)

  local width  = pngImage.Picture.Bitmap.Width
  local height = pngImage.Picture.Bitmap.Height

  tmpImage.Picture.Bitmap.PixelFormat = pf32bit
  tmpImage.Picture.Bitmap.Width  = width
  tmpImage.Picture.Bitmap.Height = height

  executeCodeLocalEx("msimg32.AlphaBlend", getCanvasHandle(tmpImage.Picture.Bitmap.Canvas), 0, 0, width, height,
                                           getCanvasHandle(pngImage.Picture.Bitmap.Canvas), 0, 0, width, height, TBlendFunction(alpha))

  UDF1.CEImage1.Picture.assign(tmpImage.Picture)
  UDF1.CEImage1.repaint()

  pngImage.destroy()
  tmpImage.destroy()

  UDF1.Caption = 'alpha is '..alpha
end

function UDF1_CETrackBar1Change(sender)
  demo(sender.Position)
end

demo(128)


Question

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Sep 06, 2020 12:13 pm    Post subject: Reply with quote

Please take a conclusion from this statement:

"The AlphaBlend function displays bitmaps that have transparent or semitransparent pixels."

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sun Sep 06, 2020 2:58 pm    Post subject: Reply with quote

Corroder wrote:
Please take a conclusion from this statement:

"The AlphaBlend function displays bitmaps that have transparent or semitransparent pixels."


I focused only on making a panel or canvas translucent.
Seeing a panel or canvas instead of a picture in the code above seems to solve the issue. Smile

Yes, I understand the purpose of "AlphaBlend", so I focused on transparency.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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