lukenguyen-me / react-native-draw-view

Provice a native UI component to draw onto.
3 stars 2 forks source link

When drawing in landscape mode, the saved output saves a square 250x250 image. #2

Open FinSlate opened 4 years ago

FinSlate commented 4 years ago

Steps to reproduce.

  1. Adjust virtual phone to landscape format.
  2. Draw Image that takes the whole width of the phone.
  3. Save the image.
  4. Open the image. (I went to Android Studio -> View -> Tool Windows -> Device File Explorer

Expected:

Actual:

I am trying to look in to the optional parameters we can pass to dispatchViewManagerCommand and the 'DrawView' native Android component.

Thanks.

BeforeSave aftersave

FinSlate commented 4 years ago

For anyone wondering- this is very similar to this repo

https://github.com/terrylinla/react-native-sketch-canvas

The other repo handles layouts better on Android. However, this one allows you to save files to the androids internal app directory so you don't need permissions..depends on your use case.

To switch Terry's over you need to go into the Android/src/sketch.java and change the Save path from external to mContext.GetDir() in both instances.

Hopes this helps someone.