How to make image resizable using mouse ?

Hi,
I want to know about that how to resize image by using mouse in Java Canvas. I created some tools like line, free hand, eraser. And want to know how to make an image resizable in canvas by using mouse. An image is jpeg, png, or gif format. I want to make image stretch and shrink by using mouse.
Please help me..
Thnax in advance.
Manveer

You make a listener to handle the mouse event that you want to capture, then program the affect you want using the event as the trigger.

Similar Messages

  • CS6 Fluid Grids - how to make images resize when page is resized? [was: Hello]

    I am new to fluid grid layouts in Dreamweaver cs6, I want to insert a GIF file on my index page but I do not know how to make it so when the page shrinks the GIF or image shrinks as well. The only code that I have found is
    img, {
        max-width: 100%;
    But this code already exists in the css file when you create a new fluid grid based layout
    img, object, embed, video {
        max-width: 100%;
    can anyone help a newbie please..

    this is my source code
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Kyle Childress Foundation</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/layout.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="respond.min.js"></script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="animation"><img src="images/images/kyleanimation2014gif2.gif" alt="kylechildressfoundationanimation"></div>
    </div>
    </body>
    </html>
    this is my css
    @charset "UTF-8";
    @import url("/kyle.css");
    /* Simple fluid media
       Note: Fluid media requires that you remove the media's height and width attributes from the HTML
       http://www.alistapart.com/articles/fluid-images/
    img, object, embed, video {
        max-width: 100%;
    /* IE 6 does not support max-width so default to width 100% */
    .ie6 img {
        width:100%;
        Dreamweaver Fluid Grid Properties
        dw-num-cols-mobile:        5;
        dw-num-cols-tablet:        8;
        dw-num-cols-desktop:    10;
        dw-gutter-percentage:    25;
        Inspiration from "Responsive Web Design" by Ethan Marcotte
        http://www.alistapart.com/articles/responsive-web-design
        and Golden Grid System by Joni Korpi
        http://goldengridsystem.com/
    /* Mobile Layout: 480px and below. */
    .gridContainer {
        margin-left: auto;
        margin-right: auto;
        width: 87.36%;
        padding-left: 1.82%;
        padding-right: 1.82%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #animation {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #image {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
    @media only screen and (min-width: 481px) {
    .gridContainer {
        width: 90.675%;
        padding-left: 1.1625%;
        padding-right: 1.1625%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #animation {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #image {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    /* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */
    @media only screen and (min-width: 769px) {
    .gridContainer {
        width: 88.2%;
        max-width: 1232px;
        padding-left: 0.9%;
        padding-right: 0.9%;
        margin: auto;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #animation {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #image {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    the animation GIF is 700 x 908
    I changed the code from max-width to just width 100% but it still did not work ,, please help

  • Tight Deadline: How to make image to follow mouse only side to side

    I am on a tight deadline and looking for the AS3 code of how to do what this company does on their site:
    http://www.imageworksstudio.com/ However, I don't know AS3. Literally my project requires I recreate the what is shown with the hand holding the sharpie and moving only back and forth restricted to a centered rectangular area at the bottom of the screen. I know how to import the image that follows the mouse to the stage, and to make it a movieclip. Let's say I have named the instance "Image_mc". Does anyone have the actionscript for how to do this? Do you attach it to the object or to a keyframe on a separate actions layer? I appreciate any help! Thanks!

    The replacement for those two lines of code in AS3 would be:
         box_mc.x = mouseX+(box_mc.x-mouseX)/2

  • How to make load simulator using labview 2010

    i want to ask how to make load simulator using labview? 
    Solved!
    Go to Solution.

    what have you tried so far? and exactly what is it your tying to do?
    Please remember to accept any solutions and give kudos, Thanks
    LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7

  • How to make RC circuit using labview

    Hi,
    how to make RC circuit using labview... Thx

    Your question seems awfully similar to this thread. Is this a school assignment?
    Jeff
    Using Labview 7 Express

  • How to make images fade in and out

    how to make images fade in and out continuously

    HI,
    The Ken Burns effects can do this nicely. Available in the iLife suite of software.
    iLife 06 minimum requirements:
    http://support.apple.com/kb/HT2675
    iLife 06 - Amazon
    Carolyn

  • Can someone help me in learning how to make business cards using pages

    can someone please help me in learning how to make business cards using pages

    You could jump start the process with an Avery MS Word 8-up business card template as a free download. Either version of Pages will digest it nicely. Once you load it into Pages, do a File > Save As Template.. , add it to Chooser, and give it your name choice. Both versions of Pages will remove the printer registration marks in all four template corners. The free LibreOffice Writer retains them.

  • How to make destop application using java

    how to make destop application using java
    i mean to say when we double click on the exe file the program should lounch the application
    for windows

    when i double click ii got the msg
    Failed to lad main class manifest attribute from
    x/x/xyz.jar
    what exatly it meansIt means that your Manifest.MF for the JAR file should contain an attribute called Main-Class pointing to a class containing the main() method.
    Something like this should be present in META-INF/Manifest.MF :
    Main-Class: MyApplicationMain

  • HOW DO I MAKE IMAGES DYNAMIC USING DREAMWEAVER & MySql

    Hi there,
       I wanted to make images dynamic in that the images would be stored in my database and then use dreamweaver to pull the images from the database using a recordset. But how do I get to store the images in MySql now that dreamweaver doesn't support BLOB and also how do I make dreamweaver pull the images from that database? PLZ somebody help

    To pull the image from Database on to your page
    1. Open your php page
    2. put your cursor where you want the image to show on the page
    3. insert>image>Select File Name From: Data Sources>select record from recordset> click ok
    4. View in browser
    In Mysyl the image was stored as a "longblob" type with "binary" attributes
    but my system is Dreamweaver CS3.
    Hope this helps. Let me know.

  • Ways to implement image resizing using plug-ins?

    Hi Photoshop developers,
    I'm a developer with a few Photoshop filter and selection plug-ins under my belt, and I have a good understanding of the SDK and tools and suites it provides. My next project is an algorithm for enlarging/resampling images to different pixel dimensions. I'm wondering if anyone has any suggestions for or experience with the best combination of plug-in types to implement this.
    Clearly, I can't just write it as a filter plug-in, since there is no way to change the image dimensions from within a filter.
    I'd like the resized image to remain within Photoshop (as a new window or in the original one), so an export plug-in on its own is not sufficient.
    Import plug-ins seem promising, since they allow the creation of a new document of the required size. However, as best I can tell from the Photoshop 6.0 SDK documentation, import plug-ins cannot access the image data from other open documents (or even the clipboard), nor do they provide any support for channel ports and the Channel Port suite.
    My best idea at this stage is to create an export plug-in to provide the user interface and calculate the resized image, and then an import plug-in to import the resized image back into a new window. (I'm supposing a further automation plug-in would then be written to perform this export/import sequence.) The difficulty I see with this approach is how to communicate the resized image data between the two plug-ins. Since the resized image will potentially be very large, the ideal solution would be to store it in channels managed by the Channel Ports suite. However, I cannot see how the channel ports created in the export plug-in could be communicated to and used by an import plug-in. The alternative would be for the export plug-in to save the resized image to a temporary file on disk, however this seems unnecessary.
    So, my questions, specifically, are:
    a) Is it possible to create new channels using the Channel Ports suite (sPSChannelPorts->New()) in one plug-in, and have those channels persist to be used in another plug-in?
    b) If so, how would the channel ports be communicated between the plug-ins?
    c) Alternately, are there any alternative architectures available for implementing an image-resizing algorithm using the plug-in types that are available for Photoshop developers.
    Any responses would be greatly appreciated; I know this is a low-traffic forum...
    Thanks,
    Matthew.

    I would make an automation plug-in and a filter plug-in.<br /><br />1) Run the automation which runs your filter to gather current image <br />information<br />2) Create a temp file of the new document<br />3) Make a new document<br />4) Call the filter again to reload the temp data on disk<br /><br /><[email protected]> wrote in message <br />news:[email protected]...<br />> Hi Photoshop developers,<br />><br />> I'm a developer with a few Photoshop filter and selection plug-ins under <br />> my belt, and I have a good understanding of the SDK and tools and suites <br />> it provides. My next project is an algorithm for enlarging/resampling <br />> images to different pixel dimensions. I'm wondering if anyone has any <br />> suggestions for or experience with the best combination of plug-in types <br />> to implement this.<br />><br />> Clearly, I can't just write it as a filter plug-in, since there is no way <br />> to change the image dimensions from within a filter.<br />><br />> I'd like the resized image to remain within Photoshop (as a new window or <br />> in the original one), so an export plug-in on its own is not sufficient.<br />><br />> Import plug-ins seem promising, since they allow the creation of a new <br />> document of the required size. However, as best I can tell from the <br />> Photoshop 6.0 SDK documentation, import plug-ins cannot access the image <br />> data from other open documents (or even the clipboard), nor do they <br />> provide any support for channel ports and the Channel Port suite.<br />><br />> My best idea at this stage is to create an export plug-in to provide the <br />> user interface and calculate the resized image, and then an import plug-in <br />> to import the resized image back into a new window. (I'm supposing a <br />> further automation plug-in would then be written to perform this <br />> export/import sequence.) The difficulty I see with this approach is how to <br />> communicate the resized image data between the two plug-ins. Since the <br />> resized image will potentially be very large, the ideal solution would be <br />> to store it in channels managed by the Channel Ports suite. However, I <br />> cannot see how the channel ports created in the export plug-in could be <br />> communicated to and used by an import plug-in. The alternative would be <br />> for the export plug-in to save the resized image to a temporary file on <br />> disk, however this seems unnecessary.<br />><br />> So, my questions, specifically, are:<br />><br />> a) Is it possible to create new channels using the Channel Ports suite <br />> (sPSChannelPorts->New()) in one plug-in, and have those channels persist <br />> to be used in another plug-in?<br />><br />> b) If so, how would the channel ports be communicated between the <br />> plug-ins?<br />><br />> c) Alternately, are there any alternative architectures available for <br />> implementing an image-resizing algorithm using the plug-in types that are <br />> available for Photoshop developers.<br />><br />> Any responses would be greatly appreciated; I know this is a low-traffic <br />> forum...<br />><br />> Thanks,<br />> Matthew.

  • HOW TO MAKE IMAGE TRANSPERANT

    Hello All,
    I have two images one as background and another one is to
    place on background image.
    Upper one I need transperant. How to write code to
    make image transperant?
    CAN ANY ONE HELP?
    Sharmila.

    If you want to do on the fly image transparencies then you want to look in the java.awt.image package. There is are some pretty powerful image filters in here and after the initial learning curve, it isn't terribly complex to create your own image filters. For a school group project we created a logic puzzle game based on a shareware program alreay out there. The shareware program had a tileset format that we wanted to use in our application, but the transparencies weren't set up correctly. We ended up adding the transparencies on the fly. I wish I had the piece of code handy but I can remember enough to point you on the right path.
    If you subclass java.awt.image.ImageFilter and override the two setPixels() methods, you can provide any manipulation you need to. Basically the image producer will pass in the pixels in one huge byte (or int) array top left to bottom right order. What we did, was get the color out of the first pixel and make that our transparency color. The byte method has two bits per color while the int method has 8 bits per pixel. The color is divided into r(ed), g(reen), b(lue), a(lpha) (I can't remember if alpha was first or last, a little expirimentation will tell you). The alpha is opaque at one extreme and fully transparent at the other extreme. Loop through the array and if the color is the same as your first pixel then set the alpha to 0 (or was it 15/255?).
    Good luck!

  • Image Resizing Using Java

    Hi.
    I am new to Java and have a question.
    I have an image at this path: "c:\images\pic1.gif".
    I want to take this image, resize it, and save it to a different path.
    I don't have any outside Toolkits.
    How do I do this?
    Or, more simply, how do I use the Image and BufferedImage classes?
    I cannot figure out how to create a BufferedImage object using the path for the image I have.
    Thanks in anticipation.

    the article referred by previous answer is pretty good, but you can do it simpler. Just:
    1. create buffered image
    2. get graphics
    3. draw your source image in the graphics with desired size
    Check for an implementation
    http://mediachest.sourceforge.net/download/MediaChest11-80.zip

  • How to make a driver using DLL in LabVIEW?

    I had followed the "Using Exteranal Code in LabVIEW" manual having finished the making dll file, and the lsb file(I attempted that two ways). But when I load the code in LabVIEW, it can't work. I don't know what had happened, I only got a error message like this:"'0x100014f1'commond call memory'0x00000000',this memory can't be written" or other similar error message, if I push the "enter" button, the vi application which I having lunched will crash. If I push the "cancel" button, the debug model will start,and the next message is "Unhandle exception in LabVIEW.exe(MSVCRTD.DLL/LVS95.TMP/COUNTER.DLL(the last one is creat by myself)):0xC0000005:Access Violation", but I wonder what had cause this? My DLL had been made successf
    ully under the VC++6.0, why LabVIEW can't call it fluently? How to make a driver for my own device using LabVIEW? How to correct my error to finished my hole work? Thank you very much. Jacky Wei
    Attachments:
    counter1.rar ‏33 KB

    1. Can you call this DLL from within VC?
    2. What operation system do you use? There may be a problem with calling of win95 dll under NT or win2000 for example.
    3. If you use NT you may not have permissions to work with some ports and memory areas.
    4. Under NT or win200 try to compile the library as a 32-bit dll, and under win95 - as 16-bit one.
    Good luck.
    Oleg Chutko

  • How to make image out of panel?

    hi,
    i have a JPanel object and i drawn something on this panel. it also contains somemore components. can anyone say how to create image (like .jpg) from what is getting displayed in my panel.
    thankx in advance.

    Found this in the newgroups
    If you are using Java 2D, you can create a JPEG image by using the
    com.sun.image.codec.jpeg package. The code below creates a JPEG image and
    saves it to a file.
    public void save(BufferedImage destImage, String filename) {
    try {
    ByteArrayOutputStream boutstream = new ByteArrayOutputStream();
    JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(boutstream);
    enc.encode(destImage);
    FileOutputStream fimage = new FileOutputStream(new File(filename));
    boutstream.writeTo(fimage);
    fimage.close();
    } catch (Exception e) { }
    The code snippet below shows how to crerate a BufferedImage:
    BufferedImage bi = new BufferedImage((int)imWid,
    (int)(imHt),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2d = bi.createGraphics();
    g2d.drawImage(img, dispTx,this);
    img : Your image object.
    dispTx: The Affine Transform.
    You can use other drawImage()methods for drawing images.
    Once the image is drawn, you can save it using the save() method.

  • How to view image by using webcam at other computer.

    I am student. Now I make one project by using LabVIEW software. 
    Now, my question is:
    I have two computer, both computer got install software LabVIEW. And the programming for viewing image by using webcam already finished done.
    Now is, I want to open Webcam at computer B from Computer A. I already search, found that techique "Web Publishing Tools" can do this. Beside this, got another easier technique to do this?       

    There are other ways in which you can transfer images over the network but you will need to do some programming for it. Have a look at the following links:
    Streaming IMAQ Images Over a Network (or Internet)
    Transfer Images Over the Network
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

Maybe you are looking for