Jump to content

Recommended Posts

Posted

I want my picture to fit into a certain area

1) if I set the height and width of my pic control the picture still extends outside the borders.

2) Really what I would like is the ability to have the picture automatically resize to fit whatever size I make the control.

I read a couple of posts on it so I see other people are having issues but I didn't see any replys so sorry if it has already been discussed

Any thoughts?

red

Posted (edited)

I use next trick for now:

$picture = GUISetControl("pic", "picname.jpg", 20, 20)
                GUISetControl($picture, "picname.jpg", 20, 20, 100, 100)

Not very beautifull, but working.

If you need to keep aspect ratio of image and you don't know what aspect of image is, you can try my UDF for get image size and do needed calculations.

Edited by Kot
Posted

Alright If I try to update the pic control using GuiWrite I lose the size of the control that I once had.

-JPM I saw you were working on the pic control any plans to fix these two bugs?

red

Posted

Alright I figured out to not use guiwrite but to use guisetcontrol like Kot showed above, but still I think at least the initial setting could be considered a bug.

Posted

Alright I figured out to not use guiwrite but to use guisetcontrol like Kot showed above, but still I think at least the initial setting could be considered a bug.

<{POST_SNAPBACK}>

What is thereslt if the initial is
$picture = GUISetControl("pic", "picname.jpg", 20, 20,100,100)
Posted (edited)

You get the image, but it doesn't fit the width and height you specify. It stays the same with and height of the original image size.

Edited by redndahead
Posted

You get the image, but it doesn't fit the width and height you specify. It stays the same with and height of the original image size.

<{POST_SNAPBACK}>

can you attach the jpg your are using I will have a look why the first size does not do the job? :ph34r:
Posted

Here is the image

red

<{POST_SNAPBACK}>

Thanks I got the error (?) the pic creation was a cut and paste of Splash code and it is not working.

I change the way the sizing is done by a MoveWindow and now it works

I submit the correction to Jon :ph34r:

//  SetWindowPos(A,HWND_TOPMOST,X,Y,W,H,SWP_DRAWFRAME);
    MoveWindow(A,X,Y,W,H,TRUE);

Just a support question how do you attach Thumbnails?

Posted

You just attach any picture as a file and it inserts it as a thumbnail.  =)  Thanks for the change in code.

red

<{POST_SNAPBACK}>

Thanks for the thumbnail. I was thinking I try it and it was not working ... :ph34r:

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
×
×
  • Create New...