Changing The Size Of An Image
Changing The Size Of An Image.
First off, I would just like to say that i�m a French Canadian student so my English is not very good, and that I�m not an expert in JMagick so this might not be the best way to do it. If there is a better way your welcome to send it to me and I will make correction
to this document.
One very useful feature of ImageMagick is to be able to resize images. This function is great for creating thumbnails or for making full screen images. It might seem a little complex at first but manipulating images with JMagick is a very simple and powerful
thing.
Step 1: Reading The Picture Files
ImageInfo info = new ImageInfo();
MagickImage image = new MagickImage( new ImageInfo( "testpic.jpg" ) );
For more information on reading pictures look at the previous tutorials.
Step 2: Resizing
MagickImage bigger = image.scaleImage(1200, 900);
As you can see this is pretty straightforward, you use your already existing instance of
MagickImage that we named image use the scaleImage method with the desired width(1200)
and height(900). The method returns a MagickImage object witch is the new resized image.
Step 3: Writing the new file
bigger.setFileName("bigger.jpg");
bigger.writeImage(info);
All that is left to do is to create a new file in this case its called bigger.jpg but we could have also overwritten testpic.jpg
分享到:
相关推荐
the <addrfile> without changing the rest of the EEPROM. /D <imagefile> or /DATA <imagefile> Programs the NVM [EEPROM/FLASH] with the contents of <imagefile> without changing the MAC address. /...
- ADD: In TFlexPanel.DefaultLinkPoint property added Size field that lets define visual size of the connection points of the flex-connectors. Initialized with DefaultLinkPointSize constant in the ...
The signal output from the CCD needs to be processed and amplified appropriately to maximize the signal-to-noise ratio and ensure accurate representation of the captured image. **3.5 Light Source** ...
- **Resizing:** Methods like `resize()` allow changing the dimensions of an image. - **Filtering:** Various filters such as blurring, sharpening, and edge detection are available. - **Color Space ...
which typically means that you must be logged in as a domain administrator to use this feature.Note that when you run NewSID that the size of the Registry will grow, so make sure that the maximum ...
**4.13 Changing the Size of a Button** Instructions for resizing buttons, including adjusting width and height, are provided. **4.14 Adding a Keyboard Mapping** Methods for associating keyboard ...
entry will be the basename of the source path. If more than one source entry maps to the same name, the conflicts are named xxx_1, xxx_2, etc. where xxx is the original name. To make this clear, take...
- Updated the detection of Hyperthreading and the number of logical CPUs for a new Intel CPU. Release 5.3 build 1025 WIN32 release 11 July 2008 - Corrected a Disk test bug where on rare occasions a...
This parameter defines the maximum address gap between an existing and a new block at which the driver automatically appends the new block to the existing. If the address gap is greater, then the ...
<END><br>22 , api.zip api function collection<END><br>23 , benchmark.zip This program is very usefull program which gets the details of your computer and have an ability of changing some system...
* Improved support of Devexpress Grids (Quantum and Pivot), Scheduler and many other controls which have the LookAndFeel property (patching of DevEx sources is not required anymore! Just install ...
The Size of It All Activation The Edit Menu OLE and the Clipboard Copying and Cutting OLE Objects Links Drag-and-drop Getting Started with Drag-and-drop Take a Drag On the Clipboard ...
In the event of page getting full and reaching the PageItemCount, MGIndex will sort the keys in the page's dictionary and split the data in two pages ( similar to a b+tree split) and update the page ...
Since all demos were developed with the latest version of Delphi, most of the demo forms probably contains references to properties that doesn't exist in earlier versions of Delphi and C++ Builder. ...
And Now, the Rest of the Story What You Get Out of It Inside the Manifest In the Beginning, There Was the Root, And It Was Good Permissions, Instrumentations, and Applications (Oh My!) Your ...
•S173677 - Documentation - Add a note that resizing an alert window via the standard window size API (properties or methods inherited from TdxAlertWindow ancestor classes) is not recommended ...
data from the original file, the new comment, and the rest of the original file to this temporary file. It closes the temp file and attempts to rename the original file to ".bak". If this succeeds, it...
<br/>学习应用Web标准有很多益处,下面给几个简单例子: <br/>获得好的搜索引擎排名: The separation of content and presentation makes the content represent a larger part of the total file size....
The analog click itself is very accurate and looks very impressive.<END><br>41 , edge.zip This program uses a few API calls/functions to set 3D, sunken and etched effects to an image inside an ...
users with an easy means of changing the current display order of data being retrieved from an indexed table. When the user selects the TDBIndexCombo component, it's drop-down selection list is ...