save

How to save a png file with transparency?

强颜欢笑 提交于 2019-12-01 05:27:26
I am using Barcode Studio 2011 to paint a QR Code into a Graphics32 - TImage32 Component and I want to save it in png format but with the white colour as transparent this I have specified in the OuterColor of Graphics32. OnFormCreate I have just procedure TForm1.FormCreate(Sender: TObject); begin psBarcodeComponent1.BarCode := 'some text here...'; end; and for the moment I have the painting assigned to a Button Click Event procedure TForm1.Button8Click(Sender: TObject); // Paint the barcode var bmp: TBitmap32; Coords: TRect; begin bmp := TBitmap32.Create; bmp.SetSize(image.Width, image.Height)

Is there an alternative to pickle - save a dictionary (python)

梦想的初衷 提交于 2019-12-01 05:27:16
问题 I need to save a dictionary to a file, In the dictionary there are strings, integers, and dictionarys. I did it by my own and it's not pretty and nice to user. I know about pickle but as I know it is not safe to use it, because if someone replace the file and I (or someone else) will run the file that uses the replaced file , It will be running and might do some things. it's just not safe. Is there another function or imported thing that does it. 回答1: Pickle is not safe when transfered by a

How can I save data from Android service?

一笑奈何 提交于 2019-12-01 05:16:52
问题 I have a service that collects data, can I save the data in case of reboot or any other action that will restart the service, and how can I do it? 回答1: Can I save the data in case of reboot or any other action that will restart the service You will not necessarily find out when those sorts of events will occur. Save your data as you go. And how can I do it? Use a file. Or a database, which is a type of file. Or a SharedPreferences structure, which is backed by a type of file. 回答2: You may

How do I save my imageView image into Gallery (Android Development)

半世苍凉 提交于 2019-12-01 04:44:13
问题 I am trying to create an onClick event to save an imageview into the phone Gallery by the click of a Button, below is my code. it does not save into the Gallery, can anyone help me figure out why? sharebtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View b) { // TODO Auto-generated method stub //attempt to save the image b = findViewById(R.id.imageView); b.setDrawingCacheEnabled(true); Bitmap bitmap = b.getDrawingCache(); //File file = new File("/DCIM/Camera

Permissions error when saving file (sandbox)

守給你的承諾、 提交于 2019-12-01 04:20:09
问题 I'm trying to save a file to a path, in a sandboxed application [OS X], but so far am getting an error almost every time I try to save. The error is.. Error saving: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “test.txt” in the folder “Testing”." UserInfo=0x1001f5e70 {NSFilePath=/Users/Seb/Desktop/Testing/test.txt, NSUnderlyingError=0x1001f5d70 "The operation couldn’t be completed. Operation not permitted"} I have set "User Selected File" of my

How to add an ajax save button with loading gif to CKeditor 4.2.1. [Working Sample Plugin]

▼魔方 西西 提交于 2019-12-01 04:08:00
问题 I'm posting this because this may be helpful for people who do not know how to display a save icon to ckeditor in normal and inline-editing mode. I was searching for a simple save plugin but couldn't find one that was working with ckeditor 4.2.1. I decided to make my own. In my answer you'll find the code for the plugin as well as a google drive download link. This download contains the save icon as well as the loading gif icon. The plugin will add a save button to the toolbar. Clicking this

How do I get browser to prompt user to save a file dynamically generated by server?

北城余情 提交于 2019-12-01 03:34:12
问题 Clients submit post requests using jquery ajax as illustrated below: $.ajax({ url: "/xxx?request1", data: theParams, type: 'post', error: function(XMLHttpRequest, textStatus, errorThrown){ // error handling }, success: function(data){ var theResult = JSON.parse(data); // success handling } }); Apache is configured to pass requests with /xxx? to a custom app. The app processes the request and returns information. Usually, this information returned as JSoN and is displayed in the "success

Java Programming - Best way to save/read data for an application [closed]

风格不统一 提交于 2019-12-01 03:10:27
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Please forgive this quesiton if it has already been answered, but I have been searching online for the past hour to try to figure it out. I'm working on getting back into Java programming and I'm trying to

is there a way for flash AS3 to take a snapshot of a frame then save it as jpeg

最后都变了- 提交于 2019-12-01 01:20:39
is there a way for flash AS3 to take a snapshot of the frame and then save it as jpeg with out using classes Sure... try searching on google... there are tons of ways. That is assuming you are ok with the standard flash classes. If you literally mean no classes at all then good luck to you. Here is one way of doing it. flash-php-upload Basically the key points are you create a JPEG Encoder that will encode your image a JPEG (you could do a PNG if you want also) like this: var jpgEncoder:JPGEncoder; jpgEncoder = new JPGEncoder(90); Next you encode the stage by first drawing its data to a bitmap

How could I save data after closing my program?

瘦欲@ 提交于 2019-12-01 01:08:32
I am currently working on a phone book directory using dictionaries. I didn't know any way to save the information after closing the program. I need to save the variable Information so that I can add more later and print it. Information={"Police":911} def NewEntry(): Name=raw_input("What is the targets name?") Number=raw_input("What is the target's number?") Number=int(Number) Information[Name]=Number NewEntry() print Information Edit: I am now using the Pickle module and this is my current code, but it isnt working: import pickle Information={"Police":911} pickle.dump(Information,open("save.p