Results 1 to 11 of 11
- 04-10-2012, 08:54 PM #1
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Where is source code for createImage(byte[] imagedata, int imageoffset, int imageleng
As shown on java.awt: Toolkit.java, the toolKit classes createImage(byte[] imagedata) member function calls createImage(imagedata, 0, imagedata.length).
Where is the source code for createImage(byte[] imagedata, int imageoffset, int imagelength)?
Stephen
- 04-10-2012, 09:06 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
Toolkit (Java Platform SE 6)
and"Subclasses of the Toolkit class are used to bind the various components to particular native toolkit implementations."
http://oreilly.com/openbook/javawt/book/ch15.pdfMost applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the java.awt package with their counterparts in java.awt.peer. Some methods defined by Toolkit query the native operating system directly.
The Toolkit object is an abstract class that provides an interface to platform-specific details like window size, available fonts, and printing. Every platform that supports Java must provide a concrete class that extends the Toolkit class
- 04-10-2012, 09:18 PM #3
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
Thanks for the link to the book.
Ok, where can I find the platform specific source code for createImage(byte[] imagedata, int imageoffset, int imagelength)?
- 04-10-2012, 09:23 PM #4
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
oO - for which platform? There a several implementations: sun.awt: abstract public class: SunToolkit
- 04-10-2012, 09:34 PM #5
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
Windows 7.
- 04-10-2012, 09:38 PM #6
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
Are you serious? ....

System.out.println(Toolkit.getDefaultToolkit());
- 04-10-2012, 10:02 PM #7
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
System.out.println(Toolkit.getDefaultToolkit()) returned sun.awt.windows.WToolkit.
I looked in OpenJDK\jdk\src\windows\classes\sun\awt\windows\WT oolkit.java and I didn't find any createImage(byte[] imagedata, int imageoffset, int imagelength).
Ok, I found out the WToolkit extends the SunToolkit which implements the createImage(byte[] imagedata, int imageoffset, int imagelength). Thanks.Last edited by shall; 04-10-2012 at 10:15 PM.
- 04-11-2012, 02:59 AM #8
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
The SunToolkit class createImage(byte[] imagedata, int imageoffset, int imagelength) member function calls createImage(new ByteArrayImageSource(data, offset, length)).
I couldn't find an associated createImage(ByteArrayImageSource ...) function.
Does anyone know where its located?
I noticed that ByteArrayImageSource extends InputStreamImageSource and that InputStreamImageSource implements ImageProducer .
Does that mean that public Image createImage(ImageProducer producer) would be called? If so, why?
- 04-11-2012, 07:48 PM #9
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
- 04-11-2012, 08:09 PM #10
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
I wasn't exactly sure that a ByteArrayImageSource could be thought of some sort of ImageProducer. But I'm fairly sure it can after reading another post about classes and interfaces.
- 04-13-2012, 08:22 PM #11
Member
- Join Date
- Apr 2012
- Posts
- 12
- Rep Power
- 0
Re: Where is source code for createImage(byte[] imagedata, int imageoffset, int image
I was trying to figure out where the implementation for EntityManager was and found this thread. Using grep (The println trick, above, would have saved me some time.) I figured out that it was implemented in eclipse/persistence/internal/jpa/EntityManagerImpl.java but being kind of old school I wanted to know how java knew to go there.
My guess is that the compiler maps all of the functions in all of the libraries in the build path and grabs the first implementation he sees. Is that right?
Similar Threads
-
I want the source code of DUK's Bank , the example code in Java EE 5 Tutorial 2010
By zahra in forum New To JavaReplies: 16Last Post: 01-31-2012, 08:36 PM -
servlet include method copying sorce code and executing source code as output how to
By shamkuma2k in forum Advanced JavaReplies: 0Last Post: 08-07-2011, 08:32 PM -
createImage
By pabloma2002 in forum EclipseReplies: 1Last Post: 01-18-2011, 06:30 PM -
SWT ImageData -- How to obtain number of channels
By jiapei100 in forum SWT / JFaceReplies: 0Last Post: 04-17-2010, 09:22 AM -
MavenJava - browse source code of all open source projects online
By jirkacelak in forum Java SoftwareReplies: 1Last Post: 11-28-2008, 06:27 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks