• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transfer bitmap from native to java

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
padmanabh dongre
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic