• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Loading image in Canvas (Urgent)

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to load an image and show it in a Canvas. I used the default toolkit's getImage() to load it, used a MediaTracker to, of course, track it, and it showed me that I got an error loading the image... Why?? Please... I need it working tomorrow. Look at the (sample) code:

Debug 1 prints out:
File exists: true
Debug 2 doesn't print
Debug 3 prinst out:
Error loading: true
Debug 4 prints:
drawImage: false
drawImage: false
drawImage: false
drawImage: false
drawImage: false
drawImage: false
drawImage: false
and so on...
Anybody can tell me what could be wrong since I get an error loading the image, and the image is actually at c:\juba\used.bmp... (debug one shows that)
Thanx in advance
Juba d-_-b
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, the problem is the bmp image. Have you ever tried to load a gif or jpg image? This should work. If you want to use bmp, then you have to use JAI - Java Advanced Imaging.
 
Jonathas Carrijo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I love you! You saved my life... my future!!
Thank u so much
Juba d-_-b
 
Get me the mayor's office! I need to tell him about this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic