(6)[例如18×16×16M PNG]所示。由于其跟BMP图片非常相似,故不作重复说明。
图(6)
JBuilder譜柴資函夕頭奉來殻會(3)
扮寂:2010-12-08
眉、坿旗鷹式凪傍苧
坿旗鷹喇曾何蛍怏撹?軸曾倖猟周怏撹。凪匯葎"PicsModel.java"?麼勣贋刈夕頭議?購佚連?凪屈了"readpic.java"?資函夕頭議?購佚連?頁云猟議嶷泣侭壓。?聾旗鷹泌和?
PicsModel.java旗鷹?
/*****************************************************************
* File name: PicsModel.java
* Create date: 2003-11-18
* Copyright: Copyright (c) 2003 by HEKAI
* @Version: 1.0
* Modify History
* Author Date Description
* hekai 2003-11-18 Create the PicsModel.java
*****************************************************************/
//萩喘低議?哘**兆序佩紋算
package bmptest;
import java.io.Serializable;
public class PicsModel implements Serializable
{
private String picsExtendName = null;
private int picsWidth = 0;
private int picsHeight = 0;
private String picsColor = null;
private String picsSize = null;
public PicsModel()
{
}
public String getpicsExtendName()
{
return picsExtendName;
}
public void setpicsExtendName(String picsExtendName)
{
this.picsExtendName = picsExtendName;
}
public int getpicsWidth()
{
return picsWidth;
}
public void setpicsWidth(int picsWidth)
{
this.picsWidth = picsWidth;
}
public int getpicsHeight()
{
return picsHeight;
}
public void setpicsHeight(int picsHeight)
{
this.picsHeight = picsHeight;
}
public String getpicsColor()
{
return picsColor;
}
public void setpicsColor(String picsColor)
{
this.picsColor = picsColor;
}
public String getpicsSize()
{
return picsSize;
}
public void setpicsSize(String picsSize)
{
this.picsSize = picsSize;
}
}
readpic.java旗鷹?
/*****************************************************************
* File name: readpic.java
* Create date: 2003-11-18
* Copyright: Copyright (c) 2003 by HEKAI
* @Version: 1.0
* Modify History
* Author Date Description
* hekai 2003-11-18 Create the readpic.java
*****************************************************************/
//萩喘低議?哘**兆序佩紋算
package bmptest;
import java.io.*;
public class readpic
{
public static void main(String[] args)
{
PicsModel model = getFileAttributes("E:/hekai/hk0001.jpg");
// "E:\\hekai\\hk0001.jpg" 匆頁辛參議
System.out.println("picextendname is:"+model.getpicsExtendName());
System.out.println("picwidth is:"+model.getpicsWidth());
System.out.println("picheight is:"+model.getpicsHeight());
System.out.println("piccolor:"+model.getpicsColor());
System.out.println("picsize:"+model.getpicsSize());
}
private static PicsModel getFileAttributes(String picpath)
{
PicsModel model = null;
String picextendname;
picextendname = null;
byte[] content = null;
try
{
content = readFromFile(picpath);
int k
|