我只是想知道你如何处理Windows Phone 8.1 SDK中的IsolatedStorageSettings.例如:
IsolatedStorageSettings.ApplicationSettings.Contains("LocationConsent")
Run Code Online (Sandbox Code Playgroud)
这在8.1中如何工作?如同,如何编写此语句而不会出现上下文错误.我觉得它已经被弃用了,因为它没有解析为已知的命名空间或任何东西.
我正在使用我当前项目的地图并将其移植到8.1给我一些语法麻烦.我已经尝试过查找了,但我认为现在说文件还为时过早,因为MSDN甚至没有说出任何相关信息,除非我偶然错过了.任何帮助表示赞赏.
我有一个水印,我想把它放到我的PDF格式.水印是.bmp图像,并且是2290 x 3026.我在尝试调整此图片以适应页面时遇到了很多麻烦,有没有人有任何建议?
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("result.pdf"));
document.open();
document.add(new Paragraph("hello"));
document.close();
PdfReader reader = new PdfReader("result.pdf");
int number_of_pages = reader.getNumberOfPages();
PdfStamper pdfStamper = new PdfStamper(reader, new FileOutputStream("result_watermark.pdf"));
// Get the PdfContentByte type by pdfStamper.
Image watermark_image = Image.getInstance("abstract(0307).bmp");
int i = 0;
watermark_image.setAbsolutePosition(0, 0);
watermark_image.scaleToFit(826, 1100);
System.out.println(watermark_image.getScaledWidth());
System.out.println(watermark_image.getScaledHeight());
PdfContentByte add_watermark;
while (i < number_of_pages) {
i++;
add_watermark = pdfStamper.getUnderContent(i);
add_watermark.addImage(watermark_image);
}
pdfStamper.close();
Run Code Online (Sandbox Code Playgroud)
这是getScaled()方法的输出.
826.0 - Width
1091.4742 - Height
Run Code Online (Sandbox Code Playgroud)
我会和你们分享pdf的图片,但不幸的是我不能.
我应该尝试使用.jpg吗?我真的不知道iText如何处理不同的图像扩展.
我想制作一个数组的二维数组,每个数组都填充另一个对象.到目前为止我所拥有的是:
class CustomCache{
boolean dirty = false;
int age = 0;
String addr;
public CustomCache(boolean a, String b, int c){
dirty = a;
addr = b;
age = c;
}
}
class Setup {
int wpb;
CustomCache[] wpbArray = new CustomCache[wpb];
public Setup(int a){
wpb = a;
}
}
Run Code Online (Sandbox Code Playgroud)
Setup[][] array = new Setup[numSets][numBlocks];
for(int i=0; i<numSets; i++){
for(int j=0; j<numBlocks; j++){
array[i][j] = new Setup(wpb);
for(int k=0; k<wpb; k++){
array[i][j].wpbArray[k] = new CustomCache(false, "", 0);
}
}//end inner for …Run Code Online (Sandbox Code Playgroud)