Cause I want to protect my images but yet to need to use it in the game i am creating... is it possible by any chance?or is there other methods ?

other then JARs I don't know. Maybe you can put all image data into array in the class itself and load it that way... source code would look horrible Maybe puting all images into a single file and then grabing them out one by one as raw data... of course then load that data as image or something.

Actually I don't know a thing about dlls, I just ironicly staded you can create file with any name you like and put data (image) in it. I'm not sure about image data in array from start, other guys will need to help you on this.

Except that I could easily inject my own class into the classloader and intercept all the data after you've decrypted it for me. Or I could just hook into the OpenGL dlls and extract the image data as you pass it in. Or I could just use print screen.

If it's on the client then it's insecure. You just have to live with that.

Could not argue with that All you can do is to prevent "normal" users from copying the images. If someone has a little technical knowledge and the will to extract your coprighted data, there is nothing you can do.

kingaschi is right, it doesn't matter how you encrypt it, because it's all just raw image data by the time it hits the screen.

same reason why iTunes (for the few who legally obtain music) can't limit your music to one computer, because, by the time it hits your speakers... it's sound, and VERY recordable from the line out port

anyway, what I've done before [when I used to care about my image data] is create a file that has the EXTENSION of .dll but isn't really a .dll. I was just using ZipOutputStream to shove all my images to one zip file [but it wasn't .zip, it was just .dll]. So, to a newbie who doesn't know how a normal DLL looks on the inside, this worked fine. But to all of us who happen to know that all zip file data starts with "PK"... it's just a matter of renaming that file to .zip and ta-da.

But to all of us who happen to know that all zip file data starts with "PK"... it's just a matter of renaming that file to .zip and ta-da.

That's where encrypting the content helps to some degree. You can't prevent your images from being stolen by criminals, but you can reduce the amount of users capable to do it:

Using unencrypted images with correct suffixes:everyone can steel itChanging the the suffix:everyone that is courious enough can steel it (Just drag and drop to a capable image viewer)Using an archive and change the suffix:everyone knowing about archives and hex-editors can steel itUsing encrypted images:the user must at least know about java, processes, classloaders and jad to steal it

I have not listed an encrypted archive, because ZipInputStream generates temporary files afaik.

As pointed ot before, there is always the possibility to steel images directly from screen by just taking a screenshot. This might be a smaller problem, since you can't "bulk-steel", cause one is limited to a single image per screenshot.

There might also be the possibility to steel images with a memory exploration tool.

As a rule of thumb, just protect your data to a degree, where the effort to steel it rises to a degree that enough of your target audience will lose interest to do so. What this means depends on you and your target audience.

Actually there are situations where normal screen shots will fail, believe it or not. Some media players will direct stuff through some hardware pipe or something (I presume), and the image information will not be inside the memory which the screenshot copies (this, of course, depends on how 'close' to the screen that memory buffer resides). This is sometimes a pain in the butt when trying to display movies on an external screen. One 'fix' I usually apply is to start TWO instances of media players, of which the first one will use the hardware piping thingy (or whatever it is), and the second will display properly

I doubt that.. you have a link to article or some info we can google about?I think screenshots take data directly from output of graphics card, the data that arrives in monitor. If it's like that it would be impossible to hide image from a screenshot.

I've seen it happen: In my final year at university, one of the groups went to the trouble of making a 3D movie for their presentation. They distributed the 3D goggles, the expectation was palpable, and then the projector gave them a blank section of screen where their movie should have been

You can only screenshot image data that is displayed in the normal graphic memory of the video card (at least with the standard screenshot methods). If the media-player or game uses overlays, you will just capture the overlay color. It might be possible to implement a game using overlays to disable screenshot capability by rendering to a background buffer and blitting it to a window or the screen using overlay methods. But don't ask how

I doubt that.. you have a link to article or some info we can google about?I think screenshots take data directly from output of graphics card, the data that arrives in monitor. If it's like that it would be impossible to hide image from a screenshot.

My comments are based on the following observations:

First, I once wanted to take a screen shot from a file played in a media player, but all that was pasted was garbage in that particular area of the screen. Launching another media player (which was cumbersome because some applications prevent other instances of themselves to be started at the same time) solved the problem completely.

Second, one of my friends cannot watch video on the TV screen without launching two media players, presumably for the same reason. The first video player launched will show black only. This was observed for Windows Media Player and Media Player Classic.

Third, well, I have seen the problem multiple times, I don't remember all of them

Yeah, it's the use of hardware overlays. IIRC these only get used when the graphics card is doing video decoding (so you're not going to have this problem with a game) - it bypasses the actual framebuffer and gets composed right at the last minute.

Incidentally if you want to disable these overlays you can turn the 'graphics acceleration' slider in windows down. The lowest or second lowest does all of that in software so it'll screen capture just fine.

you can try this for an even weirder example. open up a movie in a media player [say, winamp], and perform a print screen. paste it into mspaint or whatever, BUT DONT STOP THE MOVIE. the area on the pasted image that came from the media player will continue to update, even though the rest of the image does not [like the clock will never change, for example]

you can try this for an even weirder example. open up a movie in a media player [say, winamp], and perform a print screen. paste it into mspaint or whatever, BUT DONT STOP THE MOVIE. the area on the pasted image that came from the media player will continue to update, even though the rest of the image does not [like the clock will never change, for example]

sounds like that is a case of using a color mask for the overlay area. Often a bright purple/pink. The video card can use that colour to know where on the screen it should show the overlay buffer. When you paste into paint you get that exact overlay mask colour in the paint image... if you save the bitmap it should show that colour.

Yeah, it's the use of hardware overlays. IIRC these only get used when the graphics card is doing video decoding (so you're not going to have this problem with a game) - it bypasses the actual framebuffer and gets composed right at the last minute.

The VERY first 3D cards (the early Vodoo cards) did this as well.

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

Yeah, it's the use of hardware overlays. IIRC these only get used when the graphics card is doing video decoding (so you're not going to have this problem with a game) - it bypasses the actual framebuffer and gets composed right at the last minute.

The VERY first 3D cards (the early Vodoo cards) did this as well.

Ah yes, those odd pass-though vga cables that were such a pain to twist into the correct shape. I've still got a 12Mb voodoo 2 knocking around here somewhere...

you can try this for an even weirder example. open up a movie in a media player [say, winamp], and perform a print screen. paste it into mspaint or whatever, BUT DONT STOP THE MOVIE. the area on the pasted image that came from the media player will continue to update, even though the rest of the image does not [like the clock will never change, for example]

When I first experienced that it was like seeing a pink elephant. Luckily there were a couple of other people present to confirm that I was not seeing things

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org