Xojo Conferences
XDCMay2019MiamiUSA

[MBS] Trouble with large images and CGContextMBS.DrawPicture (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] WIA Event Identifiers
Next thread: Re-2: [MBS] Picture management Win without Quicktime / WMF


Re: [MBS] MBS Icon Routines redefined?   -   Garth Hjelte
  [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Peter Truskier
   Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Peter Truskier
   Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Christian Schmitz
   Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Christian Schmitz
   Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Peter Truskier
   Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture   -   Christian Schmitz

[MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 00:18 (Thu, 28 Apr 2011 16:18:13 -0700)
From: Peter Truskier
Hi,

I am trying to place several pictures into a PDF page using
CGContextMBS.DrawPicture. My code (derived from the MBS example
project "Create PDF With Picture.rbp") works just fine with pictures
up to a certain size. Above that size, the PDF still is created, and
some raster images do get drawn, but they are just a bunch of
apparently random horizontal lines - in other words, "all messed up."
I am using CGCreateImageMBS to convert an RS picture to a CGImageMBS.

I'm not sure exactly what the threshold values are, but I can say that
a 2376 X 4000 pixel image renders correctly, while a 3300 X 5500
version of the same image is scrambled. I have tried scaling down the
size of the CGRectMBS into which I am drawing the image, but this does
not matter - it is something having to do with the absolute pixel
width/height/or area of the images themselves.

Am I doing something wrong? If not, do you know what the limitation is?

Thanks,

Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 20:55 (Fri, 29 Apr 2011 12:55:50 -0700)
From: Peter Truskier
Yes; my quick testing confirms.

On Apr 29, 2011, at 11:27 AM, Christian Schmitz wrote:

> Hi,
>
> I think I fixed the CGImageMBS problem for 11.1 plugins :-)
>
> Greetings
> Christian
>
> --
> See you in Essen, Germany at the REAL Studio Conference 2011
>
> Registration and details here:
> http://www.realsoftware.de/events/realcon2011essen/
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> <email address removed>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 19:27 (Fri, 29 Apr 2011 20:27:14 +0200)
From: Christian Schmitz
Hi,

I think I fixed the CGImageMBS problem for 11.1 plugins :-)

Greetings
Christian

Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 17:09 (Fri, 29 Apr 2011 18:09:28 +0200)
From: Christian Schmitz

Am 29.04.2011 um 18:02 schrieb Peter Truskier:

> I've just simulated the problem by drawing your MBSLogo into a 5000 X
> 5000 RB picture, and then placing that in an appropriately sized PDF
> page. The RB picture is fine, but the CGImageMBS is corrupt.

Can you send me a copy of that project offlist?

Greetings
Christian

Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 17:02 (Fri, 29 Apr 2011 09:02:52 -0700)
From: Peter Truskier
That's not the problem as I am able to properly display the RB Picture
in an RB Canvas control - actually can do so with MUCH larger pictures.

Our app allows users to rasterize PDFs at resolutions up to 300 ppi
(which we do using your plug-ins), and we have never had a complaint
about this sort of corruption even on PDFs up to 75 inches (75 X 300 =
22,500). At some point, RS does fail to be able to create the picture,
but the limitation is WAY higher than what we are running into here.

The feature I am trying to implement now is to create a PDF containing
the results of that rasterization. I could try writing a file to disk
before creating the CGImageMBS, but it would be a shame to have to do
so since the image exists only in memory at the moment.

I've just simulated the problem by drawing your MBSLogo into a 5000 X
5000 RB picture, and then placing that in an appropriately sized PDF
page. The RB picture is fine, but the CGImageMBS is corrupt.

--pt

On Apr 29, 2011, at 12:02 AM, Christian Schmitz wrote:

>
> Am 29.04.2011 um 01:18 schrieb Peter Truskier:
>
>> Hi,
>>
>> Am I doing something wrong? If not, do you know what the limitation
>> is?
>
> I think the RB Picture class has limits. Something like 4000 Pixels.
>
> You could try with CGCreateImageFromPNGDataProviderMBS or
> CGCreateImageFromJPEGDataProviderMBS to workaround that.
>
> Greetings
> Christian
>
> --
> See you in Essen, Germany at the REAL Studio Conference 2011
>
> Registration and details here:
> http://www.realsoftware.de/events/realcon2011essen/
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> <email address removed>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Trouble with large images and CGContextMBS.DrawPicture
Date: 29.04.11 08:02 (Fri, 29 Apr 2011 09:02:37 +0200)
From: Christian Schmitz

Am 29.04.2011 um 01:18 schrieb Peter Truskier:

> Hi,
>
> Am I doing something wrong? If not, do you know what the limitation is?

I think the RB Picture class has limits. Something like 4000 Pixels.

You could try with CGCreateImageFromPNGDataProviderMBS or CGCreateImageFromJPEGDataProviderMBS to workaround that.

Greetings
Christian