Any solution to RasterException: Invalid parameter passed? (While converting RasterImage to Bitmap)
<p>i am developing an android app and trying to convert a RasterImage to Bitmap Image in order to draw a line with given points. but i am getting an exception on conversion. i am using LEADTOOLS DICOM SDK Version 18 For this. below is the code i am using</p>

<pre><code>private void drawingfunction(float x, float y, float xend, float yend, int color) {
    try{
         RasterImage _loadedImage;
         RaterImageViewer secondviewer;
         Bitmap newpic;
         newpic=RasterImageConverter.convertToBitmap(_loadedImage2, ConvertToImageOptions.NONE.getValue());
         newpic = Bitmap.createBitmap(_loadedImage2.getWidth(), _loadedImage2.getHeight(), Config.ARGB_8888);
         Canvas c = new Canvas(newpic);
         c = new Canvas(newpic);
         secondviewer.draw(c);
         Paint p = new Paint();
         p.setColor(color);
         c.drawLine(x, y, xend, yend, p);
         secondviewer.setImageBitmap(newpic);
        }
        catch(Exception ex)
        {
           Toast.makeText(getApplicationContext(),ex.toString(),Toast.LENGTH_SHORT).show();
        }
}
</code></pre>