我想创建特定图像的位图图像,但我想抵抗位图图像的宽度和高度。我正在使用以下代码......
image2 = BitmapFactory.decodeResource(getResources(), rid);
Log.w("DEBUG","which is null:image i " + i.getWidth() + " OR " +i.getDrawable().getIntrinsicHeight () );
Log.w("DEBUG","which is null:image h " + h.getWidth() + " OR " +h.getHeight() );
Log.w("DEBUG","which is null:image2 " + image2.getWidth() + " OR " +image2.getHeight() );
Bitmap image = Bitmap.createScaledBitmap(image2, i.getWidth(), i.getHeight(), false);
Log.w("DEBUG","which is null:image " + image.getWidth() + " OR " +image.getHeight() );
double bmWidth = image.getWidth();
double bmHeight = image.getHeight();
if ( x < 0 || y < 0 …Run Code Online (Sandbox Code Playgroud) 我有三张桌子:
顾客
customer_id first_name
1 kapil
2 rajesh
Run Code Online (Sandbox Code Playgroud)
帐户
Customer_id Account_id
1 S1
2 s2
Run Code Online (Sandbox Code Playgroud)
收据
Recipt_id customer_id Account_id Transaction_type Amount
R1 1 s1 Deposit 40000
R2 2 s2 Deposit 300
R3 1 s1 withdrawal 2000
Run Code Online (Sandbox Code Playgroud)
现在我把查询如下
select
c.customer_id,c.first_name,s.current_balance,s.account_id,
(select sum(amount)
from receipt as r ,
saving_account as s
where r.transaction_type='deposit'
and r.account_no = s.account_id
) as debit,
(select sum(amount)
from receipt as r ,
saving_account as s
where r.transaction_type='withdrawl'
and r.account_no = s.account_id
)as credit
from customer as c …Run Code Online (Sandbox Code Playgroud) 我正在使用JInternalFrame我添加的内容JTable.现在我要显示背景图像JTable.所以我在JScrollPane's自定义代码中添加了以下代码.
jScrollPane1 = new javax.swing.JScrollPane(ViewBalanceReportTable) {{
setOpaque(false);
getViewport().setOpaque(false);
}
@Override
protected void paintComponent(Graphics g) {
final int imageWidth = image.getIconWidth();
final int imageHeight = image.getIconHeight();
final Dimension d = getSize();
final int x = (d.width - imageWidth)/2;
final int y = (d.height - imageHeight)/2;
g.drawImage(image.getImage(), x, y, null, null);
super.paintComponent(g);
}
}
Run Code Online (Sandbox Code Playgroud)
但仍然没有显示背景图像任何人可以帮助我