I want to take the screenshot of the result of drag and drop, but I don't know how to do.
Actually, I found 2 javascript and using HTML5 such as html2canvas and canvas2image.
I am now combining them together, but it's still meet some problem with the canvas2image.
Please help me solve this problem if you have same experience, thank you a lot.
Please help me, I've been stock here for days.
Drag and drop code.
<script>
$(function() {
$( "#draggable" ).draggable();
$( "#draggable2" ).draggable();
$( "#droppable" ).droppable({
hoverClass: "ui-state-active",
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
}
});
});
</script>
Image generation code
<script>
window.onload = function() {
function convertCanvas(strType) {
if (strType == "JPEG")
var oImg = Canvas2Image.saveAsJPEG(oCanvas, true);
if (!oImg) {
alert("Sorry, this browser is not capable of saving " + strType + " files!");
return false;
}
oImg.id = "canvasimage";
oImg.style.border = oCanvas.style.border;
oCanvas.parentNode.replaceChild(oImg, oCanvas);
}
function convertHtml(strType) {
$('body').html2canvas();
var queue = html2canvas.Parse();
var canvas = html2canvas.Renderer(queue,{elements:{length:1}});
var img = canvas.toDataURL();
convertCanvas(strType);
window.open(img);
}
document.getElementById("html2canvasbtn").onclick = function() {
convertHtml("JPEG");
}
}
</script>
HTML code
<body>
<h3>Picture:</h3>
<div id="draggable">
<img src='http://1.gravatar.com/avatar/1ea64135b09e00ab80fa7596fafbd340? s=50&d=identicon&r=R'>
</div>
<div id="draggable2">
<img src='http://0.gravatar.com/avatar/2647a7d4b4a7052d66d524701432273b?s=50&d=identicon&r=G'>
</div>
<div id="dCanvas">
<canvas id="droppable" width="500" height="500" style="border: 2px solid gray" class="ui-widget-header" />
</div>
<input type="button" id="bGenImage" value="Generate Image" />
<div id="dOutput"></div>
</body>
There is a simple way with php, a simple script or URL manipulation to build a URL for the gravatar image corresponding to an email?
Ex. http://gravatar.com/avatars/[email protected] and this return a jpeg or png image.
If there is no simple way like the example, what is the easiest way you know to resolve a url of the gravatar corresponding to an email?. Thanks
i want to develop web page in asp(2.0) c#. in this page i want to create and show multiple thiumbnail. for example c:/image and this folder have 5 .jpeg file. when run my web page then show all thumbnail of 5 images without saving thumnails.
it very urgent
Hi,
I am creating a Control Library project.
I have some Cursor files which i want to add on resources.
Because on Resources.resx---Add resources is only for String, Icon (.ico), Text file(.txt),
Image (Png,bmp,jpeg,gif, tiff) files.
So where i can add *.cur files.
How can i do it?
thanks
I use this code to upload image files in xammp server:
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 100000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file, File must be less than 100Kb in size with .jpg, .jpeg, or .gif file extension";
}
?>
What do I do to compare the file name of the uploaded files with the text inputted by the user?
My goal is to be able to compare the user input(ID number) and the file name of the image file which should also be an ID number. So that I will be able to display the image that corresponds with the ID Number provided.
What do I need to do?Please give me an idea on how can I achieve this. Thanks
Hi,
I want to choose an image formate for including images in both html and latex.
I found that jpeg and png formates are not always working well in latex. Is eps format the best for latex. It seems eps is not supported in html?
What other format is good too?
Thanks and regards!
hi,
Using j2me i need to send a jpeg Image to a server using Socket Communication...can anyone send me a sample code for my application.
Thnks in Advance
Deva
What are correctly content-types for this documents ?
I need to write a simple crawler, that only fetches this kind of files.
Nowadays http://somedomain.com/index.html can serve for example an JPEG file due to mod_rewrite, so I need to check the content-type from the response header and compare it with a list of allowed content-types.
From where I can get such list ?
Is there an API available for grabbing Google Streetview images at a particular location (and direction)? I see that its possible to get and position the Flash control, but I'd prefer something that just gave me a JPEG (or some other bitmap format).
I have a scenario wherein the user uploads a file to the system. The only file that the system understands in a CSV, but the user can upload any type of file eg: jpeg, doc, html. I need to throw an exception if the user uploads anything other than CSV file.
Can anybody let me know how can I find if the uploaded file is a CSV file or not?
hi ,
i am making a app which takes photo on button click
i have camera.java which operates camera and takes photo
how to i call it on the below event?
public void onClick(DialogInterface arg0, int arg1) {
setContentView(R.layout.startcamera);
}
Camera .java
package neuro.com;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.app.Activity;
import android.hardware.Camera;
import android.hardware.Camera.PictureCallback;
import android.hardware.Camera.ShutterCallback;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
public class CameraDemo extends Activity {
private static final String TAG = "CameraDemo";
Camera camera;
Preview preview;
Button buttonClick;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.startcamera);
preview = new Preview(this);
((FrameLayout) findViewById(R.id.preview)).addView(preview);
buttonClick = (Button) findViewById(R.id.buttonClick);
buttonClick.setOnClickListener( new OnClickListener() {
public void onClick(View v) {
preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);
}
});
Log.d(TAG, "onCreate'd");
}
ShutterCallback shutterCallback = new ShutterCallback() {
public void onShutter() {
Log.d(TAG, "onShutter'd");
}
};
/** Handles data for raw picture */
PictureCallback rawCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
Log.d(TAG, "onPictureTaken - raw");
}
};
/** Handles data for jpeg picture */
PictureCallback jpegCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
FileOutputStream outStream = null;
try {
// write to local sandbox file system
// outStream = CameraDemo.this.openFileOutput(String.format("%d.jpg", System.currentTimeMillis()), 0);
// Or write to sdcard
outStream = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis()));
outStream.write(data);
outStream.close();
Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
}
Log.d(TAG, "onPictureTaken - jpeg");
}
};
}
My ImageHandler.ashx is not working when the webpart is calling it. any ideas on what is the correct way on calling or adding a handler in sharepoint? Thanks in advance
Here My ImageHandler.ashx code
byte[] buffer = (byte[])image.ImageData;
context.Response.ContentType = "image/jpeg";
context.Response.OutputStream.Write(buffer, 0, buffer.Length);
In my webpart
imgcontrol.ImageUrl = "ImageHandler.aspx?id=1";
First, I can assume that all urls that end with jpeg, jpg, bmp, png or gif are images, and others aren't.
I thought of, and tried two solutions:
Matching the regular expression .(jpe?g|bmp|png|gif)$
Using ends-with to check each separately
But, it appears that neither of these exist in XPath 1.0, or at least, they don't exist in Firefox (I am writing a greasemonkey script, so it is only important for the path to work in Firefox).
I need to be able to catch when the URL contains a image of multiple file types or follow this syntax.
http://localhost:8080/fdlic-web/webpic/101
Here is what i have so far.
(.*)(jpg|gif|png|bmp|jpeg|webpic/(\d+))$
I am using PHP to create a poster frame for the Quicktime plugin, and all I am getting is Quicktime's broken plugin icon. I am positive that the URL is correct. (a copy-paste to the URL box works) The HTTP content-type header is equal to "image/jpeg". Does anyone have any ideas?
I am using struts 2 and full-hibernate-plugin-for-struts2. I would like to set fileUpload interceptor
<param name="allowedTypes">image/png,image/gif,image/jpeg</param>
Where can i find the content of defaultStackHibernate so I can do that?
http://imgur.com/5Grp6
That image shows what I'm talking about.
Visual Studio 2010 on the left, Visual Studio 2005 on the right.
If you ignore the jpeg compression artifacts you can tell that the left icons are much blurrier than the right icons.
Is there some way to turn off this anti-aliasing?
var is:ImageSnapshot = myImagesnapshot;
var str:String = ImageSnapshot.encodeImageAsBase64(is);
As of now, I am sending my jpeg data to the server with the code above.
The problem is that it almost doubles the size of the data.
Is there a way to send the image data directly without using any encoding.
On iOS, I am looking for the proper way to return the URLs for a list of files that are in a directory.
/images
1.jpg
2.jpg
3.jpg
...
I know the URL for the directory and know all the files in the directory will be of type jpeg. It is not clear to me how to properly format the NSURLRequest to return the list of files in the images directory. Once the list is returned, I will iterate through it to return the individual images.
Hi I have to flip a thumpnail image before merge it with another jpeg file. but when I rotate 45 degree using php. It shows a black background. how can I avoid that. any body can help me.
I am using header file to set the background for my application and I have something like
#define backgroundImage [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.jpeg"]]
but I want use UIImageView instead of UIColor. I know I can do:
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)
[imageView setImage:[UIImage imageNamed:@"background.png"]];
self.tableView.backgroundView = imageView;
but how do I use it with #define?