Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > deep inside java

Reply
Thread Tools

deep inside java

 
 
Margus
Guest
Posts: n/a
 
      04-28-2004
Hi
At moment i'm searching solution for scaling chart picture in java without
loss. The speed in scrolling with lightweights seems ok. But problem is with
drawimage() the chart line gets fragmented if scaling with this function. I
use the direct 8 parameter version of drawimage. Any techniques or solution
to get over it.

If anybody has some reading or material about drawing and awt components in
lowlevel java and he can share it - it would be very big help.

Best Regards
Margus


 
Reply With Quote
 
 
 
 
Liz
Guest
Posts: n/a
 
      04-28-2004

"Margus" <(E-Mail Removed)> wrote in message news:408f7e92$(E-Mail Removed)...
> Hi
> At moment i'm searching solution for scaling chart picture in java without
> loss.


what you mean, without loss?

> The speed in scrolling with lightweights seems ok. But problem is with
> drawimage() the chart line gets fragmented if scaling with this function.

I
> use the direct 8 parameter version of drawimage. Any techniques or

solution
> to get over it.
>
> If anybody has some reading or material about drawing and awt components

in
> lowlevel java and he can share it - it would be very big help.
>
> Best Regards
> Margus
>
>



 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      04-28-2004
On Wed, 28 Apr 2004 12:51:13 +0300, "Margus" <(E-Mail Removed)> wrote or
quoted :

>At moment i'm searching solution for scaling chart picture in java without
>loss. The speed in scrolling with lightweights seems ok. But problem is with
>drawimage() the chart line gets fragmented if scaling with this function. I
>use the direct 8 parameter version of drawimage. Any techniques or solution
>to get over it.


Check out http://mindprod.com/jgloss/java2d.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Margus
Guest
Posts: n/a
 
      04-29-2004
Hi again

Well when this function resizes chart(making it smaller) . Some part of the
chart line will not be visible anymore this is because the function
automatically calculates the picture and scales it and the 1 pixel width
line will not be visible anymore. Any ways to get around from this.

I hope i explained it now more. Loss is really not very accurate

Margus

"Liz" <(E-Mail Removed)> wrote in message
news6Tjc.6895$RE1.785238@attbi_s54...
>
> "Margus" <(E-Mail Removed)> wrote in message

news:408f7e92$(E-Mail Removed)...
> > Hi
> > At moment i'm searching solution for scaling chart picture in java

without
> > loss.

>
> what you mean, without loss?
>
> > The speed in scrolling with lightweights seems ok. But problem is with
> > drawimage() the chart line gets fragmented if scaling with this

function.
> I
> > use the direct 8 parameter version of drawimage. Any techniques or

> solution
> > to get over it.
> >
> > If anybody has some reading or material about drawing and awt components

> in
> > lowlevel java and he can share it - it would be very big help.
> >
> > Best Regards
> > Margus
> >
> >

>
>



 
Reply With Quote
 
hondacivic@whoever.com
Guest
Posts: n/a
 
      05-08-2004
"Margus" <(E-Mail Removed)> wrote in message news:<40909ed3$(E-Mail Removed)>...

> automatically calculates the picture and scales it and the 1 pixel width
> line will not be visible anymore. Any ways to get around from this.


Not sure if this is what you mean: scaling a bitmap seems to drop
pixels completely.

This is what the default 'nearest neighbor' scaling algorithm does.
It's the fastest and simplest way of scaling a bitmap. It drops one
or more every one or more pixels.
Java has at least 2 other scaling algorithms as well: linear, and
bicubic.
In linear, what it does is for each pixel in the resulting bitmap, it
checks to see how much of the 4 pixels in the source it should sample
from. Not perfect, but a lot better than nearest neighbor, and still
pretty fast.
Bicubic is way better, but a little slower, although Java's
implementation has been optimized pretty darn well. What it does for
each pixel, which area of pixels from the source should influence the
outcome pixel. This means that if you scale a bitmap down a lot, for
each pixel in the resulting bitmap, it needs to scan a larger number
of pixels in the source bitmap, and calculate by weighted average each
resulting pixel.

What you should look at is in the paint(Graphics g), cast the g into a
Graphics2D, and call setRenderingHints on it.
You'll want to at least enable antialiasing, but probably also a few
other ones.
The quality goes way up for all sorts of things. Fonts, etc, it'll
all look a 1.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force an internal wire which is deep inside DUT hierachy attop level testbench using VHDL design? One Cent VHDL 7 09-10-2012 10:53 PM
Deep Freeze In Deep Trouble johntangelo@gmail.com Computer Security 3 10-25-2005 11:49 PM
DVD Verdict reviews: INSIDE DEEP THROAT, THE BELA LUGOSI COLLECTION, and more! DVD Verdict DVD Video 0 09-26-2005 08:18 AM
trouble handling java objects from inside java methods via C badduck Java 3 09-01-2005 05:20 AM
Dynamic temp. datagrid col.gen. -Session access inside a class inside a UserCtrl Andy Eshtry ASP .Net 0 03-01-2004 11:48 PM



Advertisments