Resize an image ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2003   #1
Resize an image ?

I wonder if anyone here could help me on how to resize an image file using max script in Max 5.1

I am working on a small script where I the user can select an image file, and based on his selection I want to show a small version of the image in the UI (as a bitmap).

In the help there seems to be no easy way to do a resize of a bitmap, and I wonder if anyone has an idea on how to do this?

Thanks
 
Old 11 November 2003   #2
You can use the copy method to do this.

Excerpt from the online reference:
Quote: copy <source_bitmap> <dest_bitmap>

Copies the source bitmap to the destination bitmap. If the size of the two bitmaps is different, the image will be scaled to fit the destination bitmap.


Martijn
 
Old 11 November 2003   #3
Thank you very much Magicm, I will try that out - never imagined that a copy could be used this way.

Thanks
 
Old 11 November 2003   #4
Quote: Originally posted by xlars.dk
Thank you very much Magicm, I will try that out - never imagined that a copy could be used this way.

Thanks



While it works for stuff like quick previews, the result of the copying is not very smooth as it does not interpolate, it only repeats or skips pixels as necessary.

You can write your own resizing function using a bitmapTexture map and the renderMap method. This will use the Max renderer and will give you the option to filter the map.

Hope this helps.

Cheers,
Bobo
 
Old 11 November 2003   #5
Thank you very much Bobo I had also been thinking in the lines rendering the image somehow to get some nicer antializing etc., before Martijn gave me the idea with the copy (which as you also say gives nice results for quick previews etc.).

Your suggestion using the renderMap method is brilliant. I am currently studying the documentation more closely.

Thanks
 
Old 01 January 2006   #6
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:40 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.