save

Easiest way of saving wpf Image control to a file

 ̄綄美尐妖づ 提交于 2019-12-17 10:49:34
问题 I have a Image control inside my wpf application, which has a large image inside of it, but the control itself is only 60x150, this means it only shows a certain portion of this image. What is the easiest way of saving the visible portion to a file? Thank you for your help. [EDIT] I ended up using code found here (which I've not been able to locate before posting here)... Grid r = new Grid(); r.Background = new ImageBrush(image2.Source); System.Windows.Size sz = new System.Windows.Size(image2

Save Matlab invisible plot under terminal as an image with same size

萝らか妹 提交于 2019-12-17 10:34:09
问题 I am SSH connecting to a Linux server and do some MATLAB programming. I would like to save invisible plot as figH = figure('visible','off') ; % Plot something % save the plot as an image with same size as the plot close(figH) ; saveas() and print() will change the size of the saved image different than the size of plot. Also for print() , all three renderer modes ( -opengl , -ZBuffer and -painters ) can not be used in terminal emulation mode on the Linux server. getframe() doesn't work either

In Matlab, is it possible to terminate a script, but save all its internal variables to workspace?

孤人 提交于 2019-12-17 09:33:56
问题 I am running a script, but it is taking much too long so I want to terminate the script. However it has calculated a lot of data which I would ideally not want to throw away. Is there an alternative to ctrl-C with which you save the internal function variables to the workspace? Ideally I'm looking for a Matlab keyboard shortcut like ctrl-C , but if that really can't be done maybe there is a way to do this in the script of my function. Any idea how to let my script react to ctrl-C as well, or

Valid file path for archiverootobject and unarchiverootobject

℡╲_俬逩灬. 提交于 2019-12-17 07:56:08
问题 I am making an iPhone app and in a previous question I was told that I needed a valid file path for archiverootobject and unarchiverootobject but I don't know how to make one. So what is a valid file path to save arrays of custom classes? Follow up question: On the linked question I have set up my methods to use invalid saves but it still works would anyone know why? 回答1: You can save it to a subdirectory folder named with your bundleID inside the application support folder or you can also

android how to save a bitmap - buggy code

血红的双手。 提交于 2019-12-17 07:38:16
问题 Im trying to serialize a class in wich i have a bitmap variable. Here is the code that is a bit working.... I need help to find out what is still wrong..... private Bitmap myVideoScreenshotBm; private void writeObject(ObjectOutputStream out) throws IOException{ out.writeInt(myVideoScreenshotBm.getRowBytes()); out.writeInt(myVideoScreenshotBm.getHeight()); out.writeInt(myVideoScreenshotBm.getWidth()); int bmSize = myVideoScreenshotBm.getHeight() * myVideoScreenshotBm.getRowBytes(); ByteBuffer

Store and read hash and array in files in Perl

眉间皱痕 提交于 2019-12-17 07:34:08
问题 I'm a noob.I need some basic knowledge about how data should be saved and read under perl. Say to save a hash and an array. What format (extension) of file should be used? txt? So far I can only save all the things as string print FILE %hash and read them back as string print <FILE> . What should I do if I need my function hash and array inputs from a file. How to put them back to hash and array? 回答1: You're looking for data serialisation . Popular choices that are robust are Sereal, JSON::XS

Saving multiple ggplots from ls into one and separate files in R

一曲冷凌霜 提交于 2019-12-17 07:12:58
问题 I have several ggplots as objects on my ls. I want to save them as separate files (although I would also be interested to know how to save them all under 1 big file). I have read this: question and question but I can't seem to adapt the code. I also tried to plot them all in one big file as suggested here but do get this error: Error in do.call("grid.arrange", plots2[[i]]) : second argument must be a list . There's something that I am missing in getting all the ggplots in one list. This is

How to save a bitmap on internal storage

感情迁移 提交于 2019-12-17 03:02:12
问题 this is my code I and I want to save this bitmap on my internal storage. The public boolean saveImageToInternalStorage is a code from google but I don't know how to use it. when I touch button2 follow the button1 action. public class MainActivity extends Activity implements OnClickListener { Button btn, btn1; SurfaceView sv; Bitmap bitmap; Canvas canvas; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

How can I save all the variables in the current python session?

白昼怎懂夜的黑 提交于 2019-12-17 02:34:12
问题 I want to save all the variables in my current python environment. It seems one option is to use the 'pickle' module. However, I don't want to do this for 2 reasons: 1) I have to call pickle.dump() for each variable 2) When I want to retrieve the variables, I must remember the order in which I saved the variables, and then do a pickle.load() to retrieve each variable. I am looking for some command which would save the entire session, so that when I load this saved session, all my variables

Browser event when downloaded file is saved to disk

China☆狼群 提交于 2019-12-17 02:31:34
问题 I have sensitive files to download to users, and each user is permitted to download a given file exactly once. If the download fails, I want to permit the re-download, but not otherwise. It's not sufficient to rely on logging/processing the file download request at the server - I need to know deterministically when the file is complete and in place at the client, since many of my users work in an environment with frequent connectivity drops. The most straightforward way for this to work would