Sign in to follow this  
Followers 0
Greenhorn

[solved] add BMP to resources ?!?

18 posts in this topic

#1 ·  Posted (edited)

Salute,

I've seen in the ResHacker-Options of the AutoIt Wrapper that I'm able to add other resources to my EXE ! ;)

Now I'm asking myself, if it is possible to add BMP-files to my EXE and use'em in my Script ... :whistle:

Naturally I could add the BMP manually with ResHacker, but is there a way to use the BMP-Resource i.e. a GUI or something like that ???

In the Helpfile of SciTE I didn't got satisfacted about this question. :lmao:

If sombody could give me an affirmative answer and the way how to use it in my Script/GUI, I would be very delighted ! :P

Posted Image

Greetz

Greenhorn

Edited by Greenhorn

Share this post


Link to post
Share on other sites



FileInstall()

Share this post


Link to post
Share on other sites

Thanx evilertoaster, I know FileInstall, but with this command I have to extract it anywhere ! :whistle:

That's not what I want and asked for...

I want to use it directly from the resource, like the Icons with #AutoIt3Wrapper_Res_Icon_Add ...

Share this post


Link to post
Share on other sites

People did ask this before, i'm not sure wether it was extended beyond icons or not. Read this-

http://www.autoitscript.com/forum/index.php?showtopic=44527

and the other link provided in that post. Also try a serach on the forums for somthing like 'embed exe resource' and i think there should be a few things that come up relating to this issue.

Share this post


Link to post
Share on other sites

I wanna use the Picture for a Splash Screen.

I'm writing a Startfile for an portable Application and it should work Global.

That means, that the Starter can be placed anywhere on the Stick, 'cause it has a Search Function to find the directory of the App.

If you're asking me, how to add the resource with ResHacker ...

... in the Menu -> Action -> New Resource.

How I would call it in the Script ..., hmmm ...

... I have to study the Link from above at first, it looks like a solution, doesn't it ?

Greetz

Share this post


Link to post
Share on other sites

I wanna use the Picture for a Splash Screen.

I'm writing a Startfile for an portable Application and it should work Global.

That means, that the Starter can be placed anywhere on the Stick, 'cause it has a Search Function to find the directory of the App.

If you're asking me, how to add the resource with ResHacker ...

... in the Menu -> Action -> New Resource.

How I would call it in the Script ..., hmmm ...

... I have to study the Link from above at first, it looks like a solution, doesn't it ?

Greetz

I understand that files can be added like I did with ICO's, but I haven't investigated how to use included resources other than icons directly in a AutoIt3 script.

:whistle:


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I understand that files can be added like I did with ICO's, but I haven't investigated how to use included resources other than icons directly in a AutoIt3 script.

:whistle:

Maybe answer is to use LoadLibrary and LoadImage API functions and STM_SETIMAGE message.

It's for DLL resources, so I don't know if it works also for resources in EXE.

Look at these posts by Larry:

http://www.autoitscript.com/forum/index.ph...st&p=242546

http://www.autoitscript.com/forum/index.ph...st&p=339072

Edited by Zedna

Share this post


Link to post
Share on other sites

Maybe a look in the PE Header would bring a little more light in this case ?!

How is a resource (i.e. an icon) called by the exe ..., that should be visible in the PE Section Header, am I wrong ?

But I never used a PE viewer up to now ... :whistle:

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Maybe a look in the PE Header would bring a little more light in this case ?!

How is a resource (i.e. an icon) called by the exe ..., that should be visible in the PE Section Header, am I wrong ?

But I never used a PE viewer up to now ... :whistle:

The question on the table isn't really how to add a resource, but how to use it from Autoit3 once it is in there.

So my question to you to figure out after you added an BMP manually to the EXE : How do you want to use this resource in your Script ? (More or less like the example I included in the SciTE4AutoIt3 helpfile for Icons.

My reason for asking is that I am not going to invest time in adding functionality to AutoIt3Wrapper when its not "simple" to use it for the average scripter.

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

The question on the table isn't really how to add a resource, but how to use it from Autoit3 once it is in there.

So my question to you to figure out after you added an BMP manually to the EXE : How do you want to use this resource in your Script ? (More or less like the example I included in the SciTE4AutoIt3 helpfile for Icons.

My reason for asking is that I am not going to invest time in adding functionality to AutoIt3Wrapper when its not "simple" to use it for the average scripter.

I want to use it for SplashImageOn(@ScriptFullPath, $x), like the same way in the helpfile example for icons...

As the case maybe for GUICtrlCreatePic and something like that. :lmao:

In the attachment below is my Template Script for which I could need it ... :whistle:

Share this post


Link to post
Share on other sites

I want to use it for SplashImageOn(@ScriptFullPath, $x), like the same way in the helpfile example for icons...

As the case maybe for GUICtrlCreatePic and something like that. :lmao:

In the attachment below is my Template Script for which I could need it ... :whistle:

Somehow I don't seem to make myself clear to you.... ;)

I am not going to investigate and solve it for you and I have the impression you think I am.

If you have a process how to do it and it is something that could be used by a larger population, I will consider putting support for it in AutoIt3Wrapper like I did for Icons.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Have you looked at these links? ???

???

???

Lar.

I don't understand what you mean.

Add BMP to EXE as resource can be done by ResHacker or by compiler directives if JDeB will add them in the future.

These links shows Larry's SetBitmapResourceToPicCtrl() function which get resources from DLL and maybe can be used also for get resources from EXE.

I didn't tested it so I don't know if it's possible (get resources also from EXE and not only from DLL).

Edited by Zedna

Share this post


Link to post
Share on other sites

@JdeB

Sorry, my english isn't as well as your's ... . But I think I'm savvy it now.

Naturally you shouldn't solve the problem for me. But to make this an optional Feature for easy use in AutoIt, it have to be implemented in the Source Code of AutoIt, just like somebody did it for the Icons.

Sadly I'm not yet able to code in C++. :lmao:

@Larry

I've taken a look at the Function you created ... :whistle: . Awesome !

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

@JdeB

Sorry, my english isn't as well as your's ... . But I think I'm savvy it now.

Naturally you shouldn't solve the problem for me. But to make this an optional Feature for easy use in AutoIt, it have to be implemented in the Source Code of AutoIt, just like somebody did it for the Icons.

Sadly I'm not yet able to code in C++. :lmao:

I wasn't talking about you creating an internal function in AutoIt3, but thought you knew of a solution to use BMP's included in the program resources in the current autoit3 version either direct or by means of DllCall() s ....

I think your English is pretty good by the way ... for me its also my second language and I know some that think Iam lousy at it :whistle:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

The question on the table isn't really how to add a resource, but how to use it from Autoit3 once it is in there.

So my question to you to figure out after you added an BMP manually to the EXE : How do you want to use this resource in your Script ? (More or less like the example I included in the SciTE4AutoIt3 helpfile for Icons.

My reason for asking is that I am not going to invest time in adding functionality to AutoIt3Wrapper when its not "simple" to use it for the average scripter.

JdeB what do you think about this my proposition for new general AutoIt3Wrapper resource directives?

#AutoIt3Wrapper_Res_Add=filename1.res

and/or

#AutoIt3Wrapper_Res_Data_Add=filename1.txt,RT_RCDATA,res_name1

It could be also used for Larry's LoadImage examples from here and here - SetBitmapResourceToPicCtrl()

Edited by Zedna

Share this post


Link to post
Share on other sites

Awesome !

Great work, Zedna!

My dreams come true with this UDF, now I'm very delighted, folks ! :P

My own trials all ended in a desaster ...

Thank you very much Zedna and specially JdeB for embedding it to the Wrapper !

I take my hat off to both of you !Posted Image

Greetz

Greenhorn

Share this post


Link to post
Share on other sites

Awesome !

Great work, Zedna!

My dreams come true with this UDF, now I'm very delighted, folks ! :P

My own trials all ended in a desaster ...

Thank you very much Zedna and specially JdeB for embedding it to the Wrapper !

I take my hat off to both of you !Posted Image

Greetz

Greenhorn

I'm glad you like it ;)

Have fun with it.

There is missing support for JPGs but I havent so much time to work on it,

and my first attempt to do it didn't work as I expected so don't expect some early new versions.

If there is somebody skilled in GDI+ then I will be glad to see some progress on it from anybody.

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  
Followers 0