dpi

High quality UIImage from PDF

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm converting a PDF page into a UIImage. While doing so, I lose the image quality. Need help in getting high quality images. Code to generate UIImage -(UIImage *)imageForPage:(int)pageNumber { CGPDFPageRef pdfPageRef = [self pdfReferenceForPage:pageNumber]; CGSize pageSize = [self sizeOfPage:pageNumber]; //UIGraphicsBeginImageContext(pageSize); UIGraphicsBeginImageContextWithOptions(pageSize, NO, 0.0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetInterpolationQuality(context, kCGInterpolationHigh); CGContextTranslateCTM

How to change dpi in PostScript

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am a newcomer in PostScript language. Now I am using ps to print a scaled image of dots. The default dpi in ps is 72dpi, I am wondering how to change it to 600dpi. The code i write as follows, it is a square of dots. %% Dot_unit %% position setting 100 200 translate %% size setting 52 49 scale %% parameter setting : width height bit matrix 52 49 1 [ 52 0 0 - 49 0 49 ] %% dot unit discribe {< fff7ff7ff7ff7f ffffffffffffff ffffffffffffff ffffffffffffff fffff7ffff7fff ffffffffffffff ffffffffffffff ffffffffffffff ffffffffffffff

python3_matplotlib_figure()函数解析

匿名 (未验证) 提交于 2019-12-02 22:54:36
1.绘图库导入 [python] view plain copy import import 2.创建一个图形实例 [python] view plain copy plt.figure(figsize=( 15 , 5 figure说明 :The Figure instance returned will also be passed to new_figure_manager in the backends, which allows to hook custom Figure classes into the pylab interface. Additional kwargs will be passed to the figure init function。 note:If you are creating many figures, make sure you explicitly call "close" on the figures you are not using, because this will enable pylab to properly clean up the memory. 注意: 如果你创建了多个figure实例,必须确保你显式的调用“close”来释放你已经不再使用的figure实例。因为只有这样pylab才能正确的释放内存。 3.函数头

Scaling a Phonegap app for different Android screen sizes/densities?

倖福魔咒の 提交于 2019-12-02 22:42:53
I have a Phonegap app designed to run on Android phones and tablets. The scale of text and images looks fine on a phone, but too small on a 7” tablet. Is there a way to set the scale for different screen sizes/densities that works for a Phonegap-based app? For a native Android app, multiple screen layouts (as mentioned in the android docs ) would be a solution, but can this be used for a Phonegap-based app? I could use CSS media queries to set font sizes based on screen size, but I want to scale the entire interface (including images) proportionally. I tried using the CSS zoom property along

石子合并问题--直线版 HRBUST - 1818 解题报告

浪子不回头ぞ 提交于 2019-12-02 19:59:53
开头一句话,寒假一时爽,开学火葬场。 石子合并问题,经典的区间DP问题。 可能有人不理解什么事区间DP,这里引进一篇非常不错的博客 区间DP详解 。 看完之后你会惊讶的发现啊,原来卡死自己的题竟然只是一道模板题。 自己寒假做的跪着也要疯狂学完。 下面给出AC代码: #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=1000+100; const int INF=0x3f3f3f3f; int dpi[maxn][maxn],dpx[maxn][maxn]; int sum[maxn]; int main() { int n; while(scanf("%d",&n)!=EOF) { memset(dpi,INF,sizeof(dpi)); memset(dpx,-1,sizeof(dpx)); sum[0]=0; for(int i=1; i<=n; i++) { scanf("%d",&sum[i]); sum[i]=sum[i-1]+sum[i]; dpx[i][i]=0; dpi[i][i]=0; } for(int len=2; len<=n; len++) { for(int i=1; i<=n; i++) { int j=i+len-1; if(j>n)

Troubleshooting DPI Virtualization and DPI-aware applications, in Windows Vista and Windows 7

吃可爱长大的小学妹 提交于 2019-12-02 15:57:30
I have a problem where an application (written in Delphi) is behaving properly at default 96 DPI settings on all systems, but is behaving inconsistently at the "150% text size" (internally 144 dpi) setting, on different systems. It seems that on some systems, that certain text/font parts of my application are being stretched and on other systems, they aren't. I would have thought that my application, on a certain version of Windows (Win7), at a certain DPI, should behave the same way. Either my application will make it known to Windows that it doesn't need the DPI Virtualization feature, or it

Coordinate Error using GetWindowRect in different DPI

a 夏天 提交于 2019-12-02 15:03:24
问题 I want to capture the coordinate of components in my MFC program. Now I can perfectly complete this by using GetWindowRect . However, when I set my windows dpi to 150% (120 dpi), I get different coordinates from GetWindowRect . Therefore, I survey some method to convert new coordinates to that in default dpi (96 dpi). Finally, I found there was some error when I tried: Rect.top = Rect.top * (DEFAULT_DPIY / CURRENT_DPIY); Rect.left = Rect.left * (DEFAULT_DPIX / CURRENT_DPIX); The converted

Coordinate Error using GetWindowRect in different DPI

[亡魂溺海] 提交于 2019-12-02 11:34:24
I want to capture the coordinate of components in my MFC program. Now I can perfectly complete this by using GetWindowRect . However, when I set my windows dpi to 150% (120 dpi), I get different coordinates from GetWindowRect . Therefore, I survey some method to convert new coordinates to that in default dpi (96 dpi). Finally, I found there was some error when I tried: Rect.top = Rect.top * (DEFAULT_DPIY / CURRENT_DPIY); Rect.left = Rect.left * (DEFAULT_DPIX / CURRENT_DPIX); The converted value is very close, but not equal. Is there any method to convert it without error ? Your program is

How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?

核能气质少年 提交于 2019-12-02 09:28:39
I've created a simple Winforms application in C#. When I run the application on a machine with high DPI settings (e.g. 150%), the application gets scaled up. So far so good! But instead of rendering the fonts with a higher font size, all texts are just scaled up, too. That of course leads to very blurry text (on all controls like buttons etc.). Shouldn't windows take care of rendering the texts correctly? For example my application's title bar is rendered crisp & clear. Once you go past 100% (or 125% with the "XP-style DPI scaling" checkbox ticked), Windows by default takes over the scaling of

MonoDroid apps don't use correct density drawables

青春壹個敷衍的年華 提交于 2019-12-02 03:57:05
I am getting some very interesting results when testing an app developed with MonoDroid on different devices with varying screen sizes and densities. I have the following (simplified) folder structure set up in my project: drawable image.png drawable-ldpi image.png drawable-mdpi image.png drawable-hdpi image.png drawable-xhdpi image.png The image in drawable is that of a folder. The images in the other folders are identical except for the size and a letter that is drawn on top to indicate which density it is from (e.g. L, M, H, or X) depending on the folder. Regardless of the device's screen