Drawing Base64Encoded image as canvas background in flutter - flutter

I am facing two problems with my code:
1) I am unable to add a Base64Encoded string image as a background in Canvas.
2) Anything I am drawing in my canvas using freehand, is not clipping at the bottom edge of the canvas
Would like to have some help in achieveing the bove two tasks please. I have attached my existing code as well.
=============================================================
UPDATE:
So, I finally manage to add the image on canvas, thanks for the help. The issue I have landed onto is to constraint the image inside the container, regardless of the image size. I have attached screenshots of two different image sizes to better illustrate my problem :

Related

Flutter How to create pixel-art?

Imagine this, where I can render a picture as a canvas & then interact with whatever pixel I want.
Firstly I'd need to parse the pixels somehow, I've tried parsing this picture by it's on-picture pixel amount by using filesize/12x12 & trying to only render sub-lists of the bytes with Image.memory, but it didn't really work out well since it still doesn't make the pixels interactable & it renders it top-down. Maybe I would need to use an image that's true to size pixel amount instead but I'd then need to upscale it somehow.
Do I map each pixel to an container widget? Do I use the flutter canvas library? Im pretty confused.
How would I go about doing this?
Our app,you want code like that??
: https://apps.apple.com/vn/app/pixel-art-editor-for-mcpe/id1603567060
EDIT:
First: you need this: https://pub.dev/packages/image
img.Image image = img.decodeImage(file.readAsBytesSync());
image.setPixelSafe(x,y,color);// this line draw a color to pixel at x,y
next step paint image to canvas or Image.memory()

Problem while Making Background in Unity 3D

I'm Following these steps
Follow these few steps to add texture as a camera background:
Create a new Canvas that would hold your image.
In that canvas, on Canvas component set:
Render Mode to Screen Space - Camera.
Render Camera to your main camera (drag&drop).
Plane Distance are the units, at which the background would render.
Right-click on the newly created canvas and create an Image inside of it.
On the newly created image on Image component:
Set Source Image to your desired background sprite.
and can't insert my background also
can anyone help ?
It maybe that you will have to use a raw Image instead of a normal image as I think .png files are not supported in a normal Image component

upload and preview as repeated background image

I am searching for a tool on web but didnt got any success their at all. I want to have something like upload and preview the image as background as repeated one or any other alternative...
I have this sample:
How can I preview and cut the image as a perfect background image as repeated one. Is it possible in Photoshop or in some similiar products?
The trick i have recovered is crop a part of the image in a big canvas of Photoshop and then making the deuplicate copies of the layers...
If the image seems like irregular it means the cropped image is wrong so you have to change with a other or larger part of the image...
If it is regular and doesn't cut at the side onto the edge, it means image is perfect making background repeated...
Thanks...

process brightness on specific part of image

I am creating an application in which i am displaying image view with image and processing brightness on the image using slider. I want that brightness should be done only on the selected part of image and not on the entire image.
I want the brightness should be processed only on the central part of the image without using openGl Image processing.
Please help me to solve this problem. Hey guys Please help me its important for me.
There are several ways to accomplish this. One is to overide the drawRect: UIView method and use a mask. Another is to draw the bitmap yourself in a CGContext. Yet another is with OpenGL.
What have you tried?

UIScrollView with Paging

I am struggling with a problem related to uiscrollview.I need to load 3 images simultaneously into a scrollview like the attached image.If there is only one image the then that image should be shown centrally .If there are two images then first image should be shown centrally and half of the next image should be shown right to it.If there are three images then half of the first then second image centrally and finally half of third image .If the user scrolls it then the third image should come center,second should go first(show only half) and also the fourth image if any should load next.I am attaching my requirement here ,Looking for a solution thanks in advance...
You may find a better solution using core animation than using a scrollview. For example each of these images can be a CALayer or even a UIImageView that you can place and move around in a parent view or layer.