I have several images that I'm querying from a database. All of those files are in .png.
My current process involves downloading each image and then align them next to each other without space in between. It would be possible to stack them as well if that makes the process easier.
I am now looking for a way to take the images and basically save the file as a Picture as if they were a grouped item in Excel.
Is there a way to accomplish this? I have looked around and I've found something that did this with TIFF but that's not exactly what I have here and I wasn't able to adapt the code.
Related
Is it possible to display an image directly from variable? I made a program that receives data from sql server and generates tables in excel. However sql could also have binary values for images and so on... which I would like to display in excel cells. But loadpicture, addpicture don't support this... I would like to avoid saving them into temporary files or avoid using external programs and display directly from memory while afterwards keeping the images in excel. Is this possible?
Ok tricky :)
Shape images can comes from file or from the web. So how about to implement a tiny webserver via vba which serves those images. VBA Webserver for Excel or
homebrewed web server vba
(If you get websocks running ) BTW: to implement a webserver is rather trivial. In your case he just has to deliver the images - which is done by a base64 encoded string with a few header lines. Another way is to modify some VB.Net Webserver to a COM DLL. Also not THAT complicated simple VB.NET Webserver <<< Might be a good idea if you are on 64 bit. Anyhow if you got the Webserver thing up you can now showel your database datas into the webserver and let he deliver them to a shape by a URL. To be honest that all is pure overkill. I use a software ram disc for such purposes. For example Softperfect Ram disc. So there is no real file written cause it uses a small amount of memory for the virtual disc. Its damn fast cause the computer ram is used and after reboot everything is gone if you whish. Sure you might parse the database data by VBA and write the pixels little by little to the shape. Some guys have made a full image processor in vb6 which is nearly vba Photo Daemon So you can see how easy to decompose and compose images. I just hope that something might be usable for you. This is not really a "answer" but might give you some ideas. The pure VBA Webserver is nice if you get the winsocks running. Ive fooled around a bit with this as we was still on 32 bit - was funny :)
This was tried three years ago and did not work directly from a variable. (see Inserting an Image into a sheet using Base64 in VBA?)
Giving up the "don't save to temporary file" idea and the whole thing is easy. (see How to embed a GIF image into an Excel file). Why not save it to a file? e.g. in a ram disk?
;-)
I am currently using josdirkson's SVG extrude script to form groups of 20-30 complex shapes. My goal is to individually manipulate each object as well as the group as a whole throughout the user's interaction. I have been able to achieve this so far, however, my load time can range from 7 to 20 seconds on a variety of devices. I was wondering if a lot of this could be just inherent in script that converts all the SVG paths into bezierCurves, etc. If this was the case, I was wondering if a viable solution might be to somehow export from Three.js to a JSON or other file type which would then be the subsequent data source users are loading from. I was looking at this thread briefly, but didn't want to get too far ahead of myself before crowd sourcing a solution! Any advice or input is greatly appreciated! Thank you!
Best advice I can give you is to have a look at the profile of the loading-process. To test this in chrome, you can add pairs of console.profile('something'); and console.profileEnd('something'); calls to your code for the region you want to analyze. Then open up the Profiles-panel in the devtools and reload the page / re-run the javascript.
This will probably be able to tell you if you are right about your assumptions. At least it will help you find the thing the time in JS is spent on.
And if that's really the case, you could do some caching of geometries, using geometry.toJSON() and new THREE.JSONLoader().parse(json) to save and restore the geometries. In most cases this should be significantly faster than somehow computing the geometry. (note: there are other, more space-efficient and even more performant ways to do the caching, but the json-format is a good place to start)
I am looking for the best approach for generating images of text on the server side (preferably Node.js). It will need to accommodate things like paging (so generating multiple images of text for one text input if it is too long to fit on one page). I am looking for something that is fairly precise and allows for a good deal of type configuration.
I have looked at a few options:
Use Canvas. This approach would work for most of the use cases. I could use a text engine like textjs for the layout. However, this is somewhat limiting as Canvas doesn't have specific text metrics (for things like text height used for exact positioning). This could make paging difficult.
Use normal HTML with something like PhantomJS to generate and them capture an image of the text. While this approach will work for some use cases, it makes it hard to handle things like paging.
Use some other text engine. I've looked around and found some options - but it would need to be something that I could call from Nodejs (as I'll likely use this on AWS Lambda).
What would you recommend?
I lately did something very similar - also with node.js on Lambda. In my opinion the best approach is using PhantomJS and maybe taking the detour of generating a PDF.
With HTML and CSS you can conveniently style the output exactly how you want it, which is a great advantage about the way more complicated Canvas approach. You only have to take care of adding some horizontal space wherever you expect the pagebreak (of course this depends on your usecase and may not be necessary). Having the rendered HTML page you now have two options:
You could generate a PDF - which will take care of generating multiple pages - and then rasterize that to images
Or you directly generate an image with Screen Capture (example Code) and then splitt that image horizontally
Both approaches worked fine for me.
The Preview application on the Mac allows one to merge multiple PDF files, although the functionality is rather obscure. I'm writing a utility in Haskell that needs to perform a similar task, that is, merge an arbitrary number of PDF files into one new file.
Does anyone have a suggestion as to where to start with this? Obviously if there's a library on Hackage that will do most of the work out of the box that would be ideal, but if not, then some pointers about where to start would be very much appreciated.
I'm working on pdf library, that supports parsing and generating. It is low level, higher level tools are in todo list yet (because it is hard to design good high level API).
Here is an example of unpacking and decrypting of PDF file. It is easy to implement PDF merging, but you need to be familiar with PDF internals.
ADDED:
I create a basic example of merging PDF files in Haskell. 150 lines of code total, but it lacks few features (see comments at on the top of the file). They are easy to add, so let me know if you are interested.
The PDF file format isn't that complicated. Adobe has an official specification document for it somewhere. Essentially a PDF file contains a set of numbered "objects". You'd have to get all the objects from each PDF file, renumber them so they're unique, and then you need to fiddle with the page index so all the pages actually show up.
There appear to be a couple of packages on Hackage for writing PDF files, but I don't see much for reading them. You may like to look at the source code for pdfsplit for ideas. Also HPDF.
I am planning on creating a bible app. As you know, this will involve massive text files. And as a result if poorly implemented, the application can be quite inefficient.
I am thinking of storing the large files in raw folder but I feel that this is counter-intuitive as a result of the heavy content. And would it be feasible to use a multi-line textview to display the text files from the raw folder?
Can anyone point me in the right direction? I am really desperate as I have been poring over this issue for days!!
Thanks in advance.
How about splitting the text into multiple, smaller HTML files that you can then load into a WebView?