Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Draw a point or a dot.  (Read 3876 times)
0 Members and 1 Guest are viewing this topic.
Offline AdRocks

Junior Newbie

« Posted 2014-10-31 15:40:42 »

Could anyone explain me as to how to draw a dot on a JPanel?
Will, [fillRect(x,y,1,1)], this method draw a dot?
If no, please help me with this. Thank you.
Offline Riven

« JGO Overlord »

Medals: 1371
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #1 - Posted 2014-10-31 15:42:12 »

It will.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline SHC
« Reply #2 - Posted 2014-10-31 15:43:01 »

It will. By the way, why don't you test this?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline AdRocks

Junior Newbie

« Reply #3 - Posted 2014-10-31 15:50:10 »

Because i am away from my system, and coding with a pen and paper. And surprisingly realised, that i never tried such a thing ever before.
Offline Abuse

JGO Ninja

Medals: 72

falling into the abyss of reality

« Reply #4 - Posted 2014-10-31 16:50:02 »

From what I recall, drawLine(x,y,x,y) is the preferred way of drawing just a single pixel through the general purpose rendering pipeline.
Obviously if you're doing a lot of individual pixels, then you should bypass the pipeline, and manipulate an Image's Raster directly
Offline matanui159

JGO Coder

Medals: 11
Projects: 1
Exp: 10-12 months

Aww... So cute...

« Reply #5 - Posted 2014-10-31 23:18:45 »

Usually when I am away from my computer I just program on my iPad in pages (because I need an iPad for school although I would much prefer and Android Tablet)...
My handwriting is really messy but sometimes I have been desperate enough to write code in the sand at the beach...

And I wonder why I don't have any friends... (Kidding, i do, somehow...)

(This is a bit off topic tho...)

Is it sad that I still get a fright when the computer beeps at me...
Offline BurntPizza

« JGO Bitwise Duke »

Medals: 486
Exp: 7 years

« Reply #6 - Posted 2014-11-01 00:58:01 »

Uh, wrong thread matanui?
Offline CopyableCougar4
« Reply #7 - Posted 2014-11-01 00:58:48 »

Uh, wrong thread matanui?

I believe that he was referring to this:
Because i am away from my system, and coding with a pen and paper. And surprisingly realised, that i never tried such a thing ever before.


Either wandering the forum or programming. Most likely the latter Smiley

Offline BurntPizza

« JGO Bitwise Duke »

Medals: 486
Exp: 7 years

« Reply #8 - Posted 2014-11-01 01:03:28 »

Ha, alright, forgot about that. Just seemed so out of the blue.

And to at least contribute something to this thread:

get/set individual pixels in a bufferedimage:

int colorVal = image.getRGB(x, y);

colorVal = someColor.getRGB(); // includes any alpha
image.setRGB(x, y, colorVal);

Can be done faster in bulk via a trick, but that should set you on your way if you're ever using BufferedImage and need this.
Pages: [1]
  ignore  |  Print  

Riven (439 views)
2019-09-04 15:33:17

hadezbladez (5297 views)
2018-11-16 13:46:03

hadezbladez (2213 views)
2018-11-16 13:41:33

hadezbladez (5565 views)
2018-11-16 13:35:35

hadezbladez (1156 views)
2018-11-16 13:32:03

EgonOlsen (4592 views)
2018-06-10 19:43:48

EgonOlsen (5467 views)
2018-06-10 19:43:44

EgonOlsen (3128 views)
2018-06-10 19:43:20

DesertCoockie (4023 views)
2018-05-13 18:23:11

nelsongames (4741 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!