Click here to Skip to main content
15,891,692 members
Everything / 2d

2d

2D

Great Reads

by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands

Latest Articles

by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development

All Articles

Sort by Updated

2d 

12 Mar 2024 by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
15 Jan 2024 by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
14 Mar 2023 by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
This work proposes the development of a Raycast engine in JavaScript to facilitate the 3D game development.
15 Nov 2022 by James Murinio
How would you make such an animation in python? The animation is about showing the concept of time division multiplexing. Each user has data to send through the shared medium. Data is combined into frames. Length of the frame is equal to number...
15 Nov 2022 by Richard MacCutchan
It is impossible to tell you which package is better, as that depends on too many unknowns. You need to try them for yourself to see which one best fits your requirements.
22 Oct 2022 by Jean-Claude Lanz
2D Drawing component with Scaling, Zooming, Scrolling, Centering and Resizing capabilities
9 Sep 2021 by Nils Leonhardt
Hello, I'm trying to create a short 2D game where you can wait x amount of time to get for example 50 "troops". This for now works fine, but now I need a script that detects the number of troops I have (at the startpoint) and send them out, just...
18 Jun 2021 by honey the codewitch
Use GFX effectively with e-paper/e-ink displays
3 Jun 2021 by honey the codewitch
Explore techniques for drawing using GFX
30 May 2021 by Rahul Dicholkar
the code is written to sort names using dynamic allocation.i need to set limit for numbers of charaters entered by the columns and need to set limit to 32.the code is working but i dont know how to set limit for columns. columns need to set...
30 May 2021 by Rahul Dicholkar
sir the above code throws an error: error: too many arguments to function ‘getchar’ 50 | getchar(c); | ^~~~~~~ In file included from class.c:1: /usr/include/stdio.h:492:12: note: declared here 492 | extern int getchar (void); also...
28 May 2021 by k5054
The simple thing to do is to add a width specifier to your format string e.g scanf("%32s\n", name[i] However, if you enter a name with spaces in it e.g. "James Earl Jones", then using the %s format, scanf will read this as 3 separate words, not...
6 May 2021 by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32
4 May 2021 by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
25 Apr 2021 by honey the codewitch
Explore the basic drawing functionality provided by the GFX IoT library
25 Apr 2021 by OriginalGriff
That's not a "first program" in C at all - it's miles from the traditional "Hello World!" app we all started with. And while we are more than willing to help those that are stuck: that doesn't mean that we are here to do it all for you! We...
25 Apr 2021 by Patrice T
Quote: I did not take an introductory course or anything like that so please help. If your claim is true, the only answer is a fail, any other answer is a cheat. More or less, you are requested to win a formula 1 GP before learning to drive a...
25 Apr 2021 by Richard MacCutchan
Quote: nothing because i know nothing. Then I am afraid you will need to start learning. See C Tutorial - Tutorialspoint[^].
17 Apr 2021 by honey the codewitch
GFX IoT graphics library part 2 - device independent bitmaps
14 Apr 2021 by Angelo Cresta
An extension of "A control to display pie charts with highly customizable formatting" from mattsj1984 that also renders doughnut.
11 Apr 2021 by honey the codewitch
A device independent graphics library for IoT devices. Part 1 of a series.
10 Apr 2021 by Myra 2021
hello i want to try draw alphabet in java 2D graphics to learn about it. but i could not know from where should i start. can anyone show me example for how it work? What I have tried: i try looking in internet but i can't find anything help me...
10 Apr 2021 by Richard MacCutchan
Trail: 2D Graphics (The Java™ Tutorials)[^]
7 Apr 2021 by Member 15136972
I'm working on a project called treasure hunt game board, where we have to make a 10x10 2d array and there will be 5 treasures and 5 pirates. Whenever the player encounters a treasure, they gain 100, then if they encounter the second one, they...
5 Apr 2021 by Member 15136972
Have a 2 dimensional non-empty array (Map) 10x10 . The array contains integers in the range 0 - 99. But I can't seem to figure out how to make it do anything other than 1-10 on each line * The first clue is in the first column of the first...
5 Apr 2021 by Dave Kreskowiak
Write it out on paper, with row and column 1 in the top left corner. Write your values out for each row and each column. It should become obvious what the formula for calculating each value at each row and column should be. 10 rows and 10...
2 Mar 2021 by Tomaž Štih
Sometimes you need to draw a simple glyph.
7 Feb 2021 by g96b10
Win2D provides a neat API interface, but how do you render complex sprites for your game? I provide a library and editor to make this a streamlined process.
4 Jan 2021 by Richard MacCutchan
Most likely you are just copying references from the temp array into the main one, so as soon as you clear the temp array, the row in the main array gets cleared. You need to do deep copying of the actual data from the temp array into the main...
29 Dec 2020 by IgorRadionyuk
An iterator over parametric function, which is a well known mathematical abstraction: Parametric Function. It maps interval of real numbers[start, stop] to some values in the range of function.
25 Nov 2020 by Richard MacCutchan
Sorry, this site is not here to do your homework. If you really cannot do this the you need to discuss your problem with your teacher.
6 Jul 2020 by Marijan Nikic
An animated random string selection wheel class written in Java AWT
9 Jun 2020 by Richard MacCutchan
print(accounts.read()) # this reads all the lines from your file, but you don't save the result print(Username, "1") for row in accounts: # there is nothing to read now, since it has all been read above Remove the line print(accounts.read())...
9 Jun 2020 by DarkJoker666
I am doing a project for a university course to create a banking app using python. This requires a login and the data to be stored in a CSV. The issue I have is to iterate through the 2D array that has data from the csv. Through my debugging the...
24 May 2020 by User 5250478
Application to show how to zigzag order a matrix
17 May 2020 by Christian Graus
A 3D scene has more data so you can't take a 2D scene and automatically make it 3D. You could GUESS the depth of objects but you can't be sure. You can GUESS their thickness in different points, but you can't be sure.
17 May 2020 by User 14475602
I have made a puzzle in 2d scene and now I want to put it in complete 3d scene. Is that even possible? How can I do that? In 3d scene, I want to put it where is visible and the player can access it with key on keyboard or somehow like that. Put...
21 Feb 2020 by Richard MacCutchan
Then you need to do some more research. In the meantime I suggest you also take a look at Code Project Quick Answers FAQ[^] to see how to post a question.
30 Jan 2020 by Richard MacCutchan
java.lang.RuntimeException: Duplicate class com.unity3d.ads.BuildConfig found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class com.unity3d.ads.IUnityAdsListener found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class...
30 Jan 2020 by Oleg Pruh
Hi, I work in Unity 2018.4.16f1 (64-bit). Today I had to build my project in Grudle, but there is a problem. Help me as soon as possible. Please do not write much, but to understand, you can write a solution step by step. 1 exception was raised by workers: See the Console for details. ...
22 Jan 2020 by phil.o
Trying to write anything at the root of a drive will be problematic on any recent Windows version; better create a directory on the D: drive and write your files in it instead.
22 Jan 2020 by Oleg Pruh
Hi, I'm Oleg. Today I want to build a progect in Unity 2017.4.36f1 (64-bit) and then me in the Colsole appeared Error about UnauthorizedAccessException: Access to the path "D:\" is denied. Please HELP me with that problem. More information you can see here. UnauthorizedAccessException: Access...
22 Jan 2020 by OriginalGriff
We can't help you. We don't have access to your code, or your data, or your system: so we have no idea what kind of access you are trying to get to the root of drive D:, or even that D: exists on your computer. Probably it does exist: the error message is telling you that your application (or...
22 Jan 2020 by F-ES Sitecore
Ensure your account has access to the D;\ drive. If you are creating a project directly in the root of the D drive, or have anything that creates files in the root of the D drive then make sure it doesn't, always work in sub-folders and sometimes access to the root can be blocked. If you don't...
23 Sep 2019 by Terence Wallace
A continuing series demonstration of Finite State Machines (FSM) where agents inhabit a small town called WestWorld.
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
22 Aug 2018 by Member 13958396
This is my first time doing matlab and I've never coded before. This was a compulsory Uni paper that I have had to take. Prior to this task I've managed to complete various other tasks but this is challenging me beyond what I've learned in the last three weeks. This is what ive got down so far...
22 Aug 2018 by Vincent Maverick Durano
READ: Programming Problems and Finding Solutions[^] PS: Adding those exclamation marks on the subject line suggests you are late with your homework, it's rude and no one is interested in that. If you want us to help you, then start doing something by yourself. Show us what you've tried and...
22 Aug 2018 by Member 13958388
SOMEONE PLEASE HELP ME SOLVE THIS?!?!?!?! SelectKRandomPointsPurposeSelectKRandomPoints generates a list of k randomly selected pixelsfrom an image. Input(s):It takes twoinputs in the following order: 1)A 3D image array from which to select points from 2)The number of points to randomly...
22 Aug 2018 by Patrice T
So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing. We do not do your HomeWork....
22 Aug 2018 by Patrice T
Quote: SOMEONE PLEASE HELP ME SOLVE THIS?!?!?!?! The help you want is us doing your homeWork. You show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve...
18 Jul 2018 by Michael Moroz
This articles describes how to open SVG files in C++ application, work with Bezier curves and export to PDF.
1 Jun 2018 by oleg63
Hi,How can I convert 2D array of C# objects(saMatrix) to 2D double array (dArray)?Thanks.Int32 iDim = 3;object saMatrix = null;- saMatrix {object[3, 3]} object {object[,]} [0, 0] 11.0 object {double} [0, 1] 12.0 object {double} [0, 2] 13.0 object {double} [1,...
2 May 2018 by Patrice T
Quote: Why is the conditional (highlighted in the code below) detecting a match for values that are NOT defined in the initialized 2d array ....? Because in C/C++, 'NOT defined' does not exist. Because C/C++ is unchecked, you are responsible of ensuring that you always access valid positions in...
2 May 2018 by john ztech
//initialization int validtracks[17][2] = {{1,1}, {1,3}, {1,6},{2,3},{2,6},{3,4},{3,6},{3,8}, {4,2},{4,3},{4,7},{5,3},{5,5},{6,1}, {6,3},{7,1},{7,3}}; //main code while (matchtrack == 0) { rndint = rand() % 7 + 1; for (int r = 1; r
15 Apr 2018 by Patrice T
Quote: but using function 'myellipse' makes the animation very slow You want to improve speed, that process is named 'optimization', the tool that help you to spot bottle necks is the profiler. Profiling (computer programming) - Wikipedia[^] Optimization is about being critical about your...
15 Apr 2018 by Member 13151067
Iam trying to draw an ellipse that don't move in my project and i use animation in this project but using function 'myellipse' makes the animation very slow this is the code to draw ellipse What I have tried: This is the code to draw an ellipse void myEllipse(int x,int y,float StAngle,float...
9 Apr 2018 by gintack
C++ header file to plot data in the form of x, y, z arrays and list as potential lines and graphs
25 Feb 2018 by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
29 Jan 2018 by Arav Singhal
The basics of spaces, transformations and bodies used in a 2D physics engine.
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
10 Jan 2018 by Member 11278731
i have to ZOOM-IN & ZOOM-OUT 2D-graphics like (line, Rectangle, circle) which i have draw on winform. I am not used any picture box, panel. I crated simple program to draw circle & on button click try to zoom but it showing error "parameter is not valid" in method Drawing() @ Line-...
14 Dec 2017 by Member 13576973
String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String LuckyCard; for (int r = 0; r
14 Dec 2017 by Patrice T
Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spoting structures mistakes. String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String...
14 Dec 2017 by User 7407470
In this case you should not use a 2d array, but just two arrays: String[] suits = {"Spades","Diamonds","Hearts","Clubs"}; String[] cards = {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King"}; int cardLucky = (int)(Math.random() * 13); int suitLucky = (int)(Math.random() * 4); ...
27 Nov 2017 by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
20 Oct 2017 by petter2012
Hi, I am creating a game engine for WPF. I am trying to move away from DispatcherTimer to StopWatch, to get a more constant speed of the game (as DispatcherTimer skips turns if there are too many objects in the game). I can write the code for updating the game correctly using a StopWatch (that...
20 Oct 2017 by petter2012
I found an answer working with a colleague of mine. Check here for answer: Adding an eventhandler (compositiontarget.rendering) in WPF[^]
3 Oct 2017 by BouncyTarget
This is an article about making 2D sprites in Windows Forms.
29 Jul 2017 by Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
25 Jul 2017 by PepperDepper
Could you please make a GameBoard with a 6x6 area out of tiles that is similar to a chess board Game but with a character that can move around on only the inner 5x5 area? I need this for one of my projects but im still new to programming and need help to start. So it would be awesome if you...
25 Jul 2017 by CPallini
What's wrong with Google? Have a look, for instance, at this page: Java 2D games tutorial - programming Java games[^].
25 Jul 2017 by Richard MacCutchan
See The Java Tutorials[^]
25 Jul 2017 by ShantanuKulkarni3
Introduction to WPF DrawingContext api
25 Jul 2017 by Dave Kreskowiak
No, this site is not a code-for-hire service. You're looking for Freelancer.com. Get out your credit card.
18 Jul 2017 by Santhosh1217
I drawn a path(using coordinates of selecting area) in the panel.In this I want to display the values while hovering on the panel path.How will I do this? Please Help Me ! What I have tried: points1.Add(new Point(Convert.ToInt16(x), Convert.ToInt16(y))); Pen p = new Pen(Color.Blue, 2);...
18 Jul 2017 by Ralf Meier
An example for this could be : using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; public class myPanel : Panel { public List ClickPoints { get { return myClickPoints; } set { myClickPoints = value; } } private...
10 Jul 2017 by Voevudko A. E., Ph.D.
Demonstrating ability of the L-system in R, and offering helper functions able to plot all main categories of figures typical for the 2D L-system.
4 Jun 2017 by Member 10610621
Guys below is my Code for My PlaycontrollerScript and PlatformMover script what i am trying to achieve here is i want when my player jump on the platform that particular group of platform to go down ,basically like doodle jump ,but as i am doing something wrong here platform groups are spawning...
10 May 2017 by Raghavendra Hosad
2D DFT for Color Image - GUI implementation
21 Feb 2017 by Cuber01
I am working on a 2D Platformer and I am tring to add mobile controlsI am trying to make it so when you touch on the joystick the player will start shooting.What I have tried:I tried to change all of the input.getAxsis with CrossPlatformInputManger.getAxsis but all it did was make me...
9 Jan 2017 by Jack Xu, USA
This article demonstrates how to convert the WinForm version of the Microsoft chart control into a WPF and MVVM compatible chart control and how to use it to create various charts in a WPF application.
5 Jan 2017 by Andre van Dun
Graphviz graphs from dot specification
10 Nov 2016 by Miguel Diaz Kusztrich
An application to draw Recurrence Plots and calculate recurrence quantification measures
20 Sep 2016 by Kenneth C. Santiañez
In this program, the user should be the one to input the row and column of the queen on every iteration and fortunately I managed to do that. The problem is that, on every iteration of the queen, there should be a function that will check whether the row and column is safe to place or not. The...
20 Sep 2016 by PeejayAdams
You're trying to do three things at once which is never a good idea.You essentially need to know the answer to three questions:Is there a queen in the same column?Is there a queen in the same row?Is there a queen on a diagonal?The best approach is to write separate methods for...
20 Sep 2016 by Patrice T
We do not do your HomeWork.HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot...
17 Sep 2016 by Rajesh Londhe
Face alignment rotation to improve face recognization
25 Aug 2016 by Mr. xieguigang 谢桂纲
Manhattan plot in VisualBasic, application of the cross platform VisualBasic in the data science
23 Aug 2016 by HitsRathod, Sneha Palve
Easily export chart.js charts in image formats
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
1 Jul 2016 by Tomaž Štih
Size the child rectangle so that it fits into given parent rectangle, without distorting it
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
20 Jun 2016 by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
20 Jun 2016 by The Zakies
Learn how to implement a tecnique of a parent form that createes and controls other forms , through the tecnique of using the tab control, also learn how to implement a menu for the tools, and how to add cutom cursor for each tool
15 Jun 2016 by deXo-fan
Hi,My friend is sitting next to me playing a game called Terraria, and while it is 2D the graphics are quite advanced.So my question is this: If I wanted to make a similar game, 2D with complicated graphics that involve shadows and light sources and translucency and so forth, would GDI...
15 Jun 2016 by roks nicolas
well gdi will be slower than opengl, because it s only software rendering.In my opinion... you should use SDL if you want to make your own 2d engine... but you can find actualy 2d engine already made and "just" code the game..... making a 2d engine is already a pretty dawn task...