Menu

#2 Pb to draw XImage loaded with GdiPlusImage

closed-fixed
nobody
None
5
2006-05-10
2006-02-17
aatchoumm
No

When i do:
XImage img = XImage.FromGdiPlusImage(myImage);
gfx.DrawImage(img, 10, 10);

there is a NullReferenceExcpetion...

I have dig and found in PdfImageTable li 94 that u used
ximage.path as id... But when i used FromGdiPlusImage
method ximage.path is null => badaboumm...

So i replace your code by another poor hack (lack of
time) and all work for me:

private static int idKey = 0;

/// <summary>
/// Initializes a new instance of ImageSelector
from an XImage.
/// </summary>
public ImageSelector(XImage image)
{
// HACK: just use full path to identify
if (image.path != null)
this.path =
image.path.ToLower(CultureInfo.InvariantCulture);
else
this.path = "id" + idKey++;
}

I hope i haven't go too speed and do a big mistake and
this will help you. Sorry too but i haven't patch tools
under hand...

have a good day.
Arnaud

Discussion

  • PDFsharp Team

    PDFsharp Team - 2006-05-10
    • status: open --> closed-fixed
     
  • PDFsharp Team

    PDFsharp Team - 2006-05-10

    Logged In: YES
    user_id=1359308

    Fixed in Beta 3

     

Log in to post a comment.

MongoDB Logo MongoDB