Jump to content

How to put in image in an iframe in a GUI, but with no frame?


Recommended Posts

Hi, what I'm wanting to do is a little complicated.

An Image I have is too big to fit in my GUI (resizing the GUI is not an option), so I need to put an image in an iframe, with a scroll bar, but at the same time, I don't want the image to LOOK like it's in an iframe, so we no borders around it. Just a scroll bar at the side.

Anyway to do this?

Thanks!

EDIT: Woot! 100th post! :mellow:

Edited by miketh2005
Link to comment
Share on other sites

Hi, what I'm wanting to do is a little complicated.

An Image I have is too big to fit in my GUI (resizing the GUI is not an option), so I need to put an image in an iframe, with a scroll bar, but at the same time, I don't want the image to LOOK like it's in an iframe, so we no borders around it. Just a scroll bar at the side.

Anyway to do this?

Thanks!

EDIT: Woot! 100th post! :mellow:

an iFrame? If you're embedding HTML then css 'border:none;' should do it I would have thought.

If its a windows control then just change the styles. WS_BORDER, WS_EX_CLIENTEDGE etc. should be removed.

Link to comment
Share on other sites

Umm, I didn't know you can imbed html? I was just reffering to an iframe as an example.. I want an image to be in a frame that the user can scroll down to see the rest on the image :mellow:

Anyway to do that?

Thanks.

You might want to try out this. I haven't tried it, so I can't give you details about implementation, but it looks like it does exactly what it says on the tin.

Iframes are an option, although you don't actually need them, you can just put an img tag in an ie object and size the object. Not sure about frames etc. but there is plenty of support for the ie udf on the forums.

Open the helpfile and go here:

User Defined Function Reference -> IE Management -> _IECreateEmbedded

As a general rule, the IE functions are very well documented and support on the forums are great (more so than other UDF's). The example under that function should get you on your way, but other functions such as _IEDocWriteHTML are also relevant.

Mat

Link to comment
Share on other sites

Ok. I tried the Scrollbars UDF, and it's pretty simple stuff.

#include <GUIScrollbars_Ex.au3>

; It is possible to get the width and height dynamically using GDIPlus.au3
$sImg = "image.jpg"
$iImgW = 1680
$iImgH = 1050

; Create GUI
$hGUI = GUICreate("Image", 400, 400, 100, 100)
$hImage = GUICtrlCreatePic($sImg, 0, 0, $iImgW, $iImgH)

; Generate scrollbars
_GUIScrollbars_Generate($hGUI, $iImgW, $iImgH, 0, 0, True)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

Thanks alot mat! It was PERFECT just PERFECT, I made an exact replica, and I would've never been able to do it without your help! I really appreciate it, and if I get my money back from paypal, I'll pay you 20 bucks for helping out around the forum like this.

Link to comment
Share on other sites

Thanks alot mat! It was PERFECT just PERFECT, I made an exact replica, and I would've never been able to do it without your help! I really appreciate it, and if I get my money back from paypal, I'll pay you 20 bucks for helping out around the forum like this.

Thank Melba, he did the hard work there.

Link to comment
Share on other sites

  • Moderators

Mat,

Thanks for that - very civil of you! :mellow:

I noticed you had this is your code:

; It is possible to get the width and height dynamically using GDIPlus.au3
$sImg = "image.jpg"
$iImgW = 1680
$iImgH = 1050

The answer is "Yes" and you do it like this: :P

$sFile = "image.jpg"

_GDIPlus_Startup()

$hImage = _GDIPlus_ImageLoadFromFile($sFile)

$iX = _GDIPlus_ImageGetWidth($hImage)
$iY = _GDIPlus_ImageGetHeight($hImage)

_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

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

Thanks for that - very civil of you! :mellow:

No problems :P I wasn't about to take all the credit for writing an example of a much bigger UDF.

I noticed you had this is your code:

; It is possible to get the width and height dynamically using GDIPlus.au3

The answer is "Yes" and you do it like this: :party:

But it wasn't a question... It was a statement :party: I knew it was possible but I couldn't be asked to try and find the snippet. Edited by Mat
Link to comment
Share on other sites

  • Moderators

Mat,

Old age I am afraid - I read it as "Is it" and not "It is". :mellow:

Must clean my glasses....now where did I put my handkerchief...........mumble, mumble..... :P

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

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...