-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color Palette Error #62
Comments
This is a port of the ColorPicker example? Could you try the graphx version on Github? Follow this guide. Are you testing on desktop/web/mobile ? |
Yes I'm talking about ColorPicker, I'm currently using it on the Desktop with Graphx version 1.0.9 |
I just tried it on macos, and seems to be working on the master channel, which flutter version are you using? |
Is kinda late for me now. To get more prompt and interactive support, I encourage you to join us on our Telegram or Discord channels, you can get the links in the readme. I will be available tomorrow to provide further assistance if needed. Looking forward to seeing you there and helping you resolve your issue. |
I'm on version 3.9.0-16.0.pre.37 on the channel master I copied the ColorPicker project exactly as it is on GitHub without any difference, and I have the error I showed you Flutter 3.9.0-16.0.pre.37 • channel master • https://github.com/flutter/flutter.git |
I'm on macOS, can't test on Windows/Linux in pubspec.yaml environment:
# sdk: ">=2.19.0 <3.0.0"
sdk: ">=3.0.0-362.0.dev <=4.0.0" I can run the example without exceptions. The exception you shown seems like a dimension issues to rasterize the As a quick test, run this code as your scene, and see if it renders a magenta circle (this uses the same API as the color picker demo to rasterize an Image): class SampleTexture extends GSprite {
@override
Future<void> addedToStage() async {
stage!.addChild(
GBitmap(await GTextureUtils.createCircle()),
);
}
} |
I have well the round of magenta color which is displayed with the piece of code that you write |
Then most likely is an issue with dimensions. Probably the widget is not being expanded and the stage size is 0. Test the latest code from the repo and tell me if the issue persist. Also, as suggested before, you can join us in our server for further help, as I can't replicate this issue. |
Future<ByteData?> getImageBytes(GDisplayObject object) async {
var texture = await object.createImageTexture(); <--------- Here
return texture.root?.toByteData();
// texture?.dispose();
// texture = null;
}
[ +95 ms] [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Invalid image dimensions.
[ ] #0 Picture.toImage (dart:ui/painting.dart:5791:7)
[ ] #1 GDisplayObject.createImage (package:graphx/src/display/display_object.dart:1132:34)
[ ] #2 GDisplayObject.createImageTexture (package:graphx/src/display/display_object.dart:1099:23)
[ ] #3 getImageBytes (package:neuron/widgets/studio/components/right_menu/atomic_ui/color_palette_utils.dart:35:30)
[ ] #4 HueScene.addedToStage (package:neuron/widgets/studio/components/right_menu/atomic_ui/color_palette_hue_scene.dart:108:5)
[ ] #5 GDisplayObjectContainer.addChildAt (package:graphx/src/display/display_object_container.dart:152:15)
The text was updated successfully, but these errors were encountered: