Looking for Help on a Project
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Looking for Help on a Project
Well....I actually figured this out finally myself
By setting the printer code to print to PDF instead of the printer it spits out a high quality pdf image works great!
Sorry to have bothered you all but it's good to know you are there.
Cheers
David
By setting the printer code to print to PDF instead of the printer it spits out a high quality pdf image works great!
Sorry to have bothered you all but it's good to know you are there.
Cheers
David
Re: Looking for Help on a Project
Hi,
EDIT: SOLVED.
I have managed to write the file to a selected folder but it does not write with the "pdf" file extension.
Added :
Thanks.
Bidge
EDIT: SOLVED.
I have managed to write the file to a selected folder but it does not write with the "pdf" file extension.
Added :
Code: Select all
put it & ".pdf" into SavePdf
Code: Select all
on mouseUp
if the result is "Cancel" then exit mouseUp
set the printPaperOrientation to "portrait"
set the printMargins to 0,0,0,0
set the printPaperSize to "595,842"
ask file "Choose a file for the PDF:"
if it is not empty then
put it into SavePdf
open printing to pdf SavePdf
print this card from 0,0 to 595,842 into 0,0,900,1240
end if
close printing
end mouseUp
Thanks.
Bidge
Re: Looking for Help on a Project
Ok...this one has me stumped. Is it a bug?
I am trying to move an image with "grab me". When I load the image I set the image locklocation to true
so it doesn't resize the image area. Works fine but when I reset the image locklocation to false the image will
not move with the grab me function.
Can anyone help with this problem please?
I am using the code below:
Then this on the image area":
I am trying to move an image with "grab me". When I load the image I set the image locklocation to true
so it doesn't resize the image area. Works fine but when I reset the image locklocation to false the image will
not move with the grab me function.
Can anyone help with this problem please?
I am using the code below:
Code: Select all
on mouseUp
set the lockLocation of image "i1" to true
answer file "Choose a picture"
if it is not empty then
set the filename of image "i1" to it
end if
set the lockLocation of image "i1" to false
end mouseUp
Code: Select all
on mouseUp
grab me
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Looking for Help on a Project
Hi bidge,
Grab on mouseUp doesn't work, you have to use mousedown like that:
Best regards
Jean-Marc
Grab on mouseUp doesn't work, you have to use mousedown like that:
Code: Select all
on mouseDown
grab me
end mouseDown
Jean-Marc
https://alternatic.ch
Re: Looking for Help on a Project
Oh thank you so much Jean-marc.
I am learning slowly
Bidge
I am learning slowly
Bidge
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Looking for Help on a Project
Grab is one way to do what you want but you can't do any thing while grab
Mousemove is an other way
You may have a look at this thread
http://forums.livecode.com/viewtopic.php?f=7&t=29242
Jean-Marc
Mousemove is an other way
You may have a look at this thread
http://forums.livecode.com/viewtopic.php?f=7&t=29242
Jean-Marc
https://alternatic.ch
Re: Looking for Help on a Project
Thanks Jean-marc.
I have just struck another problem I don't know how to solve or what is going wrong.
Importing an image so it stays at it's set aspect ratio but small enough to manipulate:
I have an image import button and two sliders that control the rotation and image size.
The image imports nicely and the rotation slider works fine but when I try to use the resize
slider to resize the image it loses its imported aspect ratio and pops back to the set size of
he image area which is square. How can I stop this?
Image Import code:
Rotation slider code:
Image resize (the problem)
I have just struck another problem I don't know how to solve or what is going wrong.
Importing an image so it stays at it's set aspect ratio but small enough to manipulate:
I have an image import button and two sliders that control the rotation and image size.
The image imports nicely and the rotation slider works fine but when I try to use the resize
slider to resize the image it loses its imported aspect ratio and pops back to the set size of
he image area which is square. How can I stop this?
Image Import code:
Code: Select all
on mouseUp
answer file "Choose a picture"
if it is not empty then
set the filename of image "i1" to it
end if
put the formattedWidth of image "i1" into nativeWdth
put the formattedHeight of image "i1" into nativeHgt
put the width of graphic "maxD" into maxWdth
put the height of graphic "maxD" into maxHgt
put constrainedDimensions(nativeWdth,nativeHgt,maxWdth,maxHgt) into newDimensions
set the width of image "i1" to item 1 of newDimensions
set the height of image "i1" to item 2 of newDimensions
set the loc of image "i1" to the loc of graphic "maxD"
end mouseUp
Code: Select all
on scrollbarDrag pScrollValue
set the angle of image "i1" to pScrollValue
end scrollbarDrag
Code: Select all
on scrollbarDrag pScrollValue
set the height of image "i1" to pScrollValue
set the width of image "i1" to pScrollValue
end scrollbarDrag
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Looking for Help on a Project
Paul Hibbert made a stack « Angle and Resize test » you can download
Click on « sample stack » button and choose « image »
Click on « sample stack » button and choose « image »
https://alternatic.ch
Re: Looking for Help on a Project
Yes...I tried to implement that stack but I couldn't get it to work correctly. The temp image kept popping up full size then it would go crazy.
The code I have works well I just need to find out why the image size is changing it's aspect ratio when scaled up?
Bidge
The code I have works well I just need to find out why the image size is changing it's aspect ratio when scaled up?
Bidge
Re: Looking for Help on a Project
Hi again I have struck another issue I am struggling to deal with.
When I scale up my image area my text area is being thrown off center, it's actually
not scaling up perfectly with the rest of the grouped objects. Is there a way to
somehow center a text field in a group of objects?
Thanks for any help.
Bidge
When I scale up my image area my text area is being thrown off center, it's actually
not scaling up perfectly with the rest of the grouped objects. Is there a way to
somehow center a text field in a group of objects?
Thanks for any help.
Bidge
Re: Looking for Help on a Project
Hi Bidge
You can of course set the loc[ation] of an object or group, and it refers to the centre point of the object. In the handler script you are using to scale and position the image you can addwhere necessary you can change "me" to "the target" or other reference to the object you want to use as the centre point for the field.
You can of course set the loc[ation] of an object or group, and it refers to the centre point of the object. In the handler script you are using to scale and position the image you can add
Code: Select all
set the loc of field "theText" to the loc of me
Re: Looking for Help on a Project
Hi SparkOut.
Brilliant. Thank you so much.
Unfortunately it worked but the problem cannot be fixed this way
For some reason the text is not scaling up correctly with the group.
The scaling up to pdf :
print this card from 0,0 to 595,842 into 0,0,900,1267
is causing the text to increase in size so that
words start running off and out of the text area???
I have no idea how to compensate for this???
Bidge
Brilliant. Thank you so much.
Unfortunately it worked but the problem cannot be fixed this way
For some reason the text is not scaling up correctly with the group.
The scaling up to pdf :
print this card from 0,0 to 595,842 into 0,0,900,1267
is causing the text to increase in size so that
words start running off and out of the text area???
I have no idea how to compensate for this???
Bidge
Re: Looking for Help on a Project
You have fallen foul of the different screen and printing font metrics on Windows. The formatForPrinting property will need to be set to true for accurate print rendition. And false for making the screen view look acceptable. The dictionary says this has to be done while the stack is closed but I think it can be done on the fly OK.
Re: Looking for Help on a Project
Thank you SparkOut.
When this issue is addressed would it still work ok on a Mac?
Thanks
Bidge
When this issue is addressed would it still work ok on a Mac?
Thanks
Bidge
Re: Looking for Help on a Project
That's something I can't say for sure. I expect it would work without change and just be ignored on a Mac. At worst it would only need a one-liner check for the platform to decide whether to set or not.