Take a screenshot using Javascript without libraries - electron

I wanna build an electron project that will be used to take screenshots and save them. But the main problem is that I don't know how to do this using javascript. I have found a couple of answers but they all included some libraries (mostly html2canvas). So could you give the working code to take screenshots using javascript with no library?

here's how to draw dom into a canvas.
After drawing it on canvas,you can download it by creating canvas's URL.

Related

Dynamic 3DObject use in ARKit-SceneKit

I want to download the 3D Object-dae(collada) file from server and want to display on surface dynamically so can please share how can I achieve this in ARKit via SceneKit or else?
You can check this link: https://the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/ it is old post but I don't think something is changed since that
According to this (see the Discussion section): https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension?language=objc
dae is not supported at runtime (ModelIO).
Additionally I'm working on a library called AssetKit (In Progress) and it will full support COLLADA and glTF, it is too early to say that but after initial release, you will be able to load dae files dynamically. It is written with C99 but I'll optimize it for Swift (by writing wrappers or integration with SceneKit...). Since it is still in progress I suggest that follow the first link

iOS library to view 3D STEP files (.stp)

I already searched the web for a library I can use in my iOS project to show 3D STEP files.
...without success.
Does anyone of you know about a library that can show real 3D STEP files without converting them?
...or does anyone know of an App (that's available in the App Store) that can show STEP files without converting them into another file format before?
Appreciate your help!
Thx,
Dennis
Most STEP files contain BREP/NURBS geometry, which has to be converted to triangles for visualization with graphics libraries like DirectX, OpenGL, or WebGL. For open source, you may want to look at OpenCascade (OCCT and OCE), pythonOCC, FreeCAD, BRL-CAD, and STEPcode.

Photoshop Layer Style to CoreGraphics Code

Is there a way to easily export layer styles, created in photoshop, to core graphics code? Maybe a photoshop plugin or a .psd parser for use in xcode. I imagine someone has made (or should make) a process to more easily facilitate the "from design, to code" process. The only thing I could find on google was Opacity which takes illustrator files and outputs core graphics code.
Or maybe a third party program similar to this which creates a familiar layer style interface and exports css code.
Update : Found this today. MooMaskedIconView
Found it : http://www.paintcodeapp.com/
If you just want to apply effects to an image, you can use Core Image, which comes with 48 filters. Currently there isn’t a way to build custom filters on the iOS platform, that's a drawback … But to get started I sugesst you to take a look at Ray Wenderlichs tutorial Beginning Core Image in iOS 5 Tutorial.
Another approach is using 3rd party libs. For example ImageMagick, which has a huge feature set :)
I use Save for Web & Devices. Png-24 keep the opacity but there is no facilities for layers. When you save, the LNG becomes what you are looking at. So it's easy to keep several layers in the same Photoshop file.

Integrating phoneGap with native iOS app

i'm trying to create an app which uses the combination of native functionality and the phoneGap framework. The native app has a button, upon the click of which the phoneGap ui has to be added to the view. Is there any way to achieve this? Are there any tutorials for the same?
Yes, this is possible. Although you might be getting yourself into some headaches. My app kind of goes the other way around, it's mostly phonegap, but occasionally i'll pop open a view that is native. Here is the link to code that shows an excellent example of how to switch between the iOS and phonegap worlds.
new updated recommended article (see update below)
These files represent a standard plugin used in phonegap. In this particular plugin, a native view is opened on top of a phonegap view. Notice you have a custom xib and everything. This plugin can be modified to display any xib with any functionality you could think of.
If you implement this plugin you will easily see how to jump back and forth. I've successfully heavily modified these classes to add LOTS of native capabilities to my phonegap project. Also you should probably check out the official phonegap guide to phonegap plugins. Here
Important Edit
Was informed original linkwas broken (not terribly surprised as this answer is very old and i've long since moved away from Phonegap) so I replaced the original link with an article that shows how to do these plugins well. In the article it explains the link is broken and gives several links where these older files are maintained, but in fact those are broken as well. Here is a branch of one of them I found that still hosts the original files on an "archive" branch. But I haven't investigated whether these files are wildly different from my original work. Good luck!
That's not how Phonegap is meant to be used.
To achieve what you are asking for you just need to create a Phonegap app and add the extra native functionality by writing a Phonegap plugin in Objective-C. You may add as much native code as you want.
I'm actually wanting to do the same thing as the original poster. Theoretically it would be comparatively easy, but non-trival to do. I'd love it if there was a PhoneGapView that one could integrate into an existing project. Bonus points if said PhoneGapView could be integrated in Interface Builder as a re-sizeable and re-positional object, basically think of it as an Object that extends UIWebView.
This is wishful thinking on my part seeing as this is how the higher-ups want my project.

Getting text from image on ios (image processing)

I am thinking of making an application that requires extracting TEXT from an image. I haven't done any thing similar and I don't want to implement the whole stuff on my own. Is there any known library or open source code (supported for ios, objective-C) which can help me in extracting the text from the image. A basic source code will also do (I will try to modify it as per my need).
Kindly let me know if some one has any idea on this.
Thanks,
Vikram
One of the main open source libraries used to do OCR on iOS is a google-sponsored open source project called tesseract.
Here is some info on compiling tesseract for use in iOS apps:
tesseract
The same guy has a nice sample project on github demonstrating how a simple client might use the compiled library:
Pocket-OCR

Resources