Aspose Imaging - Compact Framework

Hi,

I'm trying to use Aspose Imaging in a Compact Framework 3.5 application. I wrote this simple line of code and I get the following exception "Image Loading Failed".

My code is:

try

{

Aspose.Imaging.Image image = Aspose.Imaging.Image.Load("\\img.jpg");

}

catch (Exception exx)

{

MessageBox.Show(exx.Message);

}

Is this because CompactFramework is not supported ? Do I have to copy some redestributable files in the device ?

Looking forward to your kind reply.

Regards

KC

Hi KC,


I am afraid, Aspose.Imaging is not available for Compact Framework at the moment. But we are intended to provide this support in our future release. I have logged your request in our tracking system and connected this thread to the request id (31416). You will be notified automatically when this feature is available.

Thank you

Do you have planned a date for this new release ?

KC

Hi KC,


If you like we can provide you a Hot Fix, otherwise we have scheduled it with our next major release. Next release will be available in first week of next month.

Regards,

The issues you have found earlier (filed as 31416) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Thank you very much, good job! Now my code works without error.

Now I have to problem:

1. I'm not able to load the image in attach

2. I need to know how to display the loaded image on my HDC. I need a sort of BitBlt function.

Could you help me ?

Thank you in advance.

Regards

KCC

Hi KCC,


I can reproduce the loading issue with your provided PNG file. Also I have noticed that other PNG files [one is attached] can be loaded with out any problem. Therefore I have recorded an investigative ticket under Id 31783. We will probe further into this issue and will keep you posted with updates.

Regarding point 2), I’m sorry I am unable to understand your need. Can you please elaborate further?

Hi,

thank you very much for your quick answer.

My question is simple: I would like to use your library in a small CAD application for windows mobile devices. So I have an Handle Device Context of the form/window where I display my drawing; on this device context I have also to display the loaded image.

As I wrote I need a sort of BitBlt functions that allow me to display the loaded image on a form.

Is it clear now ? Otherwise, please contact me again.

Thank you in advance.

Regards

KCC

Hi KCC,


Thank you for providing us further details.

We have forwarded your request to our development team. As soon as we hear from them, we will update you here.

Regards,

Hi again,


Below is the source code for drawing Aspose Image over the required System.Drawing graphics. This code will work with all images except PsdImage.


///
/// Draws an Aspose image over the hdc surface.
///
/// The Aspose image.
/// The handle device context.

private void DrawImage(Aspose.Imaging.Image image, IntPtr hdc)

{

using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromHdc(hdc))

{

using (var gdiImage = Aspose.Imaging.Extensions.ImageExtensions.ToGdiImage(image))

{

graphics.DrawImage(gdiImage, 0, 0);

}

}

}



Hi,

thank you for the answer, the code works but ... I'm not fully convinced, because

- the method ToGdiImage, perform a copy, in memory, of the original image ? With big images this could be a problem.

- is it necessary to create a Graphics object ? Is not really possible to display the image directly on HDC ?

What do you think ? I'm looking for the fastes and efficient solution possible.

Thank you in advance.

Regards

KCC

Hi KCC,

No such API is available at the moment but a new issue to provide API to place the image directly on HDC in an efficient way has been logged into our issue tracking system as IMAGING-31867. We will keep you updated on this issue in this thread. Sorry for the inconvenience.

Please feel free to contact us in case you have further comments or questions.

Best Regards,

Do you have any news about ticket 31783 ?

Thank you.

Regards

KCC

Hi KCC,


We have requested our development team to provide updates on the ticket 31783. As soon as we receive any news, we will post it here for your reference.

Hi KCC,


Sorry for the delayed response on ticket Id 31783.

We currently use the System.Drawing assembly to load and process PNG files and there is no exact way to determine what happens behind the scenes. If there is some issue it is really complicated to determine the cause.

Currently the following exception is thrown while loading your provided PNG file:
System.OutOfMemoryException with the following stack trace:
at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
at System.Drawing.Bitmap._InitFromMemoryStream(MemoryStream mstream)
at System.Drawing.Bitmap…ctor(Stream stream)

We have planed to fully support the PNG on February release (ticket 27110). We have attached this thread with the new ticket so once the feature is available, you will be notified automatically.

Thank you for your patience.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.