jQuery in Action, 2nd edition
The moose likes Java in General and the fly likes Transfer bitmap from native to java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Transfer bitmap from native to java" Watch "Transfer bitmap from native to java" New topic
Author

Transfer bitmap from native to java

padmanabh dongre
Greenhorn

Joined: Aug 13, 2001
Posts: 24
Hi
I am trying to pass a reference of HBITMAP data structure from a native method to a java class.
Can anyone help me regarding this??
thanks
Padmanabh
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
Hi,
You cannot directly access a structure referenced in a native code and access the members in the Java code. What you can do is that convert the entire structure into a bytestream equivalent and return to the Java code as jbytearray so that you can have the data available in the structure.
Please state the exact requirement so that I can help. Why do you want to pass the HBITMAP handle to the Java code?
--------------
Vijay


Thanks,<p>Vijay<p>The Hand that gives, Gathers.
padmanabh dongre
Greenhorn

Joined: Aug 13, 2001
Posts: 24
Hi
thanks for an immediate response. here is what i want to do.
I am using a native api to generate a barcode component and i want to display this barcode as a BufferredImage in java. I can trasfer this thru system clipboard but i would like to avoid it since it is not threadsafe. So i need to transfer the HBITMAP data structure to java.
For that i thought of getting the rgb array from HBITMAP and return as jbytearray ( which u have mentioned in ur answer ). but i dont know how exactly to get the rgb bytes from HBITMAP. and i dont know whether using this byte array and creating a raster ( or something ) in java will work.
pls help
regards,
Padmanabh
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
Hi,
I am not that much aware in the areas of imaging using Java. Please refer javax.swing.ImageIcon whether it could do any help, that supports only gif and jpeg.
 
IntelliJ Java IDE
 
subject: Transfer bitmap from native to java
 
Threads others viewed
question about Dan's mock exam (interfaces)
How can I get system RAM
hibernate hello world
Accessing of shared variables of 4gl from JAVA
no ocijdbc10 in java.library.path
MyEclipse, The Clear Choice