How can I do a form with an image spinning in Delphi? - delphi

Like those we see in website. And where do I get the images?

Go to ajaxload to generate an image. Then find a delphi gif image component. Try here for a start.

The "spinning images" are usually animated GIFs. Do a google search for the phrase in quotes to learn about them, and you should also find software that will help you create them as well. Support for them has been included in Delphi for a couple of years now.
If animated GIFs aren't good enough, you can look into AVI files. They're what Windows uses to show files being copied, folders being scanned, and other things. TAnimate is the Delphi component that supports them.

I do suggest running your "work" in a separate thread. AsyncCalls is a good library which works well for helping you get there easily. Tight loops or blocking calls can cause your animation to look jumpy or stop completely.

Related

How to let vim do syntax highlight right for flutter?

Some background: I am using VSCode for coding in flutter. But when I open many workspaces, it ate all my free RAM quickly (Macbookpro 8GB). (IntelliJ is even worse.) Sometimes, I just need to check other workspaces' Code etc.. So The best option is to use vim for this purpose.
I have installed dart-vim-plugin, but the syntax highlighting is not really correct for flutter, for example, BuildContext, Scaffold, AppBar etc.. all the class types are pure white color. To minimize the RAM usage, I just don't want any analysis server, auto completion etc.. I just want the editor has a correct syntax highlighting so that I can easily check the code. Is that doable?
Thank you very much for your help.
PS: I just want to use an editor which only does syntax highlight. I really don't have much free RAM. Normally, there are only 600MB left and I don't want to use them all.
Even if I am new to vim syntax highlight, since nobody provides an answer, I have to study how to do this by myself. I have created my own dart.vim and put it at ~/.vim/after/syntax/dart.vim. Note this is just an add-on for dart-vim-plugin, you still need to install it. Hopefully, this will help somebody some day.

What would be the best way to create a firefox plugin for taking desktop screenshots?

I need to create a firefox plugin that allows a user to take screenshots of any part of their desktop and have them uploaded to a server. There seems to be lots of plugins for screen capturing a webpage, but nothing for capturing anything outside of firefox. So after a little research I have not found much information on how this might be possible. I don't want to resort to a using a java applet but I will if that is my only option.
Does anyone have advice on how I might create such a feature?
Thanks
I don't think a Firefox addon is the most appropriate approach here. Maybe split the task into a Firefox addon to offer the "upload to a server" component and a native app to do the desktop screenshot (or just integrate with existing screenshot tools).
If you're worried about complicating the installation process for end users, you could look into bundling the addon component and native app into a single installer (e.g. MSI on Windows, RPM on Linux, etc.). You'll have to come up with different apps for each platform you want to support (and maybe even each version - e.g. Windows XP vs Windows 10).
Whatever you decide, you'll probably need to create a more specific question to get further help here (there's no simple Firefox.Addons.API.TakeScreenShot() answer I'm afraid).
Also make sure you're using the right terminology - a plugin is the deprecated NPAPI approach whereas addons are still supported.
I'm actually working on taking native desktop screenshots just in the last coupel of days. I'm using js-ctypes. My work goal is the same exact thing to, upload to server. If you would like to collaborate I am very open to it! We can chat about it on #jsctypes irc channel :) irc://moznet/jsctypes (Mibbit IRC WebApp) If you don't know js-ctypes thats ok i can handle that while you can handle uploading techniques, and an editor on canvas :) The editor is a huge part of it, you can see my ideas/plans here: https://github.com/Noitidart/NativeShot/wiki/NativeShot
I'm really really interested in a collab on this!
I'm still working on windows right now, the color is messed up: https://github.com/Noitidart/NativeShot/tree/digitanks-method
I was just about to start OSX work following this example here: https://developer.apple.com/library/mac/samplecode/SonOfGrab/Introduction/Intro.html and here: Take ScreenShot without Window
You can install the addon from that branch and click the icon that gets added to the toolbar, it will take a screenshot with 3sec delay and then append it to the body of the selected tab. (Windows only right now)
Doneskis baby check it out: https://addons.mozilla.org/en-US/firefox/addon/nativeshot/
Got some quirks. Released it as v1.0 though. I'm working on Android support, pretty close. I need to flesh out the editor tools. Please let me know if you're willing to collaborate.

math(jax) in epub for ipad

dear experts: we would like to publish a magazine in epub format, so that it can be read on iPads. (our creation system is now multimarkdown -> specialized post-processor -> calibre .) the problem is that our magazine needs math. this is not a problem on the epub viewer in ubuntu, as invoked by calibre. it invokes mathjax just fine. however, transfering the epub to a (net-connected) ipad (open in ibook) does not execute mathjax to display the equation. eventually, I also want this to work in android tablets, but for now, ipads are our only target. (iphones are too small for us, anyway.)
I do not want to graphically render the content, because I have never seen this look nice.
is there any way to create an ebook with mathjax for an ipad? the best choice would be if there were a way to get ibooks to execute javascript? if not, is there a tool that makes an app with ebook-reader-like functionality from html5 (incl javascript)? (does the javascript need to be local, or can it be web-connected?) if not, then what?
sincerely, /iaw
You can use MathJax in iBooks if you include a (slimmed down) MathJax installation within the ebook itself. This is not a great solution, but it can be made to work. See this article for some tips on how to do it. It is a little out of date, but I think it should still work.
In terms of preprocessing, which I know you don't want to do, you could use MathJax to generate SVG versions of the mathematics, which look pretty good on iOS, and should render on other platforms as well, so that might be a viable option for you.
I have posted a short script in
https://tex.stackexchange.com/questions/154644/eqnarray-math-to-svg?noredirect=1#comment353540_154644
that is a start for converting inline mathjax into inline svg. this should work in any epub and remove the mathjax dependency. it still has baseline problems, but it's a start. it rescales. hopefully someone else will pick it up and make it more robust.

Any good PDF export filter that works with Fast Report?

I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.
If you know or use a PDF export filter which works with Fast Report, please let me know.
November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.
October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.
Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:
And on Windows:
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.
From my experience, here's what got me into trouble:
Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.
Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!
Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).
I opened that document on the following mobile devices:
iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.
About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:
Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.
AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).
Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.
It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.
See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.
The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.
The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.
Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.
In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.
Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.
After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.
Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html
I use wPDF from WPcubed components, it's really a great product, good value for money
You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.

Skins in delphi7

I wish to skin my aplication and have noticed that there appears to be no obvious way to do this.
I am used to skinning files for java and wondered if there was any way of changing the appearance of the "standard" delphi7 application.
Edit:(taggs)
Have you looked at SpTBXLib?
http://www.silverpointdevelopment.com/sptbxlib/index.htm
I use the Developer Express Skins library. This works well for standard components, and their own. You can create custom skins, or use their standard ones which include nicely designed haloween and winter ones. They also have a ribbon control to make your app Office 2007 look.
I've seen positive comments about AppFace, but I have not tried it.
Looks like there are some relevant links in this forum thread
Appface looks promising with the extreem looks and the need for just 2 lines of code. but thats a lot of money to make four buttons and a editbox look nice.
linkrank does the same thing but does not look as good and costs even more this time about 180.
Again both seem to boast that you only need 2 lines of source code and theme file.
the link to given forum did not seem to yeild any results apart from these two.
Would be br8 to find a free version even if i have to put in more work myself.
Edit: "suipack" is yet another tool for the same job
Re-Edit: VCL seems to be the basis of what is needed here some copenents listed on
http://www.vclcomponents.com/catalog/Delphi_Skin
Re-Edit-2: found a freeware version here
Re-Edit-3: added coponent but not only is there no help file with this it seems to be incomplete as throws a cannot find "skins.pas" exception
http://www.vclcomponents.com/Delphi/Form_Enhancement/VclSkin-info.html
gone evaluate it and post results back up.
After spending hours installing it or not,, as the case was,, installed the unicodecontroler and the toolbar2000 but the toolbar200 seemed to have a issue with the library path and after i fixed it it would not alow me to reinstall, i had to do this as SpTBXLibDsgn_*.dpk would not install due to not finding reference of tb2kdsgn_d7.dpk..
this results in me going ARRRRRGGGHHHHHH and bashing my head on the wall, the only method for creating skins for free in delphi7 comes as 7 manual installs(as a noob this was hard)
and thenn when i make a boo boo it wont let be uninstall,,, ouch
looks like there will be no styles for me....
Edit: if anyone wants to go for styles i seriously suggest the multiinstaller that i didnt see untill i had currupted my tbk2000 package :(
Another skinning component set for Delphi is AlmediaDev
AFAIK, there are two Delphi components available to skin your application without requiring any code, but both are not free
VCLSkin
SuiSkin

Resources