Jump to content
Sign in to follow this  
PeterAtkin

.BMP Graphic [Solved]

Recommended Posts

PeterAtkin

I wish to get the size (x,y) of the graphic file so I can automate the below code a little, as the size of the graphic file can change regularly.

This is what I got

SplashImageOn("Splash Screen", @ScriptDir & "\cfu_logo.bmp", 200, 59, 90, 220, 17)

This is what I would like to see or similar.

SplashImageOn("Splash Screen", @ScriptDir & "\cfu_logo.bmp", $length, $width, 90, 220, 17)

Hope that makes sense.

Edited by PeterAtkin

[topic='115020'] AD Domain Logon Script[/topic]

Share this post


Link to post
Share on other sites
Yoriz

You could use this UDF: ImageGetInfo


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites
PeterAtkin

Thanks Yoriz, this works a treat and so simple.... this is what it ended up looking like,

$logo_file = @ScriptDir & "\cfu_logo.bmp"
$aInfo = _ImageGetInfo($logo_file)
SplashImageOn("Splash Screen", $logo_file, _ImageGetParam($aInfo, "Width"), _ImageGetParam($aInfo, "Height"), -1, -1, 1)
Edited by PeterAtkin

[topic='115020'] AD Domain Logon Script[/topic]

Share this post


Link to post
Share on other sites
UEZ

Thanks Yoriz, this works a treat and so simple.... this is what it ended up looking like,

$logo_file = @ScriptDir & "\cfu_logo.bmp"
$aInfo = _ImageGetInfo($logo_file)
SplashImageOn("Splash Screen", $logo_file, _ImageGetParam($aInfo, "Width"), _ImageGetParam($aInfo, "Height"), -1, -1, 1)
You can use also GDI+ to get image dimension:

#include <GDIPlus.au3>
$logo_file = "C:\Program Files\AutoIt3\Examples\GUI\MSLogo.jpg"
_GDIPlus_Startup()
$hImage = _GDIPlus_BitmapCreateFromFile($logo_file)
$iX = _GDIPlus_ImageGetWidth ($hImage)
$iY = _GDIPlus_ImageGetHeight ($hImage)
_GDIPlus_BitmapDispose($hImage)
_GDIPlus_Shutdown()
SplashImageOn("Splash Screen", $logo_file, $iX, $iY, -1, -1, 1)
Sleep(5000)
SplashOff()

BR,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
PeterAtkin

Both solutions seems equal to me, would I be correct in terms of compatibility that the GDI+ would be the better route.. any ideas.

And thanks for the positive response..


[topic='115020'] AD Domain Logon Script[/topic]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×