I have Canon RAW images (.CR2) with resolution 5760x3840. When I read them to a Delphi (Embarcadero RAD Studio XE5 Update 2) application using Loadfromfile, I get bitmaps with a resolution 5760x3240. However, the bitmap represented by my CR2 images is 5760x3840 (CorelPhotopaint shows the full resolution in the same computer). As far as I understand, the TWICImage clips some lines from top and/or bottom of the bitmap to force it to 16x9 format. I am using a Microsoft camera codec downloaded a few days ago (6.3.9721.0). Is there a way to prevent clipping, and are the missing 600 lines 300 from top, 300 from bottom?
Related
In a Delphi FMX applicatoin, why are font sizes off by a factor of 1.35 (too small). For example, if I put a TMemo on a FMX form and change the TextSettings.font.size to 72, the spacing between the lines should be exactly 1" (as the are in VCL). But to get the same spacing I need change memo scaling to 1.35 of make the font 97.2 points. Oddly the fonts are also the wrong size in the dialog to select a font. Is this a bug or do I have something set wrong?
I do have a large monitor but not scaled the fonts (Windows 10) and everything reports that it is seeing the default 96 dpi.
Target in currently Win32 (I have not tried it on OSX yet)
As per the Embarcadero web site:
Font sizes in FMX are expressed in device-independent pixels (DIPs),
96 per logical inch. Font sizes in VCL are expressed in points, 72 per
logical inch. Therefore, text using the same Font.Size is smaller in
FireMonkey.
As such, the ratio is 96/72 = 1.3333.
Edit: Came across this very nice explanation on the MSDN web site about Dots Per Inch (DPI) vs Device Independent Pixels (DIP). Relevant to why FMX uses DIP.
I have read the recent posts on the Highcharts.com website regarding their updated PhantomJS based exporting-server. I have also cloned their github repository and successfully compiled their web-service. However, all files produced by this server are marked as 96dpi, which is inadequate for my purposes. According to somewhat contradictory information on the Highcharts.com website (Here and Here), they are using Batik to rasterize PNG and JPG output, which should make it possible to adjust the DPI settings of the exported raster images. However, the pom.xml doesn't include any batik references and I can't find anything in the source code which indicates that anything other than PhantomJS is being used to produce the raster renditions. The PhantomJS export might be able to adjust the DPI, but I can only find the scale and width options which don't directly adjust the DPI, thus requiring a tedious post-processing rescale (or metadata edit) to adjust the DPI accordingly.
So, the meat of my question: how to adjust the exported DPI of a highcharts chart in PNG and JPG format when using the highcharts java exporting-server?
The release before the last one used both Batik and PhantomJS. The last release uses only PhantomJS. This is why you do not find any Batik references in the pom.xml anymore.
For controlling the dpi of the exported image. You should use the scale parameter. For completeness sake, here is how Highcharts determines the dpi of the exported image.
Controling the size of the exported image
Since Highcharts 3.0 and Highstock 1.3, the size of the exported image is computed based on a few rules:
If the exporting.sourceWidth and exporting.sourceHeight options are set, they take predence. This provides a convenient way of having separate sizes of the on-screen chart and the exported one.
If not, and the chart.width and chart.height options are set, those are used for the exported chart.
If a size hasn't been found yet, and the containing div has an explicit pixel width or height, that width or height is used. Percentage and other non-pixel widths will not take effect. This prevents a common pitfall in Highcharts 2, where charts with the typical 100% width would look out of proportion in export.
If a size still hasn't been found, it defaults to 600 by 400 pixels.
After rendering the chart width the above size, and all text sizes in relation to that, the actual image resolution is determined by exporting.scale which defaults to 2. In practice this means that a 600x400 chart will return an image of 1200x800 pixels by default. The rationale behind this is quite simple - if we used a scale of 1 and just set the sourceWidth to 1200 and sourceHeight to 800, all the text would become too small. And if we didn't scale it up, the resolution would be too small for print.
Read also here for more on the export server
I'm using twaindotnet to scan an image with 2400 DPI. Whenever I scan a full page in color I get a message that there is not enough memory to perform this action. I tried it on a different computer with around 4 GB of ram and got the same error message.
If I scan the image as black and white or gray-scale I don't get any error and everything is working fine.
Is that a problem that is related to the scanner driver (Canon 9000F) or is this a general TWAIN problem?
gray-scale images have a bit depth varying from 2 to 8. for an image of legal size and of 2400 dpi, the size can be 163 MB ~ 654 MB.
color images have higher bit depth. take 32 for example, the image of the same size and dpi can be around 2.62 GB. plus the memory occupied by other applications, 4 GB memory likely runs out.
File Size = (height x width x bit depth x dpi2) / 8
dpi2 means dpi square
Looks like that Twain library is scanning to memory, the Twain specification also has a file transfer mode which is generally used for very large images (ICAP_XFERMECH). Twaindotnet may allow you to choose the file transfer mode when scanning.
I've been working with a program someone else has made and I wanted to change the icon.
The icon I have is 256x256. I used http://converticon.com/ to create the icon (from a bmp I think). I used the icon in Inno Setup to create an installer and it worked fine
So I go to Options -> Application and attempt to load it. However, Delphi 2007 gives me an error 'The parameter is incorrect.' with this info: http://i.stack.imgur.com/vRCgs.png
When I do the same thing in Delphi XE, it works and loads the icon and changes it on compile. I can't use XE right now because the program uses a math parser that has a problem with unicode (thats something to fix for later haha)
So, what I did was open the project in XE, change the icon, save it, delete the dproj and open it in 2007. This works, compiles and displays the correct icon, but when I go to the project options, it gives me the same 'The parameter is incorrect' error.
The workaround isn't a big deal, but I shouldn't need to do it. Does anyone know why I can't change the icon in Delphi 2007?
Edit: I just used that same converticon site to convert the 256x256 icon to 192x192 and smaller and now it works perfectly. Thanks for the answers
The "icon" file is actually a collection of images, at different resolution and using different encodings. When I'm creating my icons I'm making sure they don't actually contain the 256x256 PNG-encoded version because development tools built before Windows Vista don't understand that. And that includes your Delphi 2007 and my Delphi 7. I also remove the alpha-encoded 256x256 icon because it simply makes the file needlessly large.
You've got two fixes possible:
Find an ICO editor and remove all of the larger formats until your Delphi accepts the icon. I personally never seen the 256x256 used in the real world, they'd take up huge amounts of space on user's Desktop or in Windows Explorer.
Use a dummy icon and replace the icon resource in the generated exe after Delphi is done with it. This way you can keep all of the larger image formats, including the 256x256 PNG image.
Edit to correct an error
If possible, always include the 256x256 image, Windows scales that down for everything above 64x64.
I always assumed Windows Explorer would show an image that's based on the closest matching image size available in the ICO. That is, if a 128x128 image is necessary, Windows would use the 128x128 image if available, or scale down the 256x256 image if that's available, or scale up the 96x96 image. Apparently that's not so. I've just made a test icon consisting of several image formats, including 32, 48, 72, 96, 128 and 256 consisting of simple blobs of color (using the flood-fill tool). In Windows Explorer I cycled throw the various Display Modes, and it became apparent that starting with "Large Icon" (and that's not very large) Windows will scale down the 256x256 icon, and if that's not available, use the 48x48 icon, unscaled! The result is truly ugly and unexpected. The 72x72, 96x96 and 128x128 icons were simply ignored.
Thank you David for pointing this out.
Older versions of Delphi don't support 256px Vista icons. I believe that 2010 does not support them so I guess the limitation was fixed in XE.
When working with an older Delphi you'll need to keep the 256px icon out of the IDE. You can still build an executable with a 256px icon from the command line compiler - I used to do just this before upgrading from Delphi 6. But to do this requires the use of a competent resource compiler, for example the Microsoft one.
2007 will let you select icons with a 256 pixel image. Here is what I tried:
The default icon for Delphi XE contains several image sizes, including a 256 pixel image.
If I extract the icon from a Delphi XE application using a resource editor, I can add that icon to a Delphi 2007 application using the IDE's project options. I don't get an error, and the icon images show as expected in Windows Vista/7 using Explorer at different sizes.
If I take the same icon that worked in Delphi 2007 and remove all of the image sizes other than the 256 pixel image using IcoFX, and try to select it again, then I get an error.
Try creating a .ico that includes other image sizes and see if that works for you.
My netbook has a monitor with 10.1 inch length and 1024*600 solution. I think 1pt is about 1/72inch - is the following computation right?
Since the resolution is 1024*600, the
diagonal has about 1186.83 pixels,
thus 1 inch is about 1186.83/10.1 =
117.51 pixels, and thus 1pt is about 117.51/72 = 1.63 pixels, or 1 pixel is about 0.6127 pt.
Using this relationship, I've inserted an image into a LaTeX document, converting pixels to pt, and take the result as a parameter to includegraphics, but the figure in the resulting document is rather blurred.
Is the computation correct? if
not, how or
where am I wrong?
How can I insert an image into a LaTeX document
with precisely the same dimensions as the
original?
Updated:
I'm using pdflatex to compile the document and the image is a png file, and the reason why I do such a stupid computation is that with no width parameter set, the image shown in the document is larger than the actual size, and I can't work out why.
LaTeX is for creating paper documents. The units it uses refer to distance on the paper output, not on the screen. So if you ask for a distance of 72pts in LaTeX, you'll get 1 inch on your printout, but the distance you get on your screen depends on the zoom-level of your pdf or ps reader, which probably doesn't know how big your screen is.
If you simply want to get the raster grid of your image to fit to the screen grid, I'd say the best thing to do is get a higher-quality graphic if you can.
(PS there's a TeX stack exchange site where you could ask your question too...)
I don't know if it will make any difference, but TeX actually uses 72.27 points to the inch (as it predates PostScript, which set the standard 72 points to the inch).