JavaFX ImageView without any smoothing -


is possible render scaled image in imageview in javafx 2.2 without smoothing applied? i'm rendering 50x50 image 200x200 imageview, setsmooth(false), each pixel in source image should map 4x4 square on screen.

however, resulting render still smooths source pixel across 16 destination pixels. know of way without manually copying on each pixel new image?

in javafx 2.2 imageview going smoothing regardless of smooth hint provide imageview.

(based on testing using java 7u15 , windows 7 ati hd4600 graphics card).

perhaps bug imageview smooth image, documentation doesn't specify smoothing or doesn't do, it's hard real intent is. may want post reference question openjfx-dev mailing list or log issue in javafx issue tracker more expert opinion developer.


i tried few different methods scaling image:

  1. scale in image constructor.
  2. scale in imageview fitwidth/fitheight.
  3. scale using scalex/scaley properties on imageview.
  4. scale sampling image pixelreader , creating new image pixelwriter.

i found methods 1 & 4 resulted in sharp pixelated image wish , 2 & 3 resulted in blurry aliased image.

robot-sampling

sample code generate above output.


update ideas on implementing own image filter

a javafx effect not same filter used image loading routines, though effect filter image created. in javafx 2.2 publicly documented api support creation of custom effects, creating of custom effect may prove difficult.

the native code image support open sourced part of openjfx project, @ see how filtering implemented.

you may want file feature request against javafx runtime project "allow make our own 2d filters".


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -