Moderators:TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
I am currently working on a Wrapper of your PDF document class. I want a method that extracts all images and returns a System.Drawing.Image Array.
Here is my Code:
private Image[] GetImagesFromContentItem(PDFXEdit.IPXC_Content content)
{
var imageList = new List<Image>();
PDFXEdit.IIXC_Page ip;
var items = content.Items;
for (uint j = 0; j < items.Count; j++)
{
var itemType = items[j].Type;
if (itemType == PDFXEdit.PXC_CIType.CIT_Image || itemType == PDFXEdit.PXC_CIType.CIT_InlineImage)
{
ip = items[j].Image_CreateIXCPage(false, PDFXEdit.PXC_RenderingIntent.RI_RelativeColorimetric);
uint hbitmap = ip.CreateHBitmap();
var ptr = new IntPtr(hbitmap);
imageList.Add(Bitmap.FromHbitmap(ptr));
DeleteObject(ptr);
}
if (itemType == PDFXEdit.PXC_CIType.CIT_XForm)
{
var xFormHandle = items[j].XForm_Handle;
var xForm = this.Document.GetXFormByHandle(xFormHandle);
var contentxForm = xForm.GetContent(PDFXEdit.PXC_ContentAccessMode.CAccessMode_WeakClone);
imageList.AddRange(GetImagesFromContentItem(contentxForm));
}
}
return imageList.ToArray();
}
The pertinent part is in the middle, where i create an hbitmap (which gives a uint) from a given IIXC_Page. Then i use it to get an Intptr, so that i can use Bitmap.FromHBitmap(Intpr pointer) to finally get my hands on the Bitmap.
The Problem is, that this Code leads to overflow exceptions, when i use the x86 dll.
Any Idea how i could resolve this issue?