How to load a PNG image from a location in CF card
Hi,
I am using WTK 2.5.2. I wanted to load a PNG image to Image object. The image is loaded when I have it in the classes folder. But I want to select different image from a different location. If I try to open an Image to createImage(String) from a different location, I get IOException.
Please help me.
Thanks
Deekshit M
I got the answer, I should be using Image.createImage(InputStream) API. It works fine.
Thanks
DM
Similar Messages
-
How to stream a png image from a Servlet to an Applet?
Hello,
I'm trying to write to an output stream (in my servlet) a png image created with JFreeChart library and read it from an input stream (in my applet).
So,i'm using
response.setContentType("image/png");
response.setBufferSize(1000000);
ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
System.out.println("starting writing image object");
this.genPNG(chart);
ChartUtilities.writeChartAsPNG(out, chart, 729, 447);On the applet side i'm trying to read the input stream with ImageIO.read(InputStream)
InputStream in = servletCon.getInputStream();
//Image case
ObjectInputStream objInputStream = new ObjectInputStream(in);
Object o = objInputStream.readObject();
Image img = ImageIO.read(objInputStream);
im = new ImageIcon(img);But nothing happens.It returns me a null object.
On the servlet side if i write the image on disk it's ok.(This means that the servlet is doing correctly it's job of writing the image).
Do you have any ideas and possibly 2-3 lines of code on how to write a png image in a stream and how to read the stream +reconstruct the image.
I searched a lot but not found anything (there's something out there for jsp only).
Thanks you in advance
ChrisYou're right.I forgot those Object Streams because i was passing another serialized object which wasnt serializable,then i changed by passing the complete image but forgotten those streams.
It worked gracefully with simple Input Output Streams and ImageIO.
Thank you very much
Chris -
How to load external png image via xml?
Can anyone help me with adding a png image to a mc with an instance name.
I only want to display a single image (no gallery)
I would like to get the url for the image via an xml.
Here is a copy of my current action script which has already pulled in the xml data which includes the node with the url for the photo.
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("links.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
trace(myXML);
menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
studentmv.stuname.text = myXML.student.name;
function openCURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.car.url));
function openEURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.edu.url));
function openPURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.psy.url));
function openSTURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.stu.url));
function openBURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.bus.url));
function openSURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.sha.url));
And here is a copy of the node containing the url
<menu>
<student>
<name>testnamehere</name>
<photo>http://10.0.0.2/test/photos/testnamephoto.jpg</photo>
</student>
</menu>
I did see this tutorial but it was for a gallery and I couldnt seem to hack and slash it to do what I want.
http://tuts.flashmint.com/creating-a-simple-xml-gallery-in-actionscript3/
Thanks again in advance for all the help.I have added that code but I think i have buggered up something else in the process.
I get the following error
ReferenceError: Error #1069: Property data not found on flash.display.LoaderInfo and there is no default value.
at sdp_fla::MainTimeline/load_complete()
Current AS
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("links.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
trace(myXML);
menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
studentmv.stuname.text = myXML.student.name;
var _request:URLRequest = new URLRequest(myXML.student.photo);
var _ldr = new Loader();
studentmv.photo.addChild(_ldr);
_ldr.load(_request);
_ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, load_complete, false, 0, true);
function openCURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.car.url));
function openEURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.edu.url));
function openPURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.psy.url));
function openSTURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.stu.url));
function openBURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.bus.url));
function openSURL(e:MouseEvent):void
navigateToURL(new URLRequest(myXML.sha.url));
function load_complete(event):void
var bitmap:Bitmap = Bitmap(event.currentTarget.data);
bitmap.smoothing = true;
bitmap.width = studentmv.photo.width
bitmap.width = studentmv.photo.height
studentmv.photo.addChild(bitmap) -
How to load and retrieve images from Portal. URGENT
Dear all,
I've designed a table with an ordsys.ordimage field for images. BIG MISTAKE, because there is no possibility to upload images from a form. I'd like to change it into a BLOB field but an error arises:
"You cannot modify the column definition for types CLOB, NCLOB, BFILE, BLOBand Intermedia Object types(ORDSYS.ORDIMAGE, ORDSYS.ORDAUDIO, ORDSYS.ORDVIDEO). (WWV-17079)"
Could I change it anyhow in order not to build a new table? I have a lot of forms referring to that table and I should change these forms too....(and we know it is pretty difficult)...
I would appreciate any help.
TomasTomas,
Do you have any active constraints on that specific row? If the row is accessed by other forms (tables etc) you would need to disable them (for example foreign key constraints) and update the row (or remove and re-add it).
Kostas -
How to load and retrieve images from Portal!!!
Dear all,
I've designed a table with an ordsys.ordimage field for images. BIG MISTAKE, because there is no possibility to upload images from a form. I'd like to change it into a BLOB field but an error arises:
"You cannot modify the column definition for types CLOB, NCLOB, BFILE, BLOBand Intermedia Object types(ORDSYS.ORDIMAGE, ORDSYS.ORDAUDIO, ORDSYS.ORDVIDEO). (WWV-17079)"
Could I change it anyhow in order not to build a new table? I have a lot of forms referring to that table and I should change these forms too....(and we know it is pretty difficult)...
I would appreciate any help.
TomasTomas,
Do you have any active constraints on that specific row? If the row is accessed by other forms (tables etc) you would need to disable them (for example foreign key constraints) and update the row (or remove and re-add it).
Kostas -
I have a problem with loading the PNG image
I have a problem with loading the PNG image from site. For ex. go to icefilms com and is starts to load png like crazy CPU is huge and you can not shut down Firefox at least a minute. This is not just in this site but whit any one whit lots of pictures.
Image from firefox: Picture [http://img836.imageshack.us/img836/9910/7312011103147pm.jpg 1] [http://img28.imageshack.us/img28/8505/7312011103249pm.jpg 2] [http://img706.imageshack.us/img706/5615/7312011103348pm.jpg 3 ][http://img827.imageshack.us/img827/8483/7312011103533pm.jpg 4]
This is my Task Manager [http://img217.imageshack.us/img217/5715/7312011103621pm.jpg 1]
- I try safe mode, same thing
-All addons and plugins are ok
Any idea why is this so big problem.i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check.
This problem just started for about 3 to 4 days now. earlier it was working normally. -
Load picture control with png image from the web
Hi guys,
Is there an example anywhere for Labview 8.6 for loading a picture control with png image from the web?Hi lavalava,
here you find a note on how to load pictures from the internet. After grabbing the data you could save them to a file, load the file with the picture file functions and then convert it into the image datatype to feed a picture indicator with the data...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
How to create an gray scale png image from intensitie​s values
Hi,
I would like create a gray scale png image from set of intensities values which is saved in excel sheet . Is IMAQ tool necessary for this vi?
thanks & regards
ManojYou posted in the feedback forum, which is not correct for your question. I am guessing you are talking about LabVIEW since you mention "vi".
manojkp89 wrote:
Is IMAQ tool necessary for this vi?
The answer is NO. Plain LabVIEW is sufficient.
LabVIEW Champion . Do more with less code and in less time . -
How to load a boot image to cisco aironet 1140 series after missing boot image
Hi all,
I need a solution for this. When i switch my cisco aironet 1140 , it s blinking with red light .and gives a message "no boot image to load".
When i tried next time, by pressing escape it shows this message that i have mentioned below.
ap:
ap:
using eeprom values
WRDTR,CLKTR: 0x83000800 0x40000000
RQDC ,RFDC : 0x80000035 0x00000208
using ÿÿÿÿ ddr static values from serial eeprom
ddr init done
Running Normal Memtest...
Passed.
IOS Bootloader - Starting system.
FLASH CHIP: Numonyx P33
Checking for Over Erased blocks
Xmodem file system is available.
DDR values used from system serial eeprom.
WRDTR,CLKTR: 0x83000800, 0x40000000
RQDC, RFDC : 0x80000035, 0x00000208
PCIE0: link is up.
PCIE0: VC0 is active
PCIE1: link is NOT up.
PCIE1 port 1 not initialized
PCIEx: initialization done
flashfs[0]: 1 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 32385024
flashfs[0]: Bytes used: 1536
flashfs[0]: Bytes available: 32383488
flashfs[0]: flashfs fsck took 16 seconds.
Reading cookie from system serial eeprom...Done
Base Ethernet MAC address: 28:94:0f:d6:c8:62
Ethernet speed is 100 Mb - FULL duplex
The system is unable to boot automatically because there
are no bootable files.
C1140 Boot Loader (C1140-BOOT-M) Version 12.4(23c)JA3, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Compiled Tue 18-Oct-11 14:51 by prod_rel_team
ap:
So , now my question is how to load the boot image ? From where will we get this ? OR
I m also having another Cisco aironet 1140 , Can i get bootimage from that . Kindly let me know the solution from genius ?Take a look at this link as it should have the info you need
https://supportforums.cisco.com/docs/DOC-14636
Sent from Cisco Technical Support iPhone App -
How do I save specific image from a .tif file?
Hello, I have a big .tif file contains some images. How can I save an image from a specific layer, to a .jpg or .png file?
Hide the layers as deepakgahlot has suggested by selecting the eye icon on the layers pallet and then when you have the layer you want save for web (Shift+Ctrl+Alt+S) or File>Save for Web.. and then you can select either a .jpg or .png
-
Export PDF, JPG or PNG images from the mapviewer
hi,
I need to export PDF, JPG or PNG images from the mapviewer (Oracle Map client).
How Can I do it?
Any Ideas?
Thanks.What I do with xml after calling getMapAsXML function
Any example?There is a request page in the mapviever configuration webpages, there you can send it to the server and get the image in return.
or you can write your own programm to send it to the mapviewer servlet using post and progress the response by yourself. Have a look at the mapviewer documentation pdf, there are some examples on the different possible different xml requests. -
How to turn off PNG Images?
PNG is a format for (compressed) images just like the JPG format. There is no way to disable this format.
If you have a problem with images on some web pages then you may need to block images from some domains.
You can look at the Adblock Plus extension to block specific content.
* Adblock Plus: https://addons.mozilla.org/firefox/addon/adblock-plus/
You need to subscribe to a Filter list (e.g. the EasyList).
* http://adblockplus.org/en/subscriptions
* http://adblockplus.org/en/getting_started -
How can i read a image from a oracle DB?
How can i read a image from a oracle DB?
Because in the DB a have a field that is a picture that i would like to show in a jpanel.....but this field is in oracle DB only has strange caracters ..... so Do i have to read this field like a input stream?....
Could some body help me please?
Thanks...
MaryWell I suppose the picture is stored in a blob. If that is so this is some code I have used to load a picture to a panel. Hope you find it usefull.
PreparedStatement retreive = db.createPreparedStatement("select bl from test where ln = ?");
Blob bl;
try{
retreive.setBigDecimal(1, new BigDecimal(jTFln.getText()));
ResultSet rs = retreive.executeQuery();
if (!rs.next())
System.out.println("Empty Result Set");
bl = rs.getBlob("bl");
if (bl == null) {
System.out.println("Null Blob");
return;
InputStream is = bl.getBinaryStream();
int imageLength = (int) bl.length();
System.out.println(imageLength);
System.out.println(bl.length());
byte[] imageData = new byte [imageLength];
is.read(imageData, 0, imageLength);
image1 = new ImageIcon(imageData);
photo = new JPanel() {
public void paint(Graphics g){
g.setColor(Color.lightGray);
g.drawImage(image1.getImage(), 0, 0, this);
} catch (BadLocationException ble){
ble.printStackTrace();
} catch (SQLException sqle){
sqle.printStackTrace();
} catch (IOException ioe){
ioe.printStackTrace();
} -
In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone which are downloaded and not saved,but they remain in cache.
Even in some apps i have data which i want to remove,but cant find a way to remove them and they are in my cache eating up my memory.Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.
-
Can anyone tell me how to load my music library from my PC down to my IPad??
Some how when I updated the OS on my IPad I lost all my music in the IPOD section. I would like to find out how to load my music library from my PC to my IPad? Thanks.
If you use iTunes See Here
Syncing with iTunes
From Here
http://www.apple.com/support/ipad/syncing/
Ipad User Guide
http://manuals.info.apple.com/en_US/ipad_2_user_guide.pdf
Maybe you are looking for
-
My Time Capsule has stopped backing up. I have an Apple Time Capsule which backs up by wireless. For the last 3 days it has not backed up. I get this message: "The backup was not performed because an error occurred while copying files to the backup d
-
"send via email" STILL not working
Hi community - I have seen this question asked several times but none of the answers given seem to apply to me. I am working in a Pages document. I want to send this document as a Word file to someone else. I go to the Share menu, click Word under th
-
Connecting with the WRT160N issues
It seems as though I installed everything correctly, the ping is very strong and when I use my DS or netbook my network comes up but after I punch in the code it says cannot connect. This is simply infuriating me, it's been the one but sizable blemi
-
New MacBook Air, iTunes was working at first, now will not play anything
Brand new Macbook Air and after an unnecessarily complicated setup I finally had music playing the first day. Now it will not play music or podcasts. Cleared cache, restarted, up to date. I press play it changes to the pause icon but no time movement
-
I updated my software today and since have not been able to use some of the games on Facebook. I have installed the flash player 12 and still problems, can anyone give me some advice?