Drag and Drop Image in Adobe Air
Is there a problem with the 'Drag Image' proxy, that is present in the DragManager class' doDrag method? I have tried using this and it works absolutely fine with a web application, but DOES NOT work with an AIR application.
Hi Alex,
code you posted seems to be of as2 not as3.
Similar Messages
-
Can`t drag and drop images into PSE5
hi,
i`m from germany, so sorry for my english..
i use pse5 since a few years and a few month with windows7..today i had to reinstall it and now i can`t drag and drop images from explorer or acdsee to PSE workspace. i get no error-message , only this circle with a diagonal line..
i CAN drag and drop images from the editor..
- i reinstalled it and repaired it
- tried diffferent compatability modes
- i don`t run the program as a administrator ( tried it- it was the same)
so can anyone please help me?
thank you so much!
mareenTry making a direct shortcut to the Organizer and then the Editor.
You should then be able to drag and drop on to the desktop icon.
On Windows right click on the desktop and select New >> Shortcut
Browse to Computer OS C:
And find the PSE Organizer application in Program Files or Program Files (x86) on Windows 7 - 64 bit.
Inside the Adobe >> Photoshop Elements Organizer (yellow folder) you are looking for an application file “PhotoshopEementsOrganizer” with six small icons (e.g. representing thumbnails - could be different in PSE5 but look for the exe file)
Select it and click OK
Click next
Rename by taking out Photoshop Elements leaving just the word Organizer
Then click finish
You should now be able to launch directly form the desktop by double clicking on the icon.
You can set up a similar direct link to the Editor application.
-
I am no longer able to drag and drop image files int this JAVA supported site. It had always worked flawlessly in the past.
I would open the site, go to Send Files, allow access, fill out the fields and then drag and drop my image files. Now I can only use the ADD (+) button to do so.
I have the latest versions of OS-X Lion and JAVA installed on my computer
http://www.clippingprovider.com/CP_II_EU/Welcome.htmlThis is the Tech Sheet on the subject:
Photoshop Help | Managing paths
It contains this item under Manage Paths:
When you use a pen or shape tool to create a work path, the new path appears as the work path in the Paths panel. The work path is temporary; you must save it to avoid losing its contents.
Ok, the red you referred to is a Stoke you added. Then QuickMask is not involved. -
Why can't I drag and drop images from the browser into other programs?
Ever since I upgraded to Firefox 4 (even after I upgraded again to Firefox 5) I have been unable to drag images from the browser into other programs, including MS Paint and IcoFx. I receive an error message stating that the file (the address given lists it as being located in the temporary files folder) cannot be found.
Prior to this I had always been able to conveniently drag and drop images for easy editing without having to save first and then open them. This feature is important to me, as I work with graphics very often, and is still available in Chrome and Internet Explorer. I love Firefox though, and hope that there is something I can do to fix the problem.I had this problem on Windows 8.1.1 and iTunes 11.2.2.3
To resolve it from within Itunes I did : Edit, Preferences, Sharing.
I took the tick out of "Share my library on my local network"
Click OK.
Closed iTunes/
Reopened iTunes and I can drag and drop.
I went back into Edit, Preferences, Sharing and put the tick back and clicked OK.
Works fine now. -
Drag and drop images using tilelist in flex
i just want the working code for drag and drop images using
tilelist in flexTry JDK 1.4 and call setDragEnabled(true)
I will also post updated version of MediaChest soon using custom TransferHandler for DnD different types of Objects. -
Drag and Drop image to desktop == Zero Byte File
Drag and Drop image to desktop == Zero Byte File
== This happened ==
Every time Firefox opened
== FireFox 3.6 OR Windows 7 64i have the same problem and Sun doesn't seem to have an answer to this question. The DnD works in Mac OS, but not on Window 2000/XP.
-
How come I cant drag and drop images onto my imove
I can't drag and drop images from my desktop or folder into imovie.
Simply because you are not posting to the iMovie forum. Post there and find out.
-
How to change this code to drag and drop image/icon into it??
Dear Friends:
I have following code is for drag/drop label, But I need to change to drag and drop image/icon into it.
[1]. code 1:
package swing.dnd;
import java.awt.*;
import javax.swing.*;
public class TestDragComponent extends JFrame {
public TestDragComponent() {
super("Test");
Container c = getContentPane();
c.setLayout(new GridLayout(1,2));
c.add(new MoveableComponentsContainer());
c.add(new MoveableComponentsContainer());
pack();
setVisible(true);
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
catch (Exception ex) {
System.out.println(ex);
new TestDragComponent();
}[2]. Code 2:
package swing.dnd;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import java.awt.image.*;
import java.awt.dnd.DragSource;
import java.awt.dnd.DropTarget;
public class MoveableComponentsContainer extends JPanel {
public DragSource dragSource;
public DropTarget dropTarget;
private static BufferedImage buffImage = null; //buff image
private static Point cursorPoint = new Point();
public MoveableComponentsContainer() {
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.white, Color.gray));
setLayout(null);
dragSource = new DragSource();
ComponentDragSourceListener tdsl = new ComponentDragSourceListener();
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new ComponentDragGestureListener(tdsl));
ComponentDropTargetListener tdtl = new ComponentDropTargetListener();
dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, tdtl);
setPreferredSize(new Dimension(400,400));
addMoveableComponents();
private void addMoveableComponents() {
MoveableLabel lab = new MoveableLabel("label 1");
add(lab);
lab.setLocation(10,10);
lab = new MoveableLabel("label 2");
add(lab);
lab.setLocation(40,40);
lab = new MoveableLabel("label 3");
add(lab);
lab.setLocation(70,70);
lab = new MoveableLabel("label 4");
add(lab);
lab.setLocation(100,100);
final class ComponentDragSourceListener implements DragSourceListener {
public void dragDropEnd(DragSourceDropEvent dsde) {
public void dragEnter(DragSourceDragEvent dsde) {
int action = dsde.getDropAction();
if (action == DnDConstants.ACTION_MOVE) {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
else {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
public void dragOver(DragSourceDragEvent dsde) {
int action = dsde.getDropAction();
if (action == DnDConstants.ACTION_MOVE) {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
else {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
public void dropActionChanged(DragSourceDragEvent dsde) {
int action = dsde.getDropAction();
if (action == DnDConstants.ACTION_MOVE) {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
else {
dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
public void dragExit(DragSourceEvent dse) {
dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
final class ComponentDragGestureListener implements DragGestureListener {
ComponentDragSourceListener tdsl;
public ComponentDragGestureListener(ComponentDragSourceListener tdsl) {
this.tdsl = tdsl;
public void dragGestureRecognized(DragGestureEvent dge) {
Component comp = getComponentAt(dge.getDragOrigin());
if (comp != null && comp != MoveableComponentsContainer.this) {
cursorPoint.setLocation(SwingUtilities.convertPoint(MoveableComponentsContainer.this, dge.getDragOrigin(), comp));
buffImage = new BufferedImage(comp.getWidth(), comp.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE);//buffered image reference passing the label's ht and width
Graphics2D graphics = buffImage.createGraphics();//creating the graphics for buffered image
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); //Sets the Composite for the Graphics2D context
boolean opacity = ((JComponent)comp).isOpaque();
if (opacity) {
((JComponent)comp).setOpaque(false);
comp.paint(graphics); //painting the graphics to label
if (opacity) {
((JComponent)comp).setOpaque(true);
graphics.dispose();
remove(comp);
dragSource.startDrag(dge, DragSource.DefaultMoveDrop , buffImage, cursorPoint, new TransferableComponent(comp), tdsl);
revalidate();
repaint();
final class ComponentDropTargetListener implements DropTargetListener {
private Rectangle rect2D = new Rectangle();
Insets insets;
public void dragEnter(DropTargetDragEvent dtde) {
Point pt = dtde.getLocation();
paintImmediately(rect2D.getBounds());
rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
dtde.acceptDrag(dtde.getDropAction());
public void dragExit(DropTargetEvent dte) {
paintImmediately(rect2D.getBounds());
public void dragOver(DropTargetDragEvent dtde) {
Point pt = dtde.getLocation();
paintImmediately(rect2D.getBounds());
rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
dtde.acceptDrag(dtde.getDropAction());
public void dropActionChanged(DropTargetDragEvent dtde) {
Point pt = dtde.getLocation();
paintImmediately(rect2D.getBounds());
rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
dtde.acceptDrag(dtde.getDropAction());
public void drop(DropTargetDropEvent dtde) {
try {
paintImmediately(rect2D.getBounds());
int action = dtde.getDropAction();
Transferable transferable = dtde.getTransferable();
if (transferable.isDataFlavorSupported(TransferableComponent.COMPONENT_FLAVOR)) {
Component comp = (Component) transferable.getTransferData(TransferableComponent.COMPONENT_FLAVOR);
Point location = dtde.getLocation();
if (comp == null) {
dtde.rejectDrop();
dtde.dropComplete(false);
revalidate();
repaint();
return;
else {
add(comp, 0);
comp.setLocation((int)(location.getX()-cursorPoint.getX()),(int)(location.getY()-cursorPoint.getY()));
dtde.dropComplete(true);
revalidate();
repaint();
return;
else {
dtde.rejectDrop();
dtde.dropComplete(false);
return;
catch (Exception e) {
System.out.println(e);
dtde.rejectDrop();
dtde.dropComplete(false);
}Thanks so much for any help.
Reagrds
sunnyWell, I don't really understand the DnD interface so maybe my chess board example will be easier to understand and modify:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=518707
Basically what you would need to do is:
a) on a mousePressed you would need to create a new JLabel with the icon from the clicked label and add the label to the glass pane
b) mouseDragged code would be the same you just repaint the label as it is moved
c) on a mouseReleased, you would need to check that the label is now positioned over your "drop panel" and then add the label to the panel using the panels coordinates not the glass pane coordinates. -
Drag and drop images from the OS or select images over filebrowser
Hello,
I want to create an image upload tool in JavaFX with similar functionality like Jumploader (http://jumploader.com/). The users should be able to select images from the filesystem that will be resized and uploaded to their website, similar as in Facebook. The difference is that I want users to be able to crop images directly in my application. This is something, other upload tools do not offer.
I was searching weeks on the web trying to find a sample on how to drag and drop images in to a JavaFX 1.3.1 app or also to create a file browser. I have found many examples but they seem to be outdated. Is it to early yet to try and start projects like these with JavaFX as JavaFX is still under development? Or can anybody lead me in to the right direction?
Thanks,
ChrisTo be more precise, you can setup a JComponent or JPanel on top of your JavaFX nodes that has a TransferHandler that can convert the (AWT/Swing) images dragged to the app to JavaFX image and then insert it into the underlying node.
As for the file chooser itselft: ListView and the JavaFX composer can allow you to create one quite easily. TreeView can aslso be used to a lesser extend (still a big buggy). For both of these, there are small bugs in the Cell API that may (or may not) prevent from displaying a proper thumbnail in the cells.
You can also use a regular JFileChooser if you do not mind the dialog box having a different LnF from the rest of your application. -
How come in Pages, i cannot drag and drop images?
how come in Pages, i cannot drag and drop images?
Yes you can in all versions.
It helps if you actually describe what you are doing.
Where are you dragging it from and where are you dragging it to?
In what version of Pages?
I suspect you are trying to drag an image into a Table, Header or Footer in Pages 5, which is no longer possible. Feature removed by Apple.
Peter -
My pages has stopped letting me drag and drop images
my pages has stopped letting me drag and drop images, into the template
Just the one template or all templates?
Can you drag and drop an image anywhere on the page?
When you have a problem try and isolate it.
Not all images are placeholders.
Also if you get oddball things happening sometimes a simple restart of your computer will fix them.
Peter -
How Do I Drag and Drop Images From Windows Explorer to Applet?
I'm not able to Drag and Drop Images and other files (like audio and video files) from Windows Explorer to Applet. Is that Possible to do so?. Can SomeOne help me out regarding this? Thanx in Advance.
No problem here. Can you say any more about the situation?
Jerry -
Drag and Drop image is Duplicated
Hi,
In my code, I want to drag and drop an image from a list populated from a folder, and its information is populated from an xml file. Now, I can drag the image from the list and drop it in the container, However, when now, I want to drag around the dropped image, it is duplicated, an extra image is created in the canvas. So, if anyone can tell me how not to create an extra copy of the image in the new container (canvas) that it was dragged to.
Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
name="Drag and Drop Tutorial"
creationComplete="init()"
initialize="pictureService.send()">
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.core.DragSource;
import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable] private var pictureData:ArrayCollection;
private function resultHandler(event:ResultEvent):void{
pictureData = event.result.data.image;
private function faultHandler(event:FaultEvent):void{
//code
public function init():void
// a mouseDown event will start the drag
list.dataProvider = pictureData;
//picture in the list is being dragged
this.picture.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
// accepting a drag/drop operation...
this.area.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
// handling the drop...
this.area.addEventListener( DragEvent.DRAG_DROP, handleDrop );
public function beginDrag( mouseEvent:MouseEvent ):void
// the drag initiator is the object being dragged (target of the mouse event)
var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent;
// the drag source contains data about what's being dragged
var dragSource:DragSource = new DragSource();
// Add the data to the object.
dragSource.addData(1, 'value');
// Create a copy of the coin image to use as a drag proxy.
var dragProxy:Image = new Image();
dragProxy.source = mouseEvent.currentTarget.source;
dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget.height)
// ask the DragManger to begin the drag
DragManager.doDrag( dragInitiator, dragSource, mouseEvent, dragProxy );
public function acceptDrop( dragEvent:DragEvent ):void
var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent;
// accept the drop
DragManager.acceptDragDrop( dropTarget );
// show feedback
DragManager.showFeedback( DragManager.COPY );
public function handleDrop( dragEvent:DragEvent ):void
var dragInitiator:IUIComponent = dragEvent.dragInitiator;
var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent;
if(dragEvent.dragSource.hasFormat("items"))
var items:Array = dragEvent.dragSource.dataForFormat("items") as Array;
var img:Image = new Image();
img.x=dragEvent.localX;
img.y=dragEvent.localY;
img.width = 50;
img.height=50;
img.source="assets/" + items[0].id + ".jpg";
img.addEventListener(MouseEvent.MOUSE_MOVE,beginDrag);
area.addChild(img);
else
dragEvent.dragInitiator.x=dragEvent.localX
dragEvent.dragInitiator.y=dragEvent.localY
]]>
</mx:Script>
<mx:HTTPService id="pictureService"
url="data/data.xml"
result="resultHandler(event)"
fault="faultHandler(event)"/>
<mx:DataGrid id="list" width="238" height="200" y="26" x="10" labelField="src" dragEnabled="true"
dataProvider="{pictureData}">
<mx:columns>
<mx:DataGridColumn dataField="id" id="code">
</mx:DataGridColumn>
<mx:DataGridColumn id="picture" draggable="true" >
<mx:itemRenderer>
<mx:Component>
<mx:Image source="assets/{data.id}.jpg" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<mx:Canvas id="area" x="266" y="28" width="436" height="401" backgroundColor="#c0c0c0"
dragDrop="handleDrop(event)" >
</mx:Canvas>
</mx:Application>your handleDrop is called twice. you have assigned this eventlistener twice - one in init function and one in inline.
remove one and it works. -
Error message when dragging and dropping images to album
I recently installed the Elements 12 upgrade on my MacBook Pro. My previous version was Elements 10. When I try to add new images to my existing albums by selecting, dragging and dropping them into an album the operation does not work and i get an error message "Error Applying Keyword Tag(s)"
Thanks for your reply Andaleeb,
When you look at the numerous discussions on the PSE forum on this Organizer window issue it's not just a problem I had (Thread 14444851) but other users who have Elements 10, 11 and 12 are experiencing similar problems. There appears to be a serious compatibility problem with OSX 10.9.2 and these versions of PSE. Although my issue was fixed by your support staff, the fact that many other users are experiencing this issue points to the need for a universal fix applicable to all Mac users. There is a lot of frustration out there among Mac users and Adobe needs to deal with this problem.
I am really surprised that on all the other discussion posts on this issue, there is not a single comment or response from Adobe staff! Given the lack of response from Adobe, it appears that the Adobe policy is to sit back and let the Mac users determine their own solutions.
Please pass this post on to your management so that corrective action can be initiated.
Thanks for your help. -
JQuery drag and drop image order with save to database?
We have a property image gallery on our website and a CMS that allows us to add/edit images in the gallery.
Image file names are stored in a database table:
imgID (int)
propertyID (int)
imgfilename (nvarchar)
displayorder (int)
Images are displayed in order of "displayorder" but we'd like to be able to drag and drop the order in our CMS and have this update the database table with the correct display order.
We found this jQuery solution but it doesn't appear to work, although descriptively it's exactly what we're trying to acheive:
http://halnesbitt.com/blog/2010/08/05/save-order-with-jquery-ui-sortable-and-aspaccess
Can anyone advise a similar script or solution? We're using Classic ASP and MSSQL.
Thank you.
NJHi,
Not looking at any code you have an upload button for the video and an insert for the form. So both forms are independent of each other it looks like, thats why when you do one you only get that info and when you do the other you only get the other info. You should just make one form with the uploader included. Make one form with all the fields included (movie name, movie page, movie description, movie file) after the form is completed then select the file field and go to...
Server Behaivoirs, Developer Toolbox, File upload, upload file. Follow the widgets.
Maybe you are looking for
-
Hi Has anyone tried using the AirPort Express Base Station with a first generation Time Capsule and used it to extend their network, while still being able to use the Simultaneous dual-band 802.11n on their network? Thanks in advance
-
What reader should I use to read 2007 versions of powerpoint?
I have 2004 office for mac. What do I need to do to read newer files form microsoft office?
-
Creating ETRS 89 co-ordinate system
hi , Has anybody created ETRS 89 (European terestrial refrence system 1989) in oracle ?? where can i find the values for ellipsoid,datum and other values in WKTEXT field in mdsys.cs_srs. thanks vikesh
-
How to check it certain url exist?
hi there.... can someone help me?? is it possible to check if certain url exist? public class checkFile1{ public static void main (String [] args) { String file = "http://www.yahoo.com"; if (file = exist){ open file; els
-
AnyConnect options as SOCKS proxy not supported....??
Hi Guys So we are planning to migrate away from IPEC vpn and use AnyConnect, however we currently have in place SquiD proxy and are using SOCKS proxy too. Having read the document here http://www.cisco.com/en/US/products/ps8411/products_qanda_item091