Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Java Swt Image Export


  • Please log in to reply
2 replies to this topic

#1 petocities

petocities

  • Members
  • 102 posts
  • OFFLINE
  •  
  • Location:Santiago Chile
  • Local time:05:42 PM

Posted 01 July 2006 - 06:41 PM

Hi guys.
I'm doing a lil project with Java SWT, and it was fine, until I reached a dead end:
I need to export an image contained by a canvas...

I already have an algorithm that can export an image contained by a canvas, but for an AWT canvas, not SWT. So, my question is: Can i transform that SWT canvas to AWT?

Anyhow, if anyone knows a way to export that image right away from the SWT canvas, that would be really helpful. It needs to be a well known format, like jpeg, jpg, gif, etc., but I still can't found a way (specially because I don't know SWT very well yet).

Thx for your time guys. Im lookin forward for good news (plz! lol)
Posted Image

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:42 PM

Posted 02 July 2006 - 01:44 PM

I geuss I am a little puzzled as to what you are trying to do. The image contained in your frame has to come from somewhere, whether it be from a file on your computer, or an image downloaded from the net. Can you just export that image?

Unless of course you are creating your own custom drawing program, in which case that is a different matter altogether. Can you fill us in a bit?

#3 petocities

petocities
  • Topic Starter

  • Members
  • 102 posts
  • OFFLINE
  •  
  • Location:Santiago Chile
  • Local time:05:42 PM

Posted 02 July 2006 - 04:02 PM

Yeh, sorry I sdidn't put in many details, I tend to commit that mistake.
I am creating a program that generates diagrams from code inputs given by the user (similar to xml, but less complex. It creates entities and relations between them).

The image is generated through a rendering algorithm a friend made, and stored into the swt canvas. But the rendering algorithm doesn't arrange the elements, it just throw 'em all over each other, and the user has to rearrange the image. When he finishes that process, he should be able to export that image to a known format file, like jpg.

The problem I bumped into is that the image generated is stored into a swt canvas, and I managed to make an awt algorithm to get it, but they are not complatible, so I am kinda stuck again. I tried using swt methods, but it seems I am not able to understand how it works very much, so I am unable to make it using only swt.

If anyone knows a way to export the image stored in a swt canvas, or to transform the canvas to swt, or a way to get the content, it would be great.
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users