Jump to content

Recommended Posts

Posted (edited)

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
Posted

  On 6/20/2010 at 4:12 PM, 'miketh2005 said:

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.

Posted

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.

Posted

  On 6/20/2010 at 6:21 PM, 'miketh2005 said:

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

Posted

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
Posted

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.

Posted

  On 6/21/2010 at 3:47 PM, 'miketh2005 said:

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.

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted (edited)

  On 6/21/2010 at 4:11 PM, 'Melba23 said:

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.

  On 6/21/2010 at 4:11 PM, 'Melba23 said:

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
  • Moderators
Posted

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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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