Note:
Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation.
To learn more about these changes please visit the announcement which can be found
HERE.
Is there a way to find the width of a shape? The ImageList class has the GetWidthOfImage, but there's no equivalent in the Shapes class.
I've only been playing with SB for almost a week now, so forgive me if this is trivial.
What I am attempting to do is to load an image into a Shape object, zoom it and then find the width of that Shape image.
Maybe there's a better way to do what I'm attempting. Is there a way to resize an ImageList image before stuffing it into a Shape object (has to be a Shape so I can move it).
Thanks in advance for any help.
The program I'm writting is: GTK593
(BTW, is there a way to get a permanent publish ID?)
Changed TypeaadamsThursday, October 29, 2009 4:12 AMIt was really a question
I think the easiest way is to programatically keep track of the Zoom scaling - this would also be faster than constantly calling a GetWidth type function even if it existed for Shapes.
For example the ball scaling is held in variable ballScale and the width/height can be calculated from this and the original image dimensions: ballImage = ImageList.LoadImage("http://icons.iconarchive.com/icons/fasticon/world-cup-2006/ball-icon.jpg") ballWidth = ImageList.GetWidthOfImage(ballImage) ballHeight = ImageList.GetHeightOfImage(ballImage) ball = Shapes.AddImage(ballImage) Shapes.Move(ball,(GraphicsWindow.Width-ballWidth)/2,(GraphicsWindow.Height-ballHeight)/2) 'Center the ball
For ballScale = 0.1 To 10 Step 0.1 Shapes.Zoom(ball,ballScale,ballScale) GraphicsWindow.Title = "Image width is "+ballScale*ballWidth Program.Delay(100) EndFor
I think the publish IDs are pretty permanemt - sometimes the 'sample of the month' gets a special ID set by Vijaye such as 'ASTEROIDS'.
BTW, this thread is really a question, and the 'getOpacity' is more of a discussion or observation rather than question - there is also a sticky thread for reporting Bugs (so they don't get overlooked).
Marked As Answer byaadamsThursday, October 29, 2009 4:12 AM
Oh, and as for the publish ID's. What's happening for me is each time I publish it gives me a new ID. So if I want to share it with others, I have to re-announce the ID. I was hoping there was a way to have an ID stick so that my friends, kids, students, etc... would always have the latest and greatest.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.