Forums > MaxMSP

pop up images

February 6, 2008 | 4:42 pm

Is there anyway to create a pop up window to display an image? I have a picture of an instrument and id like it so that when the user moves their mouse over a particular part of the instrument it will open a pop up window showing a more detailed picture. So right now i have a flute and, for example, i would like it so that when the user moves their mouse over the mouthpiece a picture pops up showing the mouthpiece in more detail.

I’ve tried experimenting with mousestate and mapping the horizontal and vertical values to trigger the pcontrol object but these values change when you move the patcher window (which is no good!)

Thanks

Stefan


February 6, 2008 | 10:08 pm

maybe you should give lcd a try , you can import/display images,
qucik and dirty example :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 14 359 94 196617 bgcolor 200 0 120;
#P newex 280 160 40 196617 unpack;
#P newex 153 214 350 196617 if $i1>=0 && $i1< = 20 && $i2>=0 && $i2< = 20 then open else out2 close;
#P message 52 188 58 196617 109 62;
#P newex 52 167 61 196617 prepend set;
#P hidden message 171 67 84 196617 idle 1 , pensize 0;
#P hidden newex 370 39 48 196617 loadbang;
#P hidden newex 370 57 40 196617 t b b b;
#P hidden message 172 48 139 196617 drawpict flutes 0 0 128 128;
#P hidden message 171 30 120 196617 readpict flutes chilis.jpg;
#P user lcd 13 31 128 128 1 1 1 0 0;
#N vpatcher 70 63 273 191;
#P window setfont "Sans Serif" 9.;
#P hidden newex 43 95 94 196617 bgcolor 256 256 0;
#P hidden inlet 14 98 15 0;
#P window setfont "Sans Serif" 14.;
#P comment 16 47 157 196622 check my magic flute;
#B frgb 232 0 201;
#P pop;
#P newobj 299 282 24 196617 p :);
#P newex 299 262 47 196617 pcontrol;
#P comment 173 104 199 196617 check in the left top corner…;
#P connect 1 0 2 0;
#P hidden connect 4 0 3 0;
#P hidden connect 5 0 3 0;
#P hidden connect 8 0 3 0;
#P connect 9 0 10 0;
#P fasten 11 0 1 0 158 250 304 250;
#P connect 12 0 11 0;
#P connect 12 1 11 1;
#P fasten 11 1 1 0 498 250 304 250;
#P connect 3 1 12 0;
#P connect 3 1 9 0;
#P hidden connect 7 0 6 0;
#P hidden connect 6 0 8 0;
#P hidden connect 6 1 5 0;
#P hidden connect 6 2 4 0;
#P window clipboard copycount 14;


February 6, 2008 | 10:19 pm

:) fantastic! thanks a lot for your help very much appreciated. i’ll experiment with this.


February 6, 2008 | 10:46 pm

i dont have the time to patch it but have a look at jasch?s "posit"
object and combine it with mousestate to get position data independent
from the patcherwindow position and "thispatcher" to define your pop up
image
p

Stefan Scheuregger wrote:
> Is there anyway to create a pop up window to display an image? I have a picture of an instrument and id like it so that when the user moves their mouse over a particular part of the instrument it will open a pop up window showing a more detailed picture. So right now i have a flute and, for example, i would like it so that when the user moves their mouse over the mouthpiece a picture pops up showing the mouthpiece in more detail.
>
> I’ve tried experimenting with mousestate and mapping the horizontal and vertical values to trigger the pcontrol object but these values change when you move the patcher window (which is no good!)
>
> Thanks
>
> Stefan
>
>
>
>
>
>


http://pure.test.at

http://www.heartchamberorchestra.org


February 7, 2008 | 12:54 am

i know i said i dont have the time…

based on karl-otto´s patcher…

karl-otto von oertzen wrote:
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 152 263 60 196617 loadmess 1;
> #P number 208 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 163 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 216 506 27 196617 +;
> #P newex 166 505 27 196617 +;
> #P newex 154 307 62 196617 metro 200;
> #P toggle 154 445 15 0;
> #P number 244 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 199 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 154 408 193 196617 mousestate;
> #B color 5;
> #P toggle 154 286 15 0;
> #P newex 14 359 94 196617 bgcolor 200 0 120;
> #P newex 280 160 40 196617 unpack;
> #P newex 153 214 350 196617 if $i1>=0 && $i1< = 20 && $i2>=0 && $i2< = 20 then open else out2 close;
> #P message 52 188 58 196617 74 5;
> #P newex 52 167 61 196617 prepend set;
> #P hidden message 171 67 84 196617 idle 1 , pensize 0;
> #P hidden newex 370 39 48 196617 loadbang;
> #P hidden newex 370 57 40 196617 t b b b;
> #P hidden message 172 48 139 196617 drawpict flutes 0 0 128 128;
> #P hidden message 171 30 120 196617 readpict flutes chilis.jpg;
> #P user lcd 13 31 128 128 1 1 1 0 0;
> #N vpatcher 858 341 1058 541;
> #P window setfont "Sans Serif" 9.;
> #P newex 181 106 66 196617 pack 0 0 0 0;
> #P inlet 284 35 15 0;
> #P inlet 236 32 15 0;
> #P window linecount 1;
> #P newex 283 64 37 196617 + 200;
> #P window linecount 0;
> #P newex 235 64 37 196617 + 200;
> #P window linecount 1;
> #P message 217 136 190 196617 window size $1 $2 $3 $4 , window exec;
> #P window linecount 0;
> #N thispatcher;
> #Q end;
> #P newobj 190 186 61 196617 thispatcher;
> #P hidden newex 43 95 94 196617 bgcolor 256 256 0;
> #P hidden inlet 14 98 15 0;
> #P window setfont "Sans Serif" 14.;
> #P comment 16 47 157 196622 check my magic flute;
> #B frgb 232 0 201;
> #P connect 7 0 9 0;
> #P connect 4 0 3 0;
> #P connect 8 0 9 1;
> #P connect 5 0 9 2;
> #P connect 9 0 4 0;
> #P connect 7 0 5 0;
> #P connect 6 0 9 3;
> #P connect 8 0 6 0;
> #P pop;
> #P newobj 299 282 57 196617 p :);
> #P newex 299 262 47 196617 pcontrol;
> #P comment 173 104 199 196617 check in the left top corner…;
> #P connect 24 0 14 0;
> #P connect 21 0 23 0;
> #P connect 21 0 2 2;
> #P connect 20 0 22 0;
> #P connect 20 0 2 1;
> #P connect 12 1 21 0;
> #P connect 12 1 11 1;
> #P connect 17 0 21 1;
> #P connect 12 0 11 0;
> #P connect 12 0 20 0;
> #P connect 16 0 20 1;
> #P connect 14 0 19 0;
> #P connect 19 0 15 0;
> #P connect 15 0 18 0;
> #P connect 15 1 16 0;
> #P connect 15 2 17 0;
> #P hidden connect 6 2 4 0;
> #P hidden connect 6 1 5 0;
> #P hidden connect 6 0 8 0;
> #P hidden connect 7 0 6 0;
> #P connect 3 1 9 0;
> #P connect 3 1 12 0;
> #P fasten 11 1 1 0 498 250 304 250;
> #P fasten 11 0 1 0 158 250 304 250;
> #P connect 9 0 10 0;
> #P hidden connect 8 0 3 0;
> #P hidden connect 5 0 3 0;
> #P hidden connect 4 0 3 0;
> #P connect 1 0 2 0;
> #P window clipboard copycount 25;
>
>
>
> –
> karrrlo
>
>
>
>


http://pure.test.at

http://www.heartchamberorchestra.org


February 7, 2008 | 10:09 am

Much appreciated pure. I’ll give these a try


February 8, 2008 | 4:02 pm

Quote: pure wrote on Thu, 07 February 2008 00:54
—————————————————-
> i know i said i dont have the time…
>
> based on karl-otto´s patcher…
>
> karl-otto von oertzen wrote:
> > #P window setfont "Sans Serif" 9.;
> > #P window linecount 1;
> > #P newex 152 263 60 196617 loadmess 1;
> > #P number 208 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> > #P number 163 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> > #P newex 216 506 27 196617 +;
> > #P newex 166 505 27 196617 +;
> > #P newex 154 307 62 196617 metro 200;
> > #P toggle 154 445 15 0;
> > #P number 244 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> > #P number 199 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> > #P newex 154 408 193 196617 mousestate;
> > #B color 5;
> > #P toggle 154 286 15 0;
> > #P newex 14 359 94 196617 bgcolor 200 0 120;
> > #P newex 280 160 40 196617 unpack;
> > #P newex 153 214 350 196617 if $i1>=0 && $i1< = 20 && $i2>=0 && $i2< = 20 then open else out2 close;
> > #P message 52 188 58 196617 74 5;
> > #P newex 52 167 61 196617 prepend set;
> > #P hidden message 171 67 84 196617 idle 1 , pensize 0;
> > #P hidden newex 370 39 48 196617 loadbang;
> > #P hidden newex 370 57 40 196617 t b b b;
> > #P hidden message 172 48 139 196617 drawpict flutes 0 0 128 128;
> > #P hidden message 171 30 120 196617 readpict flutes chilis.jpg;
> > #P user lcd 13 31 128 128 1 1 1 0 0;
> > #N vpatcher 858 341 1058 541;
> > #P window setfont "Sans Serif" 9.;
> > #P newex 181 106 66 196617 pack 0 0 0 0;
> > #P inlet 284 35 15 0;
> > #P inlet 236 32 15 0;
> > #P window linecount 1;
> > #P newex 283 64 37 196617 + 200;
> > #P window linecount 0;
> > #P newex 235 64 37 196617 + 200;
> > #P window linecount 1;
> > #P message 217 136 190 196617 window size $1 $2 $3 $4 , window exec;
> > #P window linecount 0;
> > #N thispatcher;
> > #Q end;
> > #P newobj 190 186 61 196617 thispatcher;
> > #P hidden newex 43 95 94 196617 bgcolor 256 256 0;
> > #P hidden inlet 14 98 15 0;
> > #P window setfont "Sans Serif" 14.;
> > #P comment 16 47 157 196622 check my magic flute;
> > #B frgb 232 0 201;
> > #P connect 7 0 9 0;
> > #P connect 4 0 3 0;
> > #P connect 8 0 9 1;
> > #P connect 5 0 9 2;
> > #P connect 9 0 4 0;
> > #P connect 7 0 5 0;
> > #P connect 6 0 9 3;
> > #P connect 8 0 6 0;
> > #P pop;
> > #P newobj 299 282 57 196617 p :);
> > #P newex 299 262 47 196617 pcontrol;
> > #P comment 173 104 199 196617 check in the left top corner…;
> > #P connect 24 0 14 0;
> > #P connect 21 0 23 0;
> > #P connect 21 0 2 2;
> > #P connect 20 0 22 0;
> > #P connect 20 0 2 1;
> > #P connect 12 1 21 0;
> > #P connect 12 1 11 1;
> > #P connect 17 0 21 1;
> > #P connect 12 0 11 0;
> > #P connect 12 0 20 0;
> > #P connect 16 0 20 1;
> > #P connect 14 0 19 0;
> > #P connect 19 0 15 0;
> > #P connect 15 0 18 0;
> > #P connect 15 1 16 0;
> > #P connect 15 2 17 0;
> > #P hidden connect 6 2 4 0;
> > #P hidden connect 6 1 5 0;
> > #P hidden connect 6 0 8 0;
> > #P hidden connect 7 0 6 0;
> > #P connect 3 1 9 0;
> > #P connect 3 1 12 0;
> > #P fasten 11 1 1 0 498 250 304 250;
> > #P fasten 11 0 1 0 158 250 304 250;
> > #P connect 9 0 10 0;
> > #P hidden connect 8 0 3 0;
> > #P hidden connect 5 0 3 0;
> > #P hidden connect 4 0 3 0;
> > #P connect 1 0 2 0;
> > #P window clipboard copycount 25;
> >
> >
> >
> > –
> > karrrlo
> >
> >
> >
> >
>
>
> —
> http://pure.test.at
> http://www.heartchamberorchestra.org
>
>
—————————————————-

Seem to be having a problem loading my own images to be displayed in lcd. Is it just a matter of replacing the file name in the readpict message box and making sure that the file is in Max’s search path? Im doing that and it does noting…


Viewing 7 posts - 1 through 7 (of 7 total)