Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interactive Image Manipulation

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
I've come across a very odd one today.
I added an image for company logos to be displayed. But then I find some look weird in the block, as people do a lot of strange things with logos.

So I decided to add a radio button next to it that allows the user to change the visible image using the Stretch property.

In the click event of the radio button I put in:

Code:
DO CASE
	CASE This.Value = 1
		This.Parent.imgCompanyLogo.Stretch = 0
	CASE This.Value = 2
		This.Parent.imgCompanyLogo.Stretch = 1
	CASE This.Value = 3
		This.Parent.imgCompanyLogo.Stretch = 2
ENDCASE

Where the "weirdness" begins is, if I have a logo on the screen, and I push the first radio button ("Natural") then it sets the property to "0 - Clip" (default), but I have defaulted the image to 1 initially - Isometric.

What is odd is, if I start at the bottom, and click the lowest radio button first, the image appearance changes to Stretch (as it should). Then I click the 2nd radio button, and it changes to Isometric, as it should. Then I click the 1st radio button and it presents the image as "natural" (clipped if too big to fit in the object). So, that's all fine. BUT now if I click bottom radio button again, it's "sticks" on "Clipped". If I start the order of this sequence from first to last then once it gets set to "clipped" it never moves off it again...
Any idea what could be causing this?

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Ah....
I figured this out.

What happens is, the size of the image at the time it is placed onto the form "is what it is".
If you then change the property from "Stretch" to "Clip", and the "Clip" image is larger than the Stretch, then all image relationships are to THOSE dimensions. So once you pick the "Clip", all further changes are in relation to THAT set of dimensions of the image, so any attempt to "stretch" it just yields the same image size. This is because the image takes on the dimension properties of the file selected. It does not keep them "fixed" to the size they were when you put the control on the form, unlike say a command button or a Shape...

So now I know the "why", but I've really no idea how to fix it... suggestions anyway?


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
LOL... so it seems I managed to answer my own question.

On the Radio button's click event the first thing I do is keep the image height and width constant by issuing:

Code:
This.Parent.imgControl.Height = <my height>
This.Parent.imgControl.Width = <my width>

So before the application of the change of "stretch" is made, the image size is always fixed in relation to the command, and not the actual size of the image in file.

I have discovered that "Isometric" is the best choice in most cases.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Please Scott - can't you loose the animated gif in your signature?
It's really annoying when trying to concentrate on your writings [3eyes]
 
A I've had this signature on Tek-Tips for over a decade, and you're the first to complain about it. :)

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Actually, a quick check shows... it's been my signature for over 14 years on here.
I started using the site in July of 2001!


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Interesting that you had no complaint in 14 years, and now two come along at once. That's the way it goes, I guess.

Actually, I wasn't complaining. Because I've always disabled animations, it's never been a problem for me. Maybe others do the same.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I never gave it any thought...
I like my guy pounding the other guy on the head with a hammer. :)
Giff has the typ-ie keyboard animated icon as well. I remember when Tek-Tips introduced them. I guess they were novel back then, I've never thought twice about them since.

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Funny but until you mentioned (Dr Dolittle) it I never realized I have for years been using that as a visual cue in my TT postings and responses, it makes it very easy to identify "mine" without having to read through a lot of stuff (i.e. I can see latest response since my last post in a thread). So sorry to disappoint but I'm going to leave them. They (for me) are actually very useful speed element.

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
To disable animations in Firefox, first navigate to about:config. The search for animat. This will show all the config entries with that string in the name. One of these is image.animation_mode. Double-click it and set its value to none.

This stops several types of animations, not just GIFs. Browse around settings with similar names to see what else you can change.

(Actually, the best thing you can do is to install FlashBlock. This kills all those horrendous Flash animations and videos cold dead - except any that you choose to override.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
FWIW, I've always found the animated signature annoying, but not enough to comment on it until someone else did.

But I also find religious messages in signatures annoying and I don't comment on those either.

Tamar
 
But I also find religious messages in signatures annoying and I don't comment on those either.

Blatant "political" too, and I normally wouldn't comment either.
 
Funny, I never comment on signatures. I'm kind of baffled how I started this trend.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top