Dynamically changing values displayed on GUI
이전 댓글 표시
Hi, I am well conversant with making basic MATLAB GUI. However, I want some specialized features as follows: 'As a user slides the slider, I want a bucket to get filled with water'. Hence, if the user slides to 50% of total slider value, the bucket must dynamically change the level of water and show the bucket to be half full.
Any suggestions to accomplish this and integrate such dynamic objects on GUI screen?
댓글 수: 7
Walter Roberson
2012년 5월 4일
What shape is the bucket, and what representation should be used for the water? Is a line at the water level enough, or does it need to be a nice water-blue filling inside of an irregular bucket shape? Are ripples in the water mandatory? Refraction of the light at the air-water boundary? Fish in the water? Sediment has to swirl around? The occasional rubber ducky?
Jan
2012년 5월 4일
This is a vague question yet. What exactly is "a bucket"? And how should the filling look like? What have you tried so far and which problems have occurred?
Walter Roberson
2012년 5월 4일
Me? Well, I did some research, but the smallest rubber-duck icon I could find was 32 pixels by 32 pixels. But I need an opinion on that: is the 17 x 17 pixel duck at The World's Smallest Web-Site a rubber duck or not? http://www.guimp.com/sc_korsun_duck.html
ANUBHAV SINHA
2012년 5월 4일
ANUBHAV SINHA
2012년 5월 4일
Walter Roberson
2012년 5월 5일
How realistic does the bucket have to look? Like is a plain rectangle good enough? A trapazoid? Does it have to look like a traditional wooden bucket like http://4.bp.blogspot.com/-YciJsaGk2oI/TWsxVFG2leI/AAAAAAAAAEk/3qlIXRAyv3U/s1600/WoodenBucket3DModelZoom.jpg
ANUBHAV SINHA
2012년 5월 5일
채택된 답변
추가 답변 (1개)
Image Analyst
2012년 5월 4일
How about you take photos of a bucket with 100 different levels of water. Then you set the slider to go from 0-100. When the user slides the slider, you get the number, and recall the corresponding image and display it?
sliderValue = int32(get(handles.slider, 'Value'));
baseFileName = sprintf(image_%d.PNG', sliderValue);
fullFileName = fullfile(folder, baseFileName);
if exists(fullFileName , 'file')
imshow(fullFileName);
end
Or else use patch() and do it on a computer graphics simulated bucket.
댓글 수: 2
ANUBHAV SINHA
2012년 5월 4일
Image Analyst
2012년 5월 5일
To see 1000 levels, at one row of pixels on your monitor, you'd need at least 1000 lines on your monitor. That doesn't leave much space for the rest of your GUI. But anyway, you can use patch. See my demo code in another Answer here.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!