preview

setOneShotPreviewCallback not hitting onPreviewFrame() in callback

ε祈祈猫儿з 提交于 2019-11-30 20:49:16
问题 I'm creating a video capture activity for an app I'm making, and I want to capture a preview frame as well to use as a playback button. I've set the SurfaceView up in onCreate(...) and hooked up the camera's preview display in the SurfaceHolder.Callback : private Callback mSurfaceViewCallback = new Callback() { @Override public void surfaceDestroyed(SurfaceHolder holder) { mSurfaceCreated = false; } @Override public void surfaceCreated(SurfaceHolder holder) { try { mSurfaceCreated = true;

Display p:fileupload image in p:graphicImage preview without saving it

Deadly 提交于 2019-11-30 19:59:12
I am using PrimeFaces 5.3 <p:fileUpload> to upload a PNG image and I would like to show a preview of it in <p:graphicImage> before saving in database. Here's a MCVE: <h:form enctype="multipart/form-data"> <p:fileUpload value="#{bean.uploadedFile}" mode="simple" /> <p:graphicImage value="#{bean.image}" /> <p:commandButton action="#{bean.preview}" ajax="false" value="Preview" /> </h:form> private UploadedFile uploadedFile; public UploadedFile getUploadedFile() { return uploadedFile; } public void setUploadedFile(UploadedFile uploadedFile) { this.uploadedFile = uploadedFile; } public void preview

Modelbinding for empty query string parameters in ASP.NET MVC 2

为君一笑 提交于 2019-11-30 17:16:39
The behavior described here appears to now be the default for ASP.NET MVC 2 (at least for Preview 1). When modelbinding a querystring like this : ?Foo=&Bar=cat The following binding occurs (assuming you're binding to a model with 'Foo' and 'Bar' string properties) ASP.NET MVC 1 model.Foo = ""; model.Bar = "cat": ASP.NET MVC 2 (preview 1 through RC) model.Foo = null; model.Bar = "cat": Wanted to give anyone who is playing with V2 a heads up since this wasn't mentioned in the ' gu-notes '. Also curious if anyone in the know can comment on whether or not this will be the final implementation or a

Implementing my own print preview?

亡梦爱人 提交于 2019-11-30 15:37:56
问题 I have developed my own Report Control which is simply nothing but drawing text on a CDC of the control window's client DC. I have got the printing function to work too. The report output is sent to the printer directly. However I want to let the user know the output before the report is actually printed. I cannot do this using MFC's print preview architecture as my project is not using the doc/view architecture. Is it possible for me to create a print preview window myself ? How does MFC

Rails 3: best way to preview image before upload

£可爱£侵袭症+ 提交于 2019-11-30 12:33:46
I need to preview an image prior to submitting a form. I work with Rails 3 and needs something that is browser compatible. Any ideas how I can achieve that? Kulgar So! :) The main idea is to use the FileReader Javascript Class, which is really handy for what you need to do. You just have to listen to the "change" event on your file input and then call a method that will use the "readAsDataURL()" method of the FileReader class. Then you just have to fill the source of a "preview img tag" with the returned result of the method... I've wrote you a simple jsFiddle that achieves what you want. You

ASP.NET MVC 2 - HTML.EditorFor() and Custom EditorTemplates

我的梦境 提交于 2019-11-30 08:55:22
With MVC 2's addition of the HtmlHelper EditorFor() it is not possible to create strongly typed Display and Editor templates for a given Model object and after fiddling with it I am a bit stumped as to how to pass additional Model data to the editor without losing the strong-typing of the editor control. Classic Example: Product has Category. ProductEditor has a DropDownList for Category containing the names of all Categories. The ProductEditor is strongly typed to Product and we need to pass in the SelectList of Categories as well as the Product. With a standard view we would wrap the Model

Best way to show image previews before upload in rails & carrierwave

杀马特。学长 韩版系。学妹 提交于 2019-11-30 08:37:02
I've been using rails for past few days and wanted to know what is best way to show image previews before upload in rails & carrierwave. I came across a few options like using plupload or jquery file upload or using uploadify. If you only need image preview in a form before upload, you (as me) will see that JQuery Upload plugin is just too much complex and not so easy to run properly (I was able to see the preview, but then I couldn't upload the picture). http://saravani.wordpress.com/2012/03/14/preview-of-an-image-before-it-is-uploaded/ It's simple and fast to code. I put the code here just

How to recover camera preview from sleep?

删除回忆录丶 提交于 2019-11-30 08:35:43
问题 I have an application that shows camera preview and I would like the user to be able to put the phone to sleep and then wake it so that my application will recover correctly. The problem is that when returning from sleep the camera preview won't restart. I have implemented the camera preview as is presented in the api demos, but it seems that the api demo example works only through sheer luck. In the example the screen orientation is forced to landscape, which means that the phone will go

Android Camera Preview Switch between cameras

大憨熊 提交于 2019-11-30 05:26:52
问题 Hi guys i am trying to switch between the device's Front and Back Camera while showing the camera preview. I am following the sample provide by common ware. Below is the code which i am using and whenever i click on the Flip button the surface view goes black and i don't know where i am going wrong. Please help me to solve this issue. I searched about this and i didn't get any suitable answers as some have tried to restart the current activity but i dont want like that. Hoping for better

how to preview an image before upload in various browsers

柔情痞子 提交于 2019-11-30 05:24:24
I want to show preview of an image before it is uploaded. I have found a partial solution that works for ie6 and firefox, and havent yet tested it in ie7 or ie8. But i want a solution that works in safari, ie7 and ie8 as well. Here is the solution obtained by combining the ie6 and firefox solution: function preview(what) { if(jQuery.browser.msie) { document.getElementById("preview-photo").src=what.value; return; } else if(jQuery.browser.safari) { document.getElementById("preview-photo").src=what.value; return; } document.getElementById("preview-photo").src=what.files[0].getAsDataURL(); //