Hello Christian,

After your last message saying it still did not have a higher resolution. I 
Tried a host of other things and found a alterative way.

I got this to work a different way, using xojo after trying a little bit of 
everything. The main objective here was to be able to set the dpi of the 
exporting image that was altered using Core Image using mbs complete core image 
plugin. The client for the application is a print company that needs images at 
certain dpi to work with there printing equipment. 

It was hard figuring what I needed to do, because there little info on how to 
do set the dpi resolution of a image being altered with ciimage. which lead me 
to Apple developer connect for answer because Core Image is a apple thing. 
Which does give ideas how to do it from there point of view. However using xojo 
offers many other possible routes, which can be confusing at least.

I also figure out how to get the CIImageMBS into a xojo picture witch ended up 
being simpler than I figured it was (as I did not see any info in the docs 
actually saying do this). What I ended up figuring out to get the ciimage to a 
xojo picture object (or what ever its actually called) The info does not really 
point this out, that this could be done this way. And maybe is not the correct 
way of doing it but it seems to work fine on 2 systems I tested it on.

----------

   // apply core image effect
  dim rpCIOutImg as CIImageMBS = rpCIEffect.outputImage
  
  //goofy way to do it but works & handles alpha if it present
  dim outImage as NSImageMBS = rpCIOutImg.RenderNSImage(false)
  dim pic as Picture = outImage.CopyPictureWithMask
  
  // changed this property to a picture object.
  pImgWMWorking=pic

————————

Then I used this because to xojo Picture.SaveAsTIFF fails to work in OSX 10.9.2 
and I needed to set the output to a size of 298.1dpi for run on press (web 
press) output file.
I tested it rounded up at 300 dpi.

——————
           
        dim np as picture = pImgWMWorking
        
           // Hard code for test
        np.VerticalResolution=300
        np.HorizontalResolution=300
        
        dim data as MemoryBlock = np.GetData( "public.tiff" )
        dim stream as BinaryStream = BinaryStream.Create(ffile)
        stream.Write( data )
        stream.Close()

—————

This worked with png, jpeg , tiff and also psd and pdf (not that I was figuring 
on using the last 2) including setting the dpi correctly.
My client needs Tiff format mainly but offered the others because they could 
use png and jpeg for position only low res proofing.

I wish all the bitmap image ways to write out a file be it nsimageMBS, 
cgimageMBS, graphicMagicMBS or others had a simpler solution for setting the 
dpi of the file being written. I not sure all solutions offer this but it would 
be nice if there was a cross-platform solution for this somehow. As the above 
works for us now, it still only works on Mac OSX.

Thanks for your time.

Regards,

Obleo Beck


On Feb 27, 2014, at 1:42 PM, Christian Schmitz <[email protected]> 
wrote:

> 
> Am 27.02.2014 um 18:14 schrieb Obleo Beck <[email protected]>:
> 
>> I see, ok.
>> 
>> Actual using PNG, JPEG and TIFF for NSImage writing.
>> Thanks for the info, I been trying more an more to figure out if it was 
>> something I missed in translating objective-c to xojo.
> 
> Well, the better code is like this:
> 
>  dim pImgWMWorking as Picture = LogoMBS(500)
>  dim bitmapImageRep as new NSBitmapImageRepMBS(pImgWMWorking)
> 
>  dim pew as double = bitmapImageRep.width
>  dim peh as double = bitmapImageRep.height
> 
>  // next two lines does same as nssize makeSize
> 
>  dim nsetW as double = ((72.0 * pew)/300.0)
>  dim nsetH as double = ((72.0 * peh)/300.0)
> 
>  // up to this point all values are the same as returned in objective-c code
> 
>  bitmapImageRep.setSize(nsetW,nsetH) // this does not seem to work ?
> 
> 
>  dim file as FolderItem = SpecialFolder.Desktop.Child("test.png")
>  dim b as BinaryStream = file.CreateBinaryFile("")
>  b.Write bitmapImageRep.PNGRepresentation
>  b.close
> 
> But the problem is that it does not work here. Image does not have higher 
> resolution.
> 
> (and you need next plugin version for this to test.)
> 
> Sincerely
> Christian
> 
> -- 
> Read our blog about news on our plugins:
> 
> http://www.mbsplugins.de/
> 
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> [email protected]
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to