preview

subclassing SurfaceView and overriding onDraw() to change SurfaceView parameters to generate preview of desired size

蹲街弑〆低调 提交于 2019-12-04 14:35:14
I have subclassed the SurfaceView and instantiating it in onCreate of the Activity. The preview is generated but the control never enters onDraw() which is overriden in the subclass of SurfaceView. Why is that? class ActivityClass extends Activity{ onCreate(){ mPreview = new Preview(this); setContentView(mPreview); } public void startPreview(){ rec = new MediaRecorder(); rec.setVideoSource();....... rec.setPreviewDisplay(mPreview.getSurfaceHolder.getSurface()); } } class Preview extends SurfaceView implements SurfaceHolder.Callback{ SurfaceHolder mHolder; public Preview(Context context){ super

How to preview any files inside a Java application?

我只是一个虾纸丫 提交于 2019-12-04 12:57:43
问题 I'm using a JTree to browse the content of a folder and I want that when a user click on a file, the software shows a preview of it (a screenshot of its first page). The files are mostly Office documents and PDF. I manage to do it for PDF file using a module downloaded from Sun, but I'd like to know if there is a way to do it using any software (JARs preferably) or even the built-in Windows API. I was thinking of converting the file to PDF then do a preview of this PDF but this isn't optimal.

Android How to preview an image, using its file path from SDcard, from my application

邮差的信 提交于 2019-12-04 10:11:46
File is present in sdcard/image.jpg I would like to create my own application (activity). On a button press, the image stored in the sdcard needs to be displayed using the built-in image viewer. On pressing the back button from the Image viewer, it should go back to my running application. Need some help. Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, 1); This code use for display all images from your SD card you can create an Intent with proper uri and mimetype for this. Intent i = new Intent(Intent

Reopening camera after intent chooser is canceled

一世执手 提交于 2019-12-04 09:35:07
I have created a custom camera preview view CameraView which extends SurfaceView , and it also implements SurfaceHolder.Callback interface. The view operates with the camera. When you open the view it shows a camera preview. On the same screen there is also overlay with two buttons - 'Take picture', 'Choose from gallery'. The activity that holds the CameraView releases and reopens the camera in onPause() and onResume() methods. If I click the 'Choose from gallery' button, the following intent is created: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*");

SurfaceView with camera preview is not destroyed

六月ゝ 毕业季﹏ 提交于 2019-12-04 09:00:30
I have a Tab Activity with 2 tabs (activities). Each tab has a 3d Open GL scene drawn on top of a SurfaceView with camera preview. Yet, depending on device orientation, tabs are being switched. The problem is that when the other activity starts, it calls camera.open(), which generates exception, saying that camera service is unavailable. In fact, the problem is that camera is not stopped when activity is paused, in other words onSurfaceDestroyed() is not called for the SurfaceView. I tried to stop camera when onPause() for activities is called, but get the same error still. Anyone had same

Oauth2 for SharePoint 365 REST

谁说我不能喝 提交于 2019-12-04 08:38:59
问题 I'm trying to connect to Sharepoint Online (Sharepoint 365?) content using OAuth2 and the REST API. I need to do this from Python as it is an addition to an existing application. I have already managed to connect the application to Google Drive using OAuth2 and REST, so I think I understand the fundamentals of using OAuth2. I've tried a number of combinations of places to configure the client_id and client_secret and authenticate and receive access and refresh tokens. So far I have been able

Is there any way to generate a thumbnail image of a DOCX file?

泄露秘密 提交于 2019-12-04 08:10:05
I have done this using "pay" tools like ASPOSE, but I was curious if there are any open source tools out there that will do this. I am sure there may be tools out there to do that, but if you can get the file into a format that can then be rasterized easily, it may be worth exploring that. eg converting the work doc to pdf then thumbnailing that. 来源: https://stackoverflow.com/questions/5921761/is-there-any-way-to-generate-a-thumbnail-image-of-a-docx-file

How do you automatically remove the preview window after autocompletion in Vim?

穿精又带淫゛_ 提交于 2019-12-04 07:21:39
问题 I'm using omnifunc=pythoncomplete . When autocompleting a word (e.g., os.<something> ), I get the list of eligible class members and functions, as expected, as well as a scratch buffer preview window with documentation about the selected member or function. This is great, but after selecting the function I want, the preview window remains. I can get rid of it with :pc , but I'd like it just to automatically disappear after I've selected my function, a la Eclipse. I've played around with

How to use Google Chrome Thumbnails preview service?

笑着哭i 提交于 2019-12-04 05:28:55
问题 anyone know how to use google chrome service to generate web site thumbnails ? (Most viewed site on new tab). Any idea to do a similar thing? These: Browsing chrome source code I was not able to find anything interesting... and you? SOURCE HERE : http://src.chromium.org/viewvc/chrome/trunk/ 回答1: I think it was: chrome://thumb/{url} but i'm not sure... Revised: It's chrome://thumb/http://www.{url}/ Also, I found some information here http://code.google.com/... Sorry for my English 回答2:

How to create url preview in JavaScript?

你说的曾经没有我的故事 提交于 2019-12-04 03:53:54
Can someone help me with creation of a url previews in JavaScript? What I mean is this: Say I have a link on my site, I want the user to be able to mouse over the link, and have an image pop up that shows what the target of the link looks like. Don't worry about the css, I got that working, I just need the actual script to show the image. Currently I am doing it by showing up an iframe that actually renders the page, but this is not scalable and looks ugly. Having the page display premade images is not an option, since the links will be linking to dynamically generated user content. You need