Sign in to follow this  
Followers 0
redndahead

Pic control

13 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

Thanks it works great, but that is the strangest work around that I have ever seen. :ph34r:

red

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#7 ·  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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

Here is the image

red

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

red

Share this post


Link to post
Share on other sites

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:

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