Sign in to follow this  
Followers 0
Shothic

Image in Dll

16 posts in this topic

Hi

I wrote the dll with image in delphi and I want to use this image from dll to auto it gui or something

Dll structure :

i000 BITMAP image.bmp

Dll :

ResDll.dll

Please Help

Share this post


Link to post
Share on other sites



You should be able to use it with the Resources-UDFs by Zedna


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

noo I don't understand this udf

I have the ResDll.res and ResDll.dll and how I drow the image from this files

Share this post


Link to post
Share on other sites

Shothic,

noo I don't understand this udf

What do you not understand about the UDF? It is the best way to get images from a DLL into your GUI, but it needs to be used correctly and looking at the time between posts you have not yet spent anywhere near long enough to get to grips with it. :huggles:

Why not post the code you have and perhaps the DLL so we can point you in the right direction? :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Shothic,

Seriously? You've not even downloaded it have you. There are plenty of examples showing only a few of the ways you can use the UDF.

Take some time to learn it. The resources are there plain and simple.

James

Share this post


Link to post
Share on other sites

Shothic,

What type of image have you put in your DLL? .bmp, .jpg. .png?

Download ResHacker from here and you will be able to check the resource name and type for the image within your DLL.

Then we can start to use the UDF and get your image into your GUI. :D

M23

P.S. Before I forget, using

While 1
Wend

is very bad coding practice as it will eat all your CPU cycles. Always have either a GUIGetMsg command or a Sleep(10) in there!


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I think this may be the correct use for you:

#include "GUIConstantsEx.au3"
#include "StaticConstants.au3"
#include "resources.au3"

$gui = GUICreate("example ",400,400)
$pic1 = GUICtrlCreatePic("",0,0,400,150)

; set image to picture control from external DLL resource
_ResourceSetImageToCtrl($pic1, "#17", $RT_BITMAP, @ScriptDir & "\ResDll.dll")

GUISetState(@SW_SHOW)

While 1
 If GUIGetMsg() = -3 Then Exit
Wend
Edited by Zedna

Share this post


Link to post
Share on other sites

In reshacker :

Posted Image

Creating Dll :

In ResDll.RC i000 BITMAP image.bmp >> ResDll.res >>>> ResDll.Dll

Image is bmp

Thx For help but what next?

Share this post


Link to post
Share on other sites

#include "GUIConstantsEx.au3"

#include "StaticConstants.au3"

#include "resources.au3"

$gui = GUICreate("example ",400,400)

$pic1 = GUICtrlCreatePic("",0,0,400,150)

; set image to picture control from external DLL resource

_ResourceSetImageToCtrl($pic1, "#17", $RT_BITMAP, @ScriptDir & "\ResDll.dll")

GUISetState(@SW_SHOW)

While 1

If GUIGetMsg() = -3 Then Exit

Wend

No it does not work

In Delphi is working

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Shothic,

Ok, the resource is a bitmap called "1000". Try this:

#include "GUIConstantsEx.au3"
#include "StaticConstants.au3"
#include "resources.au3"

$gui = GUICreate("example ",400,400)
$pic1 = GUICtrlCreatePic("",0,0,400,150)

; set image to picture control from external DLL resource
_ResourceSetImageToCtrl($pic1, "1000", $RT_BITMAP, @ScriptDir & "\ResDll.dll")

GUISetState(@SW_SHOW)

While 1
 If GUIGetMsg() = -3 Then Exit
Wend

M23

Edit: Zedna, apologies - I had not seen your post.

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Zedna,

Well spotted - it is my old eyes you know! :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks Zedna And M23 ALL works great

And

I'll check it to imageserch.au3

THX :D:

Share this post


Link to post
Share on other sites

grrrr

I don't know why it don't want to work in imageserch

#include "GUIConstantsEx.au3"
#include "StaticConstants.au3"
#include "resources.au3"
#include "ImageSearch.au3"

$gui = GUICreate("example ",400,400)
$pic1 = GUICtrlCreatePic("",20,20,400,150)


; set image to picture control from external DLL resource
$pic = _ResourceSetImageToCtrl($pic1, "i000", $RT_BITMAP, @ScriptDir & "\ResDll.dll")
GUISetState(@SW_SHOW)

$image = _ResourceGetAsImage ("i000", $RT_BITMAP, @ScriptDir & "\ResDll.dll")

HotKeySet ( "{End}" , "Terminate" )

While 1
$x1=0
$y1=0

 If GUIGetMsg() = -3 Then Exit

$result1 =  _ImageSearch($image,1,$x1,$y1,0)
IF $result1=1 Then
MouseClick("left",$x1,$y1,1,1)


EndIf


Wend


Func Terminate()
Exit 0
EndFunc

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

grrrr

I don't know why it don't want to work in imageserch

ImageSearch doesn't support use of images in memory. It supports only images on disc (you must use absolute path to image on disc).

You can read all of this in ImageSearch topic., see this my post about it:

#727357

Edited by Zedna

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