Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (854)
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  
  java2d drawImage confusion  (Read 694 times)
0 Members and 1 Guest are viewing this topic.
Offline zidsal

Senior Newbie





« Posted 2013-12-18 23:48:37 »

In my program I am drawing an image with

1  
g.drawImage(image, 32, 32,  96  , 96, 11, 0, 13, 2, null);


I would expect this to start drawing the part of the image specified at {11,0}, {13,2} in the location in my program at {32,32} and finish at {96,96} however it does not! the srcx and srcy results act normally and they do grab the image that they need to. However something is going wrong with the dcx and the dcy parameters

http://i.imgur.com/gw0qVAO.png

as we can clearly see for a start the image is 32 by 32 (I would expect a 64 by 64 square) and it is definitely not  being drawn from {32,32}  {96,96} can someone shed some light on whats going wrong?
Offline CodeHead

JGO Knight


Medals: 52


From rags to riches...to rags.


« Reply #1 - Posted 2013-12-19 02:05:52 »

as we can clearly see for a start the image is 32 by 32 (I would expect a 64 by 64 square) and it is definitely not  being drawn from {32,32}  {96,96} can someone shed some light on whats going wrong?

According to your posted code, your source area is only 3px x 3px {11,0}->{13,2}. Are you sure you're grabbing the entire area that you think you are? Other than that, the code seems like it's correct.

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Pages: [1]
  ignore  |  Print  
 
 

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

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

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

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

nelsongames (1104 views)
2018-04-24 18:15:36

nelsongames (1335 views)
2018-04-24 18:14:32

ivj94 (2075 views)
2018-03-24 14:47:39

ivj94 (1228 views)
2018-03-24 14:46:31

ivj94 (2170 views)
2018-03-24 14:43:53

Solater (794 views)
2018-03-17 05:04:08
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

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org 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‑gaming.org
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!