Re: [Ikvm-developers] Converting .NET Bitmap to Java BufferedImage
Brought to you by:
jfrijters
|
From: AngelSL <hwt...@gm...> - 2009-04-25 04:21:27
|
That class/method doesn't exist. However, I have solved the problem by using
a pixel-by-pixel copy:
(This is C#)
private static BufferedImage getBIFB(Bitmap c)
{
java.awt.image.BufferedImage bi = new BufferedImage(c.Width,
c.Height, java.awt.image.BufferedImage.TYPE_INT_ARGB);
for (int a = 0; a < c.Width; a++ )
{
for (int b = 0; b < c.Height; b++)
{
bi.setRGB(a, b, c.GetPixel(a, b).ToArgb());
}
}
return bi;
}
Volker Berlin wrote:
>
> Hi,
>
> You can cast the default toolkit to ikvm.awt.IkvmToolkit and then call
> public java.awt.Graphics2D createGraphics(cli.System.Drawing.Bitmap
> bitmap);
>
> Volker
>
>
>> -----Ursprungliche Nachricht-----
>> Von: AngelSL [mailto:hwt...@gm...]
>> Gesendet: Dienstag, 14. April 2009 16:24
>> An: ikv...@li...
>> Betreff: [Ikvm-developers] Converting .NET Bitmap to Java
>> BufferedImage
>>
>>
>> I'm trying to use a java library to encode animatedGIF/APNG.
>> (.NET doesn't
>> have any).
>>
>> However, I can't find a way to convert them to a BufferedImage (or
>> Raster/Image works too).
>>
>> Does anyone know how I should do this?
>> --
>> View this message in context:
>> http://www.nabble.com/Converting-.NET-Bitmap-to-Java-BufferedI
>> mage-tp23040428p23040428.html
>> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>>
>>
>> --------------------------------------------------------------
>> ----------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> Ikvm-developers mailing list
>> Ikv...@li...
>> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>>
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Ikvm-developers mailing list
> Ikv...@li...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>
>
--
View this message in context: http://www.nabble.com/Converting-.NET-Bitmap-to-Java-BufferedImage-tp23040428p23228361.html
Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
|