- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以,我有一个“打印”按钮,可以使用自定义“打印”功能打印我的 jTable2。我还使用“调整大小”功能来调整打印列的大小。但是,我试图使表格适合页面的宽度,但它没有这样做,即使我将 PrintMode 更改为 FIT_WIDTH 或 NORMAL,它们之间没有区别。另外,我尝试过更改表格的字体大小,但它也不起作用。这是代码:
package sistemabt;
import java.sql.*;
import java.util.Vector;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
import java.awt.print.*;
import javax.swing.JTable;
import javax.swing.table.TableColumn.*;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumnModel;
import java.awt.geom.Rectangle2D;
import java.awt.geom.AffineTransform;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.print.PrinterException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.Component;
import java.awt.FontMetrics;
public class FormNotas extends javax.swing.JFrame {
private String driver = "org.postgresql.Driver";
private String banco = "bancoBT";
private String host = "localhost";
private String str_conn = "jdbc:postgresql://localhost:5432/" + banco;
private String usuario = "postgres";
private String senha = "root";
public static Connection con;
private Statement stmt;
private ResultSet rs;
public String sql;
public PreparedStatement pst;
static class TablePrintable implements Printable {
private final JTable table;
private final JTableHeader header;
private final TableColumnModel colModel;
private final int totalColWidth;
private final JTable.PrintMode printMode;
private final MessageFormat headerFormat;
private final MessageFormat footerFormat;
private int last = -1;
private int row = 0;
private int col = 0;
private final Rectangle clip = new Rectangle(0, 0, 0, 0);
private final Rectangle hclip = new Rectangle(0, 0, 0, 0);
private final Rectangle tempRect = new Rectangle(0, 0, 0, 0);
private static final int H_F_SPACE = 8;
private static final float HEADER_FONT_SIZE = 18.0f;
private static final float FOOTER_FONT_SIZE = 15.0f;
private final Font headerFont;
private final Font footerFont;
public TablePrintable(JTable table, JTable.PrintMode printMode, MessageFormat headerFormat,
MessageFormat footerFormat) {
this.table = table;
header = table.getTableHeader();
colModel = table.getColumnModel();
totalColWidth = colModel.getTotalColumnWidth();
if (header != null) {
// the header clip height can be set once since it's unchanging
hclip.height = header.getHeight();
}
this.printMode = printMode;
this.headerFormat = headerFormat;
this.footerFormat = footerFormat;
// derive the header and footer font from the table's font
headerFont = table.getFont().deriveFont(Font.BOLD, HEADER_FONT_SIZE);
footerFont = table.getFont().deriveFont(Font.PLAIN, FOOTER_FONT_SIZE);
}
@Override
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
// for easy access to these values
final int imgWidth = (int) pageFormat.getImageableWidth();
final int imgHeight = (int) pageFormat.getImageableHeight();
if (imgWidth <= 0) {
throw new PrinterException("Width of printable area is too small.");
}
// to pass the page number when formatting the header and footer
// text
Object[] pageNumber = new Object[]{Integer.valueOf(pageIndex + 1)};
// fetch the formatted header text, if any
String headerText = null;
if (headerFormat != null) {
headerText = headerFormat.format(pageNumber);
}
// fetch the formatted footer text, if any
String footerText = null;
if (footerFormat != null) {
footerText = footerFormat.format(pageNumber);
}
// to store the bounds of the header and footer text
Rectangle2D hRect = null;
Rectangle2D fRect = null;
// the amount of vertical space needed for the header and footer
// text
int headerTextSpace = 0;
int footerTextSpace = 0;
// the amount of vertical space available for printing the table
int availableSpace = imgHeight;
// if there's header text, find out how much space is needed for it
// and subtract that from the available space
if (headerText != null) {
graphics.setFont(headerFont);
int nbLines = headerText.split("\n").length;
hRect = graphics.getFontMetrics().getStringBounds(headerText, graphics);
hRect = new Rectangle2D.Double(hRect.getX(), Math.abs(hRect.getY()), hRect.getWidth(),
hRect.getHeight() * nbLines);
headerTextSpace = (int) Math.ceil(hRect.getHeight() * nbLines);
availableSpace -= headerTextSpace + H_F_SPACE;
}
// if there's footer text, find out how much space is needed for it
// and subtract that from the available space
if (footerText != null) {
graphics.setFont(footerFont);
fRect = graphics.getFontMetrics().getStringBounds(footerText, graphics);
footerTextSpace = (int) Math.ceil(fRect.getHeight());
availableSpace -= footerTextSpace + H_F_SPACE;
}
if (availableSpace <= 0) {
throw new PrinterException("Height of printable area is too small.");
}
// depending on the print mode, we may need a scale factor to
// fit the table's entire width on the page
double sf = 1.0D;
if (printMode == JTable.PrintMode.FIT_WIDTH && totalColWidth > imgWidth) {
// if not, we would have thrown an acception previously
assert imgWidth > 0;
// it must be, according to the if-condition, since imgWidth > 0
assert totalColWidth > 1;
sf = (double) imgWidth / (double) totalColWidth;
}
// dictated by the previous two assertions
assert sf > 0;
// This is in a loop for two reasons:
// First, it allows us to catch up in case we're called starting
// with a non-zero pageIndex. Second, we know that we can be called
// for the same page multiple times. The condition of this while
// loop acts as a check, ensuring that we don't attempt to do the
// calculations again when we are called subsequent times for the
// same page.
while (last < pageIndex) {
// if we are finished all columns in all rows
if (row >= table.getRowCount() && col == 0) {
return NO_SUCH_PAGE;
}
// rather than multiplying every row and column by the scale
// factor
// in findNextClip, just pass a width and height that have
// already
// been divided by it
int scaledWidth = (int) (imgWidth / sf);
int scaledHeight = (int) ((availableSpace - hclip.height) / sf);
// calculate the area of the table to be printed for this page
findNextClip(scaledWidth, scaledHeight);
last++;
}
// create a copy of the graphics so we don't affect the one given to
// us
Graphics2D g2d = (Graphics2D) graphics.create();
// translate into the co-ordinate system of the pageFormat
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
// to save and store the transform
AffineTransform oldTrans;
// if there's footer text, print it at the bottom of the imageable
// area
if (footerText != null) {
oldTrans = g2d.getTransform();
g2d.translate(0, imgHeight - footerTextSpace);
String[] lines = footerText.split("\n");
printText(g2d, lines, fRect, footerFont, imgWidth);
g2d.setTransform(oldTrans);
}
// if there's header text, print it at the top of the imageable area
// and then translate downwards
if (headerText != null) {
String[] lines = headerText.split("\n");
printText(g2d, lines, hRect, headerFont, imgWidth);
g2d.translate(0, headerTextSpace + H_F_SPACE);
}
// constrain the table output to the available space
tempRect.x = 0;
tempRect.y = 0;
tempRect.width = imgWidth;
tempRect.height = availableSpace;
g2d.clip(tempRect);
// if we have a scale factor, scale the graphics object to fit
// the entire width
if (sf != 1.0D) {
g2d.scale(sf, sf);
// otherwise, ensure that the current portion of the table is
// centered horizontally
} else {
int diff = (imgWidth - clip.width) / 2;
g2d.translate(diff, 0);
}
// store the old transform and clip for later restoration
oldTrans = g2d.getTransform();
Shape oldClip = g2d.getClip();
// if there's a table header, print the current section and
// then translate downwards
if (header != null) {
hclip.x = clip.x;
hclip.width = clip.width;
g2d.translate(-hclip.x, 0);
g2d.clip(hclip);
header.print(g2d);
// restore the original transform and clip
g2d.setTransform(oldTrans);
g2d.setClip(oldClip);
// translate downwards
g2d.translate(0, hclip.height);
}
// print the current section of the table
g2d.translate(-clip.x, -clip.y);
g2d.clip(clip);
table.print(g2d);
// restore the original transform and clip
g2d.setTransform(oldTrans);
g2d.setClip(oldClip);
// draw a box around the table
g2d.setColor(Color.BLACK);
g2d.drawRect(0, 0, clip.width, hclip.height + clip.height);
// dispose the graphics copy
g2d.dispose();
return PAGE_EXISTS;
}
private void printText(Graphics2D g2d, String[] lines, Rectangle2D rect, Font font, int imgWidth) {
g2d.setColor(Color.BLACK);
g2d.setFont(font);
for (int i = 0; i < lines.length; i++) {
int tx;
// if the text is small enough to fit, center it
if (rect.getWidth() < imgWidth) {
tx = (int) (imgWidth / 2 - g2d.getFontMetrics().getStringBounds(lines[i], g2d).getWidth() / 2);
// otherwise, if the table is LTR, ensure the left side of
// the text shows; the right can be clipped
} else if (table.getComponentOrientation().isLeftToRight()) {
tx = 0;
// otherwise, ensure the right side of the text shows
} else {
tx = -(int) (Math.ceil(rect.getWidth()) - imgWidth);
}
int ty = (int) Math.ceil(Math.abs(rect.getY() + i * rect.getHeight() / lines.length));
g2d.drawString(lines[i], tx, ty);
}
}
private void findNextClip(int pw, int ph) {
final boolean ltr = table.getComponentOrientation().isLeftToRight();
// if we're ready to start a new set of rows
if (col == 0) {
if (ltr) {
// adjust clip to the left of the first column
clip.x = 0;
} else {
// adjust clip to the right of the first column
clip.x = totalColWidth;
}
// adjust clip to the top of the next set of rows
clip.y += clip.height;
// adjust clip width and height to be zero
clip.width = 0;
clip.height = 0;
// fit as many rows as possible, and at least one
int rowCount = table.getRowCount();
int rowHeight = table.getRowHeight(row);
do {
clip.height += rowHeight;
if (++row >= rowCount) {
break;
}
rowHeight = table.getRowHeight(row);
} while (clip.height + rowHeight <= ph);
}
// we can short-circuit for JTable.PrintMode.FIT_WIDTH since
// we'll always fit all columns on the page
if (printMode == JTable.PrintMode.FIT_WIDTH) {
clip.x = 0;
clip.width = totalColWidth;
return;
}
if (ltr) {
// adjust clip to the left of the next set of columns
clip.x += clip.width;
}
// adjust clip width to be zero
clip.width = 0;
// fit as many columns as possible, and at least one
int colCount = table.getColumnCount();
int colWidth = colModel.getColumn(col).getWidth();
do {
clip.width += colWidth;
if (!ltr) {
clip.x -= colWidth;
}
if (++col >= colCount) {
// reset col to 0 to indicate we're finished all columns
col = 0;
break;
}
colWidth = colModel.getColumn(col).getWidth();
} while (clip.width + colWidth <= pw);
}
}
static class ColumnsAutoSizer {
public static void sizeColumnsToFit(JTable table) {
sizeColumnsToFit(table, 3);
}
public static void sizeColumnsToFit(JTable table, int columnMargin) {
JTableHeader tableHeader = table.getTableHeader();
if (tableHeader == null) {
// can't auto size a table without a header
return;
}
FontMetrics headerFontMetrics = tableHeader.getFontMetrics(tableHeader.getFont());
int[] minWidths = new int[table.getColumnCount()];
int[] maxWidths = new int[table.getColumnCount()];
for (int columnIndex = 0; columnIndex < table.getColumnCount(); columnIndex++) {
int headerWidth = headerFontMetrics.stringWidth(table.getColumnName(columnIndex));
minWidths[columnIndex] = headerWidth + columnMargin;
int maxWidth = getMaximalRequiredColumnWidth(table, columnIndex, headerWidth);
maxWidths[columnIndex] = Math.max(maxWidth, minWidths[columnIndex]) + columnMargin;
}
adjustMaximumWidths(table, minWidths, maxWidths);
for (int i = 0; i < minWidths.length; i++) {
if (minWidths[i] > 0) {
table.getColumnModel().getColumn(i).setMinWidth(minWidths[i]);
}
if (maxWidths[i] > 0) {
table.getColumnModel().getColumn(i).setMaxWidth(maxWidths[i]);
table.getColumnModel().getColumn(i).setWidth(maxWidths[i]);
}
}
}
private static void adjustMaximumWidths(JTable table, int[] minWidths, int[] maxWidths) {
if (table.getWidth() > 0) {
// to prevent infinite loops in exceptional situations
int breaker = 0;
// keep stealing one pixel of the maximum width of the highest column until we can fit in the width of the table
while (sum(maxWidths) > table.getWidth() && breaker < 10000) {
int highestWidthIndex = findLargestIndex(maxWidths);
maxWidths[highestWidthIndex] -= 1;
maxWidths[highestWidthIndex] = Math.max(maxWidths[highestWidthIndex], minWidths[highestWidthIndex]);
breaker++;
}
}
}
private static int getMaximalRequiredColumnWidth(JTable table, int columnIndex, int headerWidth) {
int maxWidth = headerWidth;
TableColumn column = table.getColumnModel().getColumn(columnIndex);
TableCellRenderer cellRenderer = column.getCellRenderer();
if (cellRenderer == null) {
cellRenderer = new DefaultTableCellRenderer();
}
for (int row = 0; row < table.getModel().getRowCount(); row++) {
Component rendererComponent = cellRenderer.getTableCellRendererComponent(table,
table.getModel().getValueAt(row, columnIndex),
false,
false,
row,
columnIndex);
double valueWidth = rendererComponent.getPreferredSize().getWidth();
maxWidth = (int) Math.max(maxWidth, valueWidth);
}
return maxWidth;
}
private static int findLargestIndex(int[] widths) {
int largestIndex = 0;
int largestValue = 0;
for (int i = 0; i < widths.length; i++) {
if (widths[i] > largestValue) {
largestIndex = i;
largestValue = widths[i];
}
}
return largestIndex;
}
private static int sum(int[] widths) {
int sum = 0;
for (int width : widths) {
sum += width;
}
return sum;
}
}
/**
* Creates new form FormNotas
*/
public FormNotas() {
initComponents();
try {
try {
Class.forName(driver);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
con = DriverManager.getConnection(str_conn, usuario, senha);
stmt = con.createStatement();
sql = "select Nome_Curso from curso order by Nome_Curso";
rs = stmt.executeQuery(sql);
while (rs.next()) {
jComboBox1.addItem(rs.getString("Nome_Curso"));
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "Ocorreu um erro ao carregar o ComboBox");
System.out.println("Ocorreu um erro ao carregar o ComboBox");
}
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
}
DefaultTableModel model = new DefaultTableModel(0, 26);
for (int row = 0; row < 26; row++) {
Vector data = new Vector(26);
for (int col = 0; col < 26; col++) {
String value = row + "x" + ((char) (col + 'A'));
data.add(value);
}
model.addRow(data);
}
JTable jTable2 = new JTable(model);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
Vector vetColuna = new Vector();
Vector vetLinhas = new Vector();
try {
Class.forName(driver);
con = DriverManager.getConnection(str_conn, usuario, senha);
stmt = con.createStatement();
sql = "select topico, nota, datanota from notas where notas.cod_aluno =" + jTextField1.getText() + " and notas.cod_curso =" + jTextField2.getText() + " order by notas.datanota";
rs = stmt.executeQuery(sql);
if (rs == null) {
return;
}
ResultSetMetaData rsmd;
rsmd = rs.getMetaData();
for (int i = 0; i < rsmd.getColumnCount(); i++) {
vetColuna.add(rsmd.getColumnLabel(i + 1));
}
while (rs.next()) {
Vector vetLinha = new Vector();
for (int i = 0; i < rsmd.getColumnCount(); i++) {
vetLinha.add(rs.getObject(i + 1));
}
vetLinhas.add(vetLinha);
}
} catch (ClassNotFoundException ex) {
JOptionPane.showMessageDialog(null, "Erro\nNão foi possível carregar o driver.");
System.out.println("Nao foi possivel carregar o driver");
ex.printStackTrace();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "Erro\nCertifique-se de que todos os\ncampos estejam preenchidos corretamente.");
System.out.println("Problema com o SQL");
ex.printStackTrace();
}
MessageFormat header = new MessageFormat("Ficha Pedagógica - " + jComboBox1.getSelectedItem() + "\nNome do Aluno - " + jTextField1.getText());
jTable2.setModel(new DefaultTableModel(vetLinhas, vetColuna));
DefaultTableModel dtm = new DefaultTableModel(vetLinhas, vetColuna);
JTable jTable2 = new JTable(dtm) {
@Override
public Printable getPrintable(PrintMode printMode, MessageFormat headerFormat, MessageFormat footerFormat) {
return new TablePrintable(this, printMode, headerFormat, footerFormat);
}
};
ColumnsAutoSizer.sizeColumnsToFit(jTable2);
try {
jTable2.setSize(jTable2.getPreferredSize());
JTableHeader tableHeader = jTable2.getTableHeader();
tableHeader.setSize(tableHeader.getPreferredSize());
jTable2.print(JTable.PrintMode.FIT_WIDTH, header, null);
} catch (PrinterException ex) {
ex.printStackTrace();
}
}
这是当前页面的图像:/image/iLnzv.png
我想说的是,表格在页面上很小,我希望调整它的大小以适应页面宽度,并且字体可以更大。我怎样才能做到这一点?
最佳答案
您有两种可能的选择,您可以尝试调整列的大小,以便在可用页面宽度上均匀分布,或者您可以放大生成的输出以使其适合页面。
默认情况下,TablePrintable
仅按比例缩小,从而强制 JTable
太大而无法适应可用页面大小(宽度)。您可以更改此设置以允许其也扩展。
计算比例的代码位于 TablePrintable
类的 print
内,看起来像...
double sf = 1.0D;
if (printMode == JTable.PrintMode.FIT_WIDTH && totalColWidth > imgWidth) {
// if not, we would have thrown an acception previously
assert imgWidth > 0;
// it must be, according to the if-condition, since imgWidth > 0
assert totalColWidth > 1;
sf = (double) imgWidth / (double) totalColWidth;
}
我们感兴趣的部分是 if
语句,它的内容是“如果 printmode 等于 FIT_WIDTH 并且 TotalColWidth 大于页面宽度”...我们希望将其更改为“仅“如果 printmode 等于 FIT_WIDTH”...
你可以改变
if (printMode == JTable.PrintMode.FIT_WIDTH && totalColWidth > imgWidth) {
至
if (printMode == JTable.PrintMode.FIT_WIDTH) {
现在将允许TablePrintable
向上和向下缩放表格...
这会导致类似...
这有点棘手,永远不应该应用于屏幕上已经存在的JTable
,因为这会扰乱它的实际显示方式......
基本上,当打印表格时,我们将覆盖列宽,以使它们在页面上具有相等的空间......
首先,我们需要将 TablePrintable
中的 totalColWidth
更改为...
private final int totalColWidth;
至
private int totalColWidth;
因为我们需要能够在初始化后修改该值...
接下来,我们需要一个标志来确定列是否已被修改,因为每次调用 print
时都必须重复更新其大小,这是一种浪费。
将 private boolean updateColumnWidths;
添加到 TablePrintable
的字段(例如,在 private final Font footerFont;
下)
现在,当调用 print
时,我们需要做出一系列决定...
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
// for easy access to these values
final int imgWidth = (int) pageFormat.getImageableWidth();
final int imgHeight = (int) pageFormat.getImageableHeight();
if (imgWidth <= 0) {
throw new PrinterException("Width of printable area is too small.");
}
// Have we modified the column widths yet??
if (!updateColumnWidths) {
// Only update the column widths if the current total column width
// is less then the available imgWidth (page width)
if (totalColWidth < imgWidth) {
// Calculate the required column width to allow the columns to
// span the page...
int columnCount = table.getColumnCount();
int columnWidth = (int) (imgWidth / (float) columnCount);
TableColumnModel columnModel = table.getColumnModel();
// Update the columns...
for (int col = 0; col < columnModel.getColumnCount(); col++) {
TableColumn tc = columnModel.getColumn(col);
tc.setMinWidth(columnWidth);
tc.setMaxWidth(columnWidth);
tc.setPreferredWidth(columnWidth);
tc.setWidth(columnWidth);
}
// Update the totalColWidth, this should prevent
// any scaling been applied
totalColWidth = columnModel.getTotalColumnWidth();
}
updateColumnWidths = true;
}
//...
这会生成类似...的内容
关于java - 表格打印不适合页面尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26660448/
我正在查看 DOOM 源代码,我找到了 this行。 void * Z_Malloc (int size, int tag, void *user)
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 9 年前。 Improve t
我正从 Python 和 Numpy 转向 C++ 和 Eigen。 在 Python 中,我可以使用 .shape 属性获取 Numpy 数组/矩阵的形状(维度),如下所示: import nump
固定嵌入式YouTube视频的宽度并自己照顾自己的高度是否安全? 我有一个应用程序,用户可以将通知发布到公告板上。这些通知主要是文本(带有有限的html标签)和嵌入式图像。我现在要添加对嵌入式YouT
可以轻松创建一个 THREE.BoxGeometry,在创建宽度、高度和深度的三个独立参数时,您必须在其中传递参数。 我想创建任何和所有不带参数的THREE[types](),并在之后设置值。 有没有
我在 HTML 页面上有一个 Canvas : 属性width和height将 Canvas 拉伸(stretch)到某个字段,但不调整其大小。所以 var canvasElement = docu
我在我的 css 中使用 @media all 和 (max-width: 600px) {} 作为响应式菜单,问题是它没有正确显示。 我想让橙色填充绿色空间……当然,还要将绿色空间变成透明的。基本上
(我知道我问了很多关于这个的问题!) 基本上,我正在尝试将一些代码从 Matlab 转换为 C++,我遇到了这个: n = sum(size(blocks)) - len; 现在我计算了 vector
您好,我有一个用于创建产品的表单。用户应该能够选择类别(例如 T 恤),然后 T 恤的所有尺码(例如 S、M、L)都会下拉。用户可以输入每种尺寸的数量。 Javascript 对此不起作用。用户可以选
我正在尝试在页脚中定位和调整我的社交图标链接的大小,但是,这些命令似乎都没有效果,尤其是当我尝试调整它们的大小时。我试过将宽度和高度标记为“!重要”,但这也没有效果。 这是代码的 JSFiddle:h
我目前正在创建一个 HTML5 canvas基于绘图程序。用户可以绘制一张图像或几张图像“页面”,并将其保存到云端以供日后快速检索。这是用于交互式白板的;老师不能总是确定他们计划类(class)使用的
为网站存储图像的最佳方式是什么? 我不应该超过什么尺寸? 现在,我将所有界面文件保存在 png(主要是 Sprite )中,并将常用图像保存在 jpg 中。一些图像大约为 100-150Kb。 保存图
在 fancybox 主页 ( http://fancybox.net/home ) 中,有一个打开尺寸为屏幕 75% 的 iFrame 的示例。 我无法按照网站上的说明通过修改 .js 文件的宽度和
我想做一个仅适用于 iPhone 4 的应用程序,该应用程序使用 iAd AdBannerView。当我添加它时,它的固定大小为 320x50。在更高分辨率下这如何工作? 有人可以解释一下 iPhon
我们有一个 NSString,我们使用 - (NSSize)sizeWithAttributes:(NSDictionary *)attributes 来测量边界框。一切都好。 现在我们使用标准 NS
我想知道 Canvas 的宽度和高度,但我只知道它的 HDC。 我尝试过这段代码: procedure TForm92.Button1Click(Sender: TObject); var hBi
问题是如何使用数学从 START SVG 维度(不带旋转)和 END SVG 维度(带旋转)获取 >开始 SVG 信息。基本上,要从 START SVG 到 END SVG,我需要执行 -115.60
我的问题是,我有一个包含50万行的Oracle表。我设置了sqoop以将其作为 Parquet 文件导入到HDFS。我将--num-partition参数设置为32,得到了32个 Parquet 文件
是否可以更改 WordPress 中当前主题的 YouTube(或其他视频)的默认嵌入尺寸?我搜索了一个插件和一些代码,但似乎找不到。 我的意思是当您将 YouTube 网址粘贴到帖子或页面中时使用的
我有一个组,其中包含一个矩形和顶部的图像。我希望矩形可以调整大小,并且图像应该具有固定大小,除非矩形小于图像的情况。然后图像应该随着矩形缩小。 图像还应该始终居中并有一些填充。 除了图像的缩小尺寸部分
我是一名优秀的程序员,十分优秀!