Bild in Java vergrößern!!

Dieses Thema Bild in Java vergrößern!! im Forum "Windows XP Forum" wurde erstellt von mcgoofy, 3. Aug. 2005.

Thema: Bild in Java vergrößern!! Hallo!! Also ich habe die Aufgabe ein Bild mit einem script groß ziehen zu können. Also wenn ich zur Rechten seite...

  1. Hallo!!

    Also ich habe die Aufgabe ein Bild mit einem script groß ziehen zu können. Also wenn ich zur Rechten seite fahre und draufklicke kann ich diese Seite lang ziehen. Bei meinem Script geht leider nur die untere und die Rechte seite.

    Hier ist mein Script:
    <html>
    <head>
    <title> Bild verändern </title>
    <script language=javascript>
    lastActionState='';
    lastMouseX=0;
    lastMouseY=0;
    richtung=0;

    function changeSizeStart(ev) {
    lastActionState='move';
    htmlElem=((ev.target) ? ev.target : ev.srcElement);
    richtung=htmlElem.id.substr(4)-0;
    window.status=richtung;
    }

    function changeSizeEnd(ev) {
    lastActionState='';
    }

    function mouseDownBody(ev) {
    if (lastActionState=='move') {
    lastMouseX=((ev.screenX) ? ev.screenX : ev.clientX) + document.body.offsetLeft;
    lastMouseY=((ev.screenY) ? ev.screenY : ev.clientY) + document.body.offsetTop;
    }
    }

    function mouseUpBody(ev) {
    lastActionState='';
    }

    function mouseMoveBody(ev) {
    var htmlImg;
    var re=/px/g;
    if (lastActionState=='move') {
    newMouseX=((ev.screenX) ? ev.screenX : ev.clientX) + document.body.offsetLeft;
    newMouseY=((ev.screenY) ? ev.screenY : ev.clientY) + document.body.offsetTop;
    window.status=newMouseX +->/' + newMouseY;
    if (richtung==6) {
    diffX=newMouseX-lastMouseX;0
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['width']=htmlImg.style['width'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['width'];
    }
    if (richtung==2) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['top']=htmlImg.style['top'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['top'];
    }
    if (richtung==8) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['height']=htmlImg.style['height'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['height'];
    }
    if (richtung==4) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['left']=htmlImg.style['left'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['left'];
    }
    if (richtung==3) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['top; width']=htmlImg.style['top; width'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['top; width'];
    }
    if (richtung==1) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['left; top']=htmlImg.style['left; top'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['left; top'];
    }
    if (richtung==7) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['left; heigth']=htmlImg.style['left; height'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['left; height'];
    }
    if (richtung==9) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['height; width']=htmlImg.style['height; width'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['height; width'];
    }
    if (richtung==5) {
    diffX=newMouseX-lastMouseX;
    htmlImg=document.getElementById('img_sizeChange');
    window.status='schiebe:-> + diffX;
    htmlImg.style['width; top; left; height']=htmlImg.style['width; top; left; height'].replace(re,'')-0 + diffX;
    window.status=htmlImg.style['width; top; left; height'];
    }
    lastMouseX=newMouseX;
    lastMouseY=newMouseY;

    }

    }

    </script>
    </head>

    <body width=800px height=800px onMouseDown=mouseDownBody(event) onMouseUp=mouseUpBody(event) onMouseMove=mouseMoveBody(event)>
    <map name=sizeChangeMap>
    <area id=area1 shape=rect coords=0,0,100,75 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: nw-resize;>
    <area id=area2 shape=rect coords=100,0,300,75 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: n-resize;>
    <area id=area3 shape=rect coords=300,0,400,75 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: ne-resize;>
    <area id=area4 shape=rect coords=0,75,100,225 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: nw-resize;>
    <area id=area5 shape=rect coords=100,75,300,225 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: n-resize;>
    <area id=area6 shape=rect coords=300,75,400,225 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: ne-resize;>
    <area id=area7 shape=rect coords=0,225,100,300 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: nw-resize;>
    <area id=area8 shape=rect coords=100,225,300,300 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: n-resize;>
    <area id=area9 shape=rect coords=300,225,400,300 onMouseDown=changeSizeStart(event) onMouseUp=changeSizeEnd(event) style=cursor: ne-resize;>
    </map>
    <img id=img_sizeChange src=sizeChange.gif usemap=sizeChangeMap style=position:absolute; left:200px; top:150px; width:400px; height:300px; cursor:crosshair>

    </body>
    </html>

    Bitte helft mir
     
Die Seite wird geladen...

Bild in Java vergrößern!! - Ähnliche Themen

Forum Datum
Bild aus Firefox Javascript kopieren..... Windows XP Forum 21. Mai 2009
Bild abwechslungsweise anzeigen (PHP, Javascript) Webentwicklung, Hosting & Programmierung 29. Mai 2006
Bild per Link(Javascript, oder so) drucken Windows XP Forum 22. Mai 2006
JAVA: Bild aktualisiert sich nicht Windows XP Forum 22. Feb. 2006
html/javascript: Popup auf Bild Webentwicklung, Hosting & Programmierung 18. Juni 2004