save

how to save view as an image to the SD card

对着背影说爱祢 提交于 2019-12-21 06:00:43
问题 My app creates a puzzle grid using table layout, tablerows and textviews. I want a user to be able to save this grid to the SD card so that it can be printed or copied or loaded onto another device. How do you save a view so that when it's printed it will look like it does on the android screen? 来源: https://stackoverflow.com/questions/4080133/how-to-save-view-as-an-image-to-the-sd-card

Download PHP generated webpage as HTML file

≯℡__Kan透↙ 提交于 2019-12-21 05:05:08
问题 I am using a PHP based CMS which uses <include> to add the header and footer of the page, and the content of page is retrieved from a database using PHP/MySQL. I want to create a button on the page that downloads the page as a HTML file - just like what you would get if you copied the page source onto a blank file or saved the page with your browser. Normally I would use PHP to locate the file and download it, as this is a CMS generated page these is no actual file. Does anyone know how to

PHP + PDF, how to save a downloaded PDF using curl?

柔情痞子 提交于 2019-12-21 04:39:26
问题 Welcome I have a little problem with saving the downloaded pdf on the page. To download pdf I use Curl: $CurlConnect = curl_init(); curl_setopt($CurlConnect, CURLOPT_URL, 'http://website.com/invoices/download/1'); curl_setopt($CurlConnect, CURLOPT_POST, 1); curl_setopt($CurlConnect, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($CurlConnect, CURLOPT_POSTFIELDS, $request); curl_setopt($CurlConnect, CURLOPT_USERPWD, $login.':'.$password); $Result = curl_exec($CurlConnect); Now in $Result (string) i

Best way to save data to iOS?

喜夏-厌秋 提交于 2019-12-21 00:40:08
问题 In my application (iOS 5) I want to save data - I want to save debts. So its: plus or minus money the amount of money and the name who has the debts (or the name where you have the debts) But I don't how to save the data (NSUserdefaults,Core data, SQLLite) Maybe you can tell me the best way to save them? 回答1: The easiest way to store small amount of data on your device is to use NSUserDefaults. But only property lists could be saved in this way. A property list is a combination of objects of

How to create screenshot of QWidget?

别说谁变了你拦得住时间么 提交于 2019-12-20 19:41:35
问题 I work at my homework in Qt Creator, where I paint to QWidget and I need to save some part of this QWdiget. I tried to solve this problem: QPixmap pixmap; pixmap.copy(rectangle); // rectangle is part of QWidget, which I need to save pixmap.save("example.png"); Thank you for help. 回答1: You can use QWidget::render for this. Assuming rectangle is a QRect: QPixmap pixmap(rectangle->size()); widget->render(&pixmap, QPoint(), QRegion(rectangle)); 回答2: From QWidget::Grab: QPixmap QWidget::grab(const

How to get data from GPS and send to server and how save to database

时间秒杀一切 提交于 2019-12-20 17:28:10
问题 I designed a web page with PHP, the data can be read from database including lat, long, speed and it displays the data on a map. I have a MVT380 tracker that I can set IP and port on, so the data through GPRS can be sent to these IP and port. The problem is how to read the data and save it in database (is there any special hardware that can read the sent data to these IP and port and save it to database? or should we design a web page that can read the data through GET/POST protocol and save

How to store JSON response in jQuery?

谁说胖子不能爱 提交于 2019-12-20 14:56:04
问题 I'd like to store my json response in a global variable so, i could use it through my app without making a getJSON request more than once. var data; $.getJSON("panorama.json",function(json){ data = json.images[0].src; console.log(data); }); console.log(data); If I log it in the actual request its fine, but i get "undefined" everywhere else. Any comment appriciated. Edit [copied from comments]: Tried ... $.myglobals = { result: "unset" } $(document).ready(function() { $.getJSON( "panorama.json

How to Draw something with your finger in an Android App… And save it to the web

可紊 提交于 2019-12-20 14:19:24
问题 **THIS QUESTION WAS SUCCESSFULLY ANSWERED AND HAS BECOME A BLOG POST <- click ** Hi I am a PHP developer I want to do a simple thing - I want to draw something drawn on a blank page on an Android Phone (with a finger with a largeish "emulated pen nib") and store the bitmap as a jpeg on a server by http post. Here is what I have so far but this is taken from a tutorial that is involved with writing sprites for a game.. And I cant' adapt it package com.my.example; import android.app.Activity;

JavaFX 2.0+ WebView /WebEngine render web page to an image

爱⌒轻易说出口 提交于 2019-12-20 14:13:07
问题 I'm looking for a way to load up a page and save the rendering as an image just as you would do with CutyCapt (QT + webkit EXE to do just that). At the moment and without JavaFX, I do it by calling an external process from java and rendering to file than loading that file into an ImageBuffer... Neither very optimized nor practical and even less cross platform... Using JavaFX2+ I tried playing with the WebView & WebEngine: public class WebComponentTrial extends Application { private Scene

Save remote img-file to server, with php

狂风中的少年 提交于 2019-12-20 12:43:12
问题 I want to save a remote img-file to my server, but I don't know how to do. The image url is http://img.youtube.com/vi/Rz8KW4Tveps/1.jpg and 1.jpg is to be saved and renamed to imgfolder/imgID.jpg 回答1: You can use file_get_contents() to load the remote image to a binary string inside your PHP script (file access in PHP often accepts URLs to access remote resources - this is very handy), then store that file somewhere where you have write access. Here is a very simple example: $image = file_get