ofImage displays 4 small images instead of 1 full image

I have been trying to make it work for days but I haven’t been able to.I want to return a bitmap(an image from a video) using JNI and display it using ofImage.My problem is, although the following code does that, it displays four of the same images(small) next to each other, inside ofImage object,but I want to display just one big full image inside ofImage object.How can I solve this problem, I am doing something wrong in the code.

setup() function:
{


jclass bitmapConfig = ofGetJNIEnv() >FindClass("android/graphics/Bitmap$Config");

jfieldID rgba8888FieldID = ofGetJNIEnv()->GetStaticFieldID(bitmapConfig, "ARGB_8888", "Landroid/graphics/Bitmap$Config;");

jobject rgba8888Obj = ofGetJNIEnv()->GetStaticObjectField(bitmapConfig, rgba8888FieldID);

jclass mediadataret = ofGetJNIEnv()->FindClass("android/media/MediaMetadataRetriever");
   
jmethodID medID = ofGetJNIEnv()->GetMethodID(mediadataret,"<init>","()V");

jstring str1 = ofGetJNIEnv()->NewStringUTF("/storage/emulated/0/deneme1/MOV_0270.mp4");
  

ofGetJNIEnv()->CallVoidMethod(mediadatart,medID2,str1);
 
jclass classbitmap = ofGetJNIEnv()->FindClass("android/graphics/Bitmap");
   

jmethodID createBitmapMethodID = ofGetJNIEnv()->GetStaticMethodID(classbitmap,"createBitmap",
                                                               "(IILandroid/graphics/Bitmap$Config;)

Landroid/graphics/Bitmap;");
jobject bitmap1= ofGetJNIEnv()->CallStaticObjectMethod(classbitmap, createBitmapMethodID, _width,_height, rgba8888Obj);


jmethodID medID3 = ofGetJNIEnv()->GetMethodID(mediadataret,"getFrameAtTime","(J)Landroid/graphics/Bitmap;");
  
bitmap1 = ofGetJNIEnv()->CallObjectMethod(mediadatart,medID3,framenum);

jmethodID metID4 = ofGetJNIEnv()->GetMethodID(classbitmap,"getPixels","([IIIIIII)V");
jmethodID widthget = ofGetJNIEnv()->GetMethodID(classbitmap,"getWidth","()I");
jmethodID heightget = ofGetJNIEnv()->GetMethodID(classbitmap,"getHeight","()I");
 


jlong framenum=7*1000;
  
jint offset=0;
jint stride=1;
jint x=0;
jint y=0;
jint width= ofGetJNIEnv()->CallIntMethod(bitmap1,widthget);
jint height = ofGetJNIEnv()->CallIntMethod(bitmap1,heightget);

jintArray pixels = ofGetJNIEnv()->NewIntArray(width * height*4);
ofGetJNIEnv()->CallVoidMethod(bitmap1,metID4,pixels,offset,width,x,y,width,height);


int* pixelsp = new int[width*height*4];

ofGetJNIEnv()->GetIntArrayRegion(pixels,0,width*height,pixelsp);

bitmap = new unsigned char[width*height*4];


for (int y=0; y<height; y++) {
        for (int x=0; x<width; x++) {
            

            int index = 4 * ( x + width * y );
            unsigned char red = pixelsp[index]>>16 ;
            unsigned char green = pixelsp[index+1 ]>>8;
            unsigned char blue = pixelsp[index+2];
            unsigned char alpha = pixelsp[index+3] >> 24;


            bitmap[index]=red;
            bitmap[index+1]=green;
            bitmap[index+2]=blue;
            bitmap[index+3]=alpha;

           
 

       }

}

image1.setFromPixels(bitmap, width, height, ofImageType::OF_IMAGE_COLOR_ALPHA,true);
  
ofBackground(255,255,255);

width__=width;
height__=height;

}


draw() function:
{
ofSetColor( 255, 255, 255 );
image1.draw(50,50,width__,height__);
}