Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [canvas]

Canvas is a generic term for the drawing surface used with many free-form graphics output APIs. Use this tag with other tags that indicate the specific graphics API that is being used along with the programming language and the target environment: [android], [uwp], [wpf], [tkinter], [java], [html5], [chart.js] etc. Also include a specific canvas tag such as [android-canvas], [html5-canvas], [tkinter-canvas] if appropriate.

canvas
0 votes
0 answers
21 views

Problem with Enemy State Update in React for Multiplayer Game: Projectiles Not Following Moving Enemies

I am working on a multiplayer tower defense game using React, where enemies and defenders are updated and rendered on a canvas. I’m encountering an issue where the enemy state is not updating ...
AshitaNoRezero's user avatar
2 votes
1 answer
47 views

Tkinter canvas object tag_bind causing memory leak

If I monitor the Windows task manager while a program of mine is running, I see a memory usage number that goes up continuously. I wrote the attached code to demonstrate the problem. Once a tag_bind ...
agat's user avatar
  • 21
0 votes
0 answers
38 views

2D Canvas | Smooth camera without jitter

In my demo, you can see that the player's camera catches up with the player's position with a slight delay. It follows him until the player finally stops, gradually reducing the distance. ...
RoyBlunk's user avatar
  • 141
0 votes
1 answer
11 views

Flutter: customepaint and gesture out of sync when offscreen

I am developing a node editor sort of app, in which you can add nodes and connect them with a noodle connection (like in blender and Unreal engine), I am facing a problem when a node is dragged off ...
DEGUIDER's user avatar
0 votes
1 answer
31 views

Drawing iText7 Canvas lines does not always fill page

I have the following code to apply a full page grid to an existing A4 pdf document. It works fine on pdfs I or others have produced with iText, but when I try to use on a PDF that has been created by ...
kalpha's user avatar
  • 47
0 votes
1 answer
27 views

canvas.setBackgroundImage is not a function Reactjs-Fabricjs

I am working on a project where I am using fabricjs with reactjs. I am trying to upload an image through an input tag and set it up as a background for the canvas. Here is my code: import React, { ...
Akram Abuhajar's user avatar
0 votes
0 answers
22 views

Android Jetpack Compose Canvas - How to zoom/magnify part of image using canvas?

I have two images stacked on top of each other: one is colored, and the other is grayscale. I want to implement a feature where, whenever the user drags on the image, a rectangular area above their ...
Deepak Tiwari's user avatar
0 votes
1 answer
30 views

Fabric.js on Next.js > TypeError: Cannot read properties of undefined (reading 'Canvas') > const canvas = new fabric.Canvas(canvasRef.current, {

While creating a Figma Clone with Next.js, I'm getting the following error when importing fabric.js. Applying the suggestions from Claude temporarily solves the issue, but it seems this isn't the ...
신재완's user avatar
0 votes
0 answers
28 views

how to draw an arc with fabric.js pencil brush?

I want to use pencil brush of fabric.js to make a tool to let user can draw an arc by dragging and dropping. I make a function: public static setArcBrush(canvas: fabric.Canvas, cellWidth: number) { ...
Yicai Li's user avatar
1 vote
1 answer
27 views

Canvas not scaling UI elements

I just found out about the "scale with screen size" feature and now wanted to use it. Because I am working on a 2560x1440 display, that is what I used, but if I switch my view to 1920x1080, ...
Spacter's user avatar
  • 73
0 votes
0 answers
21 views

Kotlin databinding for a custom view (canvas) for a recyclerview with multiple viewtypes

Previously I used kotlin synthetics, but now I'm trying to upgrade to data binding. I have a recyclerview in a fragment and it will have multiple view types all of which will be custom-draw with a ...
James's user avatar
  • 1
0 votes
0 answers
15 views

How Can I Achieve SVG Design with Canvas Performance in a React Application?

I'm developing a React application that needs to render a large number of elements. I've implemented the rendering using both and . Canvas: Provides excellent performance and smooth rendering. SVG: ...
user26132048's user avatar
2 votes
2 answers
77 views

2D smooth movement from scratch (javascript, pixelart)

My interest in game development led me to the idea of implementing the logic from scratch, without an engine. Finally, I came to the point of optimizing the movement sequences of the background in an ...
RoyBlunk's user avatar
  • 141
1 vote
0 answers
25 views

Three.js + Next.js Not rendering twice

The Problem Whenever I open and close my dialog in production, the threejs scene does not remount. Here's the expected behavior..it works just fine running locally on my machine However, in ...
Preston Bourne's user avatar
1 vote
1 answer
44 views

How to draw a horizontal diamond (rhombus) with rounded corners using Canvas in flutter?

I want to have border/corner radius for my diamond widget. Something like this: BorderRadius.all(Radius.circular(cornerRadius)) I should probably use arcToPoint, arcTo or quadraticBezierTo functions ...
Hamed Heydarian's user avatar

15 30 50 per page
1
2 3 4 5
2411