• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Bmp, gif, jpeg

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,

Is it possible to save a panel as a graphic file like a bmp, gif, jpeg?

I have a calender that has a panel as the base. I want to save the the calender as a graphic.

Thank you

Tys
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're trying to save an image then you have to work with the image.Use the proper API. (See working with images on java.sun.com).

If you're trying to *print* a form, then i don't thing that there is a way you should do that, because this is an operating system's ability.I mean that in other languages, like C++,VB use some System's libraries (like MCI) to print a form etc. The reason is that the programming languages they can use such libraries, are written in system's code-base.And to be more specific: the operating system are written with these languages(talking for C++).Java is Platform Indepedent so i think what you're looking for can't be done.If there is a way to save a panel as an image without using system's libraries, post it if you'll find it, because i don't know any.Java is a low level to high level language,and probably there is a way, but i think it is very advanced.

I'm not telling you to stop looking, I'm telling you what i think.It is intresting , and if you find anything post it!

Best regards
Nikos sokaf
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be buggy, I didn't test anything. Should give you the general idea though. Google's an amazing thing you know.

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nikos sokaf:
If you're trying to *print* a form, then i don't thing that there is a way you should do that, because this is an operating system's ability...Java is Platform Indepedent so i think what you're looking for can't be done.

I'm not telling you to stop looking, I'm telling you what i think.It is intresting , and if you find anything post it!

Best regards
Nikos sokaf



Um...Not exactly. Printing is a task performed by a Printer Driver. All printers are registered with the OS. It's the VM's job to locate those drivers and pass the information to them. That's why we have a different VM for different platforms.

Printing API/Tutorial
 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gregg,
I believe at last, you are right!
But i think this could be difficult.I haven't try it.But this is true you posted.


Farewell!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nikos sokaf:
Hi Gregg,
I believe at last, you are right!
But i think this could be difficult.I haven't try it.But this is true you posted.


Farewell!



It is difficult. The printing API sucks. But it's not much better in any otehr language. You really have to do a lot of preparations of whatever you are printing before sending it to the printer. Like making sure the margins are right and the print area is right, etc, etc. Someone needs to make a higher level API for this.
reply
    Bookmark Topic Watch Topic
  • New Topic