Load images at proportional size

Josep jmyepes at mac.com
Sun Jul 5 20:05:06 EDT 2009


Thanks Mark,... works fine...

But now I detecting some extrange issue. When Drag from the desktop or the
web page sometime the source image have height and width = 0... I don't know
why, some times drag and drop perfectly and sometime no, and Rev crash!

Code:

on dragDrop
   lock screen
   set the width of me to 210
   set the height of me to 295
   set the threeD of me to true
   set itemdel to "/"
   put the last item of the dragdata into fld lbl_filename
   
   put URL the dragData into me
   put rescale( the formattedwidth of me,the formattedheight of me,the width
of me,the height of me) into myNewSize
   set itemdel to comma
   set the width of me to item 1 of myNewSize 
   set the height of me to item 2 of myNewSize 
   unlock screen
end dragDrop

I set the width and height at the begin to put the original size, so if the
image is rescaled to a small size the next time the image have these size.

Any idea?

Salut,
Josep 


Mark Schonewille-3 wrote:
> 
> Hmmm.... yes, Josep might want to use my function with formattedHeight  
> and formattedWidth rather than regular height and width.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> http://economy-x-talk.com
> Snapper Screen Recorder 2.1 http://snapper.economy-x-talk.com
> 
> If you sent me an e-mail before 21 June and haven't got a reply yet,  
> please send me a reminder.
> 
> 
> 
> 
> On 5 jul 2009, at 10:21, Sarah Reichelt wrote:
>>
>> If you get the formattedHeight of the image and the formattedWidth of
>> the image, that tells you the original number of pixels.
>> If you pick a fixed height or a fixed width for the display image, you
>> can calculate what the other dimension should be and set the size of
>> the image object accordingly.
>> Make sure you set the lockLoc of the image to true or it will resize
>> to the full dimensions of the image when the stack is opened.
>>
>> Cheers,
>> Sarah
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/Load-images-at-proportional-size-tp24340945p24348101.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list