Trim Image
If anybody needs to trim images in Rev I wrote this code. In my Mac PPC and OSX it works. (Thanks Kevin for your article about Mask data) As you can see I resized the image before triming in order to speed up the process. I wuold like to blend two images with transparent backgrounds and get one single image. I know i can use the "import snapshot" command, but I would like to blend the images off-screen. Any suggestions? Thanks, Paolo >>> local NNN on MouseUp put the ID of the last image into NNN put trunc((the width of image ID NNN)/10) into XX put trunc((the height of image ID NNN) /10) into YY clone image ID NNN set the width of the last image to XX set the height of the last image to YY put (XX*YY) into TOTPIXY repeat with VAL=1 to TOTPIXY if chartonum(char VAL of the maskData of the last image) <> 0 then put trunc(VAL/XX) into NORD exit repeat end if end repeat repeat with VAL=TOTPIXY down to 1 if chartonum(char VAL of the maskData of the last image) <> 0 then put trunc(VAL/XX) into SUD put YY-SUD-1 into SUD exit repeat end if end repeat put (NORD*10) & comma & (SUD*10) & comma & (CONTROLLODX(XX,YY) *10) & comma & (CONTROLLOSX(XX,YY)*10) into COORDINATE delete last image -- put COORDINATE into message CANCELLARIGHE COORDINATE beep 1 end MouseUp function CONTROLLODX XX,YY repeat with Q=1 to XX repeat with K=0 to (YY-1) put Q+(K*XX) into VAL if chartonum(char VAL of the maskData of the last image) <> 0 then return (Q-1) exit CONTROLLODX end if end repeat end repeat end CONTROLLODX function CONTROLLOSX XX,YY repeat with Q=XX down to 1 repeat with K=(YY-1) down to 0 put Q+(K*XX) into VAL if chartonum(char VAL of the maskData of the last image) <> 0 then put XX-Q-1 into Q return Q exit CONTROLLOSX end if end repeat end repeat end CONTROLLOSX on CANCELLARIGHE COORDINATE put the MaskData of image ID NNN into TheMaskData1 put the imagedata of image ID NNN into Theimagedata1 put the width of image ID NNN into XXX put the height of image ID NNN into YYY -- riduzione NORD put item 1 of COORDINATE into VAR1 put XXX*YYY into TOTVAR put 4*XXX*YYY into TOTVAR4 put VAR1*XXX into TOTVAR1 delete char 1 to TOTVAR1 of TheMaskData1 put TOTVAR1*4 into TOTVAR1 delete char 1 to TOTVAR1 of Theimagedata1 put (YYY-VAR1) into YYY -- riduzione SUD put item 2 of COORDINATE into VAR1 put XXX*YYY into TOTVAR put 4*XXX*YYY into TOTVAR4 put VAR1*XXX into TOTVAR1 delete char (TOTVAR-TOTVAR1+1) to TOTVAR of TheMaskData1 put TOTVAR1*4 into TOTVAR1 delete char (TOTVAR4-TOTVAR1+1) to TOTVAR4 of Theimagedata1 put (YYY-VAR1) into YYY -- riduzione EST-OVEST put empty into TheMaskData2 put empty into Theimagedata2 put item 3 of COORDINATE into VarEst put item 4 of COORDINATE into VarWest put XXX-VarEst-VarWest into FASCIA repeat with M=0 to (YYY-1) repeat with K=(VarEst+1) to (XXX-VarWest) put K+(M*XXX) into NUM2 put char NUM2 of TheMaskdata1 after TheMaskdata2 put (NUM2-1)*4 into NUM2 put NUM2+1 into NUM2 put char NUM2 of Theimagedata1 after Theimagedata2 put NUM2+1 into NUM2 put char NUM2 of Theimagedata1 after Theimagedata2 put NUM2+1 into NUM2 put char NUM2 of Theimagedata1 after Theimagedata2 put NUM2+1 into NUM2 put char NUM2 of Theimagedata1 after Theimagedata2 end repeat end repeat -- put length(TheMaskData2) && length(Theimagedata2)/4 into message if length(TheMaskData2) is length(Theimagedata2)/4 then put empty into image ID NNN set the width of image ID NNN to FASCIA set the height of image ID NNN to YYY set the MaskData of image ID NNN to TheMaskData2 set the imagedata of image ID NNN to Theimagedata2 else beep 1 end if end CANCELLARIGHE ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Get active user folder on macOS X ?
Hey-ya Ludovic Try this button script: on mouseUp put specialfolderpath ("Preferences") into lUserPath set the itemDel to "/" answer item 1 to -3 of lUserPath end mouseUp ... this script assumes that the last two items of the preferences folder contain something like "/System/Preferences", which is true in the current OSX system... so it works today, as long as Apple keeps Preferences in this spot for future OSX versions. The -3 is three items from the end. Bye! M@ Matt Denton > Subject: Get active user folder on macOS X ? > From: [EMAIL PROTECTED] (Ludovic > Th=?ISO-8859-1?Q?=E9?=bault) > Date: Fri, 20 Sep 2002 07:51:37 +0200 > Reply-To: [EMAIL PROTECTED] > > Hello, > > Is there a command to get the active user folder on macOS X (the Home > folder) ? ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: copy text
Yves, There has got to be a more graceful method, but this works for me... put thePath/to/theFile into tPath put URL("file:"&tPath) into fld "theTx" select the text of fld "theTx" doMenu "Copy" Roger Eller [EMAIL PROTECTED] > Hi, > > I've a text file and want to place the text in the clipboard > > put thePath/to/theFile into tPath > put URL("file:"&tPath) into theTx > > how can I place the text of theTx in the clipboard... ? > > (the goal is to paste it later in another software) > > Thanks. > -- > Greetings. > > Yves COPPE ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: copy text
Recently, "Yves Coppé" wrote: > I've a text file and want to place the text in the clipboard > > put thePath/to/theFile into tPath > put URL("file:"&tPath) into theTx > > how can I place the text of theTx in the clipboard... ? Not sure if there's an updated way to do this, but the old way is to paste the text into a field, select the text of the field, and copy. Regards, Scott Rossi Creative Director Tactile Media, Multimedia & Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
copy text
Hi, I've a text file and want to place the text in the clipboard put thePath/to/theFile into tPath put URL("file:"&tPath) into theTx how can I place the text of theTx in the clipboard... ? (the goal is to paste it later in another software) Thanks. -- Greetings. Yves COPPE Email : [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: (no subject)
Jerry, Yes, it is easy to do this. Any graphic image (gif, jpg, png, maybe others) that you import as a control, view it's properties and make a note of it's ID number. Then type into a script or the message box... set the backdrop to 1013 -- actual image ID number Roger Eller [EMAIL PROTECTED] Jerry Thomas <[EMAIL PROTECTED]> wrote > Dear Folks, > > Are additional pattern backgrounds avaiable for Revolution? There are > backgrounds available in the color pallete but they are from the days when > 16/256 color was all that was available. I'm looking for something kinder > and gentler -- Clouds, a pale off white soft texture, something easier on > the eyes and brain. > Any suggestions, And if I can get something else, how do I get it into > Revolution. I have some great tiled bitmaps that work well in other > programs. > > Thanks for your suggestions ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
(no subject)
Dear Folks, Are additional pattern backgrounds avaiable for Revolution? There are backgrounds available in the color pallete but they are from the days when 16/256 color was all that was available. I'm looking for something kinder and gentler -- Clouds, a pale off white soft texture, something easier on the eyes and brain. Any suggestions, And if I can get something else, how do I get it into Revolution. I have some great tiled bitmaps that work well in other programs. Thanks for your suggestions _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Some help needed!
Robin, Something like this could be used to control the text size of buttons or fields after the stack has been resized, still using geometry to control the button sizes themselves. on postResizeStack repeat with i = 1 to the number of buttons of this card if the width of btn i >= 170 then set the textSize of btn i to 18 if the width of btn i < 170 then set the textSize of btn i to 14 if the width of btn i < 125 then set the textSize of btn i to 10 if the width of btn i < 100 then set the textSize of btn i to 8 end repeat end postResizeStack Roger Eller [EMAIL PROTECTED] > I hope someone can help me with two problems with a stack that I am > creating. I am fairly new to Runtime Revolution though I have used > Hypercard in the past. > > The problems relate to the fact that I intend to run a stack on several > different machines. The problems are: > > 1) How can I ensure that if I need to resize the stack all buttons, objects, > font size etc. will scale down accordingly? I have looked at the Geometry > Manger but that doesn't seem to let me select more than one object at a > time. > > 2) How can I export data from a text field to a text file on, say, a floppy > disk? I have successfully used 'put field 1 into URL "file:test.txt"' to > put the contents of field 1 into test.txt in the current folder, but I can't > seem to get it to create or modify a file in any other location. I'm > developing this in Mac OSX, but this export function will mainly be used on > Windows PCs, if that's relevant. > > > Many thanks in advance. > > Robin ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
(no subject)
I am a new user of Revolution. I noticed that both Videos and Images are not embedded and need to connect with external files. This is easy when I'm building, the images and videos are right there on my hard drive. But when I build to CD I need relative paths so that the images and videos I burned to disc will play in anyones CD drive regardless of the Drive letter. How do you create/insert relative paths in Revolution? I am resending this for publication in full on the list. I was advised by a kind gentleman on the users mail list that Import as Control would work. Well, Yes and No. I was able to import as control images, text and snapshot but not video or audio files. Is there a secret to this? Video files work great from the toolbar. Then there is the question of whether you would want embedded video files sized 387mb as anything but external files. I am running Rev version 1.1.1 on a PC running Windows 98SE. Thanks for your reply _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Some help needed!
At 12:59 PM +0100 9/20/02, Robin Banerjee wrote: >1) How can I ensure that if I need to resize the stack all buttons, objects, >font size etc. will scale down accordingly? I have looked at the Geometry >Manger but that doesn't seem to let me select more than one object at a >time. If you need to specify individual scaling options for everything, then you must do exactly that: select each object and set the options. If you have a whole group of buttons that just needs to move as a group, then group them, and set geometry on the group. -- regards, Geoff Canyon [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Some help needed!
Salaam Robin, > I hope someone can help me with two problems with a stack that I am > creating. I am fairly new to Runtime Revolution though I have used > Hypercard in the past. > > The problems relate to the fact that I intend to run a stack on several > different machines. The problems are: > > 1) How can I ensure that if I need to resize the stack all buttons, > objects, > font size etc. will scale down accordingly? I have looked at the > Geometry > Manger but that doesn't seem to let me select more than one object at a > time. Sorry, i cannot help you here, but i am afraid that cannot be done right out-of-the-box, read -> a lot of scripting. > 2) How can I export data from a text field to a text file on, say, a > floppy > disk? I have successfully used 'put field 1 into URL "file:test.txt"' > to > put the contents of field 1 into test.txt in the current folder, but I > can't > seem to get it to create or modify a file in any other location. I'm > developing this in Mac OSX, but this export function will mainly be > used on > Windows PCs, if that's relevant. If you know the path to the drive/hd/folder then you can hardcode it like: put fld 1 into url"file:C:/folder1/file.txt" I am sure that won't work for you ;-) But you can ask the user to select a folder/drive/hd where to store that file. Example: ... ask file "Where may i save this file?" with "test.txt" if the result is not "cancel" then put fld 1 into url("file:" & it) end if ... ## 1. user did not click "Cancel" ## 2. the variabel it then contains the path/folder/hd and the filename ## the user typed... > Many thanks in advance. > > Robin Hope that helps. If not, just drop another mail :-) Regards Klaus Major [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Some help needed!
I hope someone can help me with two problems with a stack that I am creating. I am fairly new to Runtime Revolution though I have used Hypercard in the past. The problems relate to the fact that I intend to run a stack on several different machines. The problems are: 1) How can I ensure that if I need to resize the stack all buttons, objects, font size etc. will scale down accordingly? I have looked at the Geometry Manger but that doesn't seem to let me select more than one object at a time. 2) How can I export data from a text field to a text file on, say, a floppy disk? I have successfully used 'put field 1 into URL "file:test.txt"' to put the contents of field 1 into test.txt in the current folder, but I can't seem to get it to create or modify a file in any other location. I'm developing this in Mac OSX, but this export function will mainly be used on Windows PCs, if that's relevant. Many thanks in advance. Robin -- Dr Robin Banerjee Psychology Group School of Cognitive & Computing Sciences University of Sussex UK ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution