burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.16k stars 992 forks source link

not worked onBitmapRead #363

Closed alirezazarghi closed 3 years ago

alirezazarghi commented 3 years ago

hi can help me, me needed set run time set Filter Effect and save as bitmap :

private void setupFilters(Bitmap bitmap) {

    PhotoEditor mPhotoEditor;
    PhotoEditorView mPhotoEditorView;
    Bitmap bitmapFilter;
    mPhotoEditorView = new PhotoEditorView(mContext);
    mPhotoEditor = new PhotoEditor
            .Builder(mContext, mPhotoEditorView)
            .build();
    mPhotoEditorView.getSource().setSaveEnabled(true);
    mPhotoEditorView.getSource().setSaveFromParentEnabled(true);
    String[] sPhotoFilter = getNames(PhotoFilter.class);
    mPhotoEditorView.getSource().setImageBitmap(bitmap);
    for (int i = 0; i < sPhotoFilter.length; i++) {
        mPhotoEditor.clearAllViews();
        mPhotoEditor.addImage(((BitmapDrawable)mPhotoEditorView.getSource().getDrawable()).getBitmap());
        mPhotoEditor.setFilterEffect(PhotoFilter.valueOf(sPhotoFilter[i]));
        mPhotoEditorView.getSource().refreshDrawableState();
        bitmapFilter = ((BitmapDrawable)mPhotoEditorView.getSource().getDrawable()).getBitmap();
        SaveSettings saveSettings = new SaveSettings.Builder()
                .setClearViewsEnabled(true)
                .setTransparencyEnabled(true)
                .build();
        mPhotoEditor.saveAsBitmap(saveSettings,new OnSaveBitmap(){
            @Override
            public void onBitmapReady(Bitmap saveBitmap) {
                Log.e(TAG, "onBitmapReady: Not work");
            }
            @Override
            public void onFailure(Exception e) {

            }
        });

       mPairList.add(new ImageFilter(sPhotoFilter[i],
                PhotoFilter.valueOf(sPhotoFilter[i]),
                bitmapFilter));

    }
}

not worked onBitmapReady , thx to help me .

burhanrashid52 commented 3 years ago

I am not sure what you are trying to achieve here ? Can you explain me the usecase ?

alirezazarghi commented 3 years ago

help me to create photofilters thx

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 4 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.