Jump to content

Image in Dll


Shothic
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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!

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

Zedna,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...