00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef QSWINGIMAGEBRIDGE_H
00010 #define QSWINGIMAGEBRIDGE_H
00011
00012 #include "JavaQxQSwing.h"
00013
00014
00015
00016
00017
00024 class JAVAQX_EXPORT QSwingImageBridge
00025 {
00026 public:
00027 static jlong createImage(JNIEnv *env);
00028 static jlong createImage(JNIEnv *env, jobject obj, jbyteArray imageData,
00029 jint lenght);
00030 static jobject createScaled(JNIEnv *env, jlong imagePointer, jint width,
00031 jint height, jint hints, jstring format);
00032 static void initialize(JNIEnv *env, jclass cls);
00033 public:
00034 static jobject newInstance(const QPixmap &pixmap, jstring format);
00035 static QPixmap *createDisabledPixmap(QPixmap *pm);
00036 static bool loadImage(JNIEnv *env, jbyteArray imageData, jint length,
00037 QPixmap *pixmap);
00038 private:
00039 static jclass sm_imageClass;
00040 static jmethodID sm_constructorMID;
00041 static jfieldID sm_widthFID;
00042 static jfieldID sm_heightFID;
00043 };
00044
00045
00046
00047
00048
00049 #define qSwingImage (reinterpret_cast<QPixmap *>(imagePointer))
00050
00051 #endif //QSWINGIMAGEBRIDGE_H
00052
00053
00054
00055
00056
00057
00058
00059