PDA

View Full Version : image printing problems


terry dactil
01-29-2008, 01:28 PM
Hi all, i have written a little proggy that allows me to choose from a listbox a selection of up to seven different guitar chords, these chords are displayed in a row of up to seven windows, it works perfectly.

What i would like to do is then print the seven chords on one sheet for future practice (and boy do i need the practice.)

I thought perhaps send them to a webobject html file in my docs folder, or to a Rich text doc.

Trouble is, i have searched the forum and still am no further ahead (i am probably not asking the right questions in the search box)

If anyone can point me in the right direction i would be most grateful!

holtgrewe
01-29-2008, 02:36 PM
TD
A new feature in AMS7 - Page.Print() should be able to do this for you.
I've seen this feature mentioned in the AMS7 'hype' - but a very cool feature.
hth

terry dactil
01-29-2008, 03:42 PM
cheers my friend, i just can't seem to get my head around printing images (or groups of images) on the same page, i am not thick, the lua scripts are not clear (for me anyway)

holtgrewe
01-29-2008, 10:21 PM
TD

Place a button on your page.

Button:
On Click:
Page.Print(true, true);
That's it.
hth

terry dactil
01-30-2008, 01:35 PM
holtgrewe, thanks for taking time to reply it is much appreciated

Perhaps i should have made myself clearer, i need to send the images to a blank page and then print them, how can i insert images into a doc or webpage rather than just the links?

Hope that makes sense

would it be possible to view the page/doc prior to printing?

Any help gratefully received, if you can't help thanks for reading this far anyway!

holtgrewe
01-30-2008, 02:26 PM
Terry
I'm confused (..and I'm easily confused) as to where the chord images are coming from?

Are you accessing them directly from a URL in a web object, or do you already have the chord images downloaded?

terry dactil
01-30-2008, 03:47 PM
http://www.indigorose.com/forums/attachment.php?attachmentid=5848&stc=1&d=1201729240

Thanks again for taking time to give advice, i tend to confuse a lot of people :lol , as you can see in my example, the images are in a folder and are loaded into a window.

I would just like to add the images to a separate doc or html file and print the images on a single page ather than seeing the program screen as well.

I know my coding in not great but hey it works! :yes

holtgrewe
01-30-2008, 05:16 PM
Terry
That is really cool...what a great idea.

I modified your post so that I could test the modifications.

Global Functions:
function loadChords()
a function to load the table, called from box2

On preload:
I added a table ptChords={}

Button to Reset Master, I cleared the table.

I added a print button to your guitar page which jumps to new page and on page preload reloads the images and prints them, then returns to guitar page.

It may not be exactly what you want, but should give you ideas.

hth

terry dactil
01-30-2008, 05:45 PM
Thanks for giving it some time :yes and yes it works fine, (i owe you, if you want anyone killed just ask :lol:lol ) much appreciated. I just have to convert it to my way of coding (the long way around kind :lol:lol) , but i love that kind of challenge, ie if the coding is to slick, they will know it is not mine! :lol:lol:lol

terry dactil
02-10-2008, 05:02 AM
Can anyone point me to learning more about global functions please?

RizlaUK
02-10-2008, 08:48 AM
well, im not the best at explaining things but here goes:

the global area is where you would place code that you want to make available to the whole application, whereas code placed in any page or object events would only be available to that page (in theory)

a global function is a block of code that has been placed in the global area, that means any variable processed (unless local is used) would be available to other functions or blocks of code any where in the application

Why use global ?

if you have 2 or more objects that use the same function or a function is called from various parts of code then is should be a global function, if only 1 object calls the function and it is not called from anywhere else in the application then you can place it wherever you like (as long a as the object has access to the function)


Did that help (or sorry if i confused you even more :p)

terry dactil
02-10-2008, 01:39 PM
yes it did help thanks, but it also seems to make things even more complex, so i can call variables on different pages is that right?

RizlaUK
02-10-2008, 01:52 PM
yes thats right, as long as a variable/function is set in global functions then it usable in the all the pages

on a side note, any variable that isent global should be prefixed with "local" eg (local MyVar="Something") will make the variable only available to the block of code or function that it is in, the point of this is so you dont end up changing the value of the wrong variable by mistake and also helps to conserve memory.

terry dactil
02-10-2008, 02:32 PM
Ok Rizla, thanks for your time, i understand in principle, i guess need to practice some examples , Up the Greens (plymouth Argyle) :D