Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11504

Re: Fabpaint Composite()

From "Paul D B" <pdb@NOMORESPAMhnt.be>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Fabpaint Composite()
Date 2018-03-15 11:40 +0100
Organization A noiseless patient Spider
Message-ID <p8diiu$1j2$1@dont-email.me> (permalink)
References <p8da7o$dle$1@dont-email.me> <p8dbsr$ms7$1@dont-email.me> <p8dhpq$1c87$1@gioia.aioe.org>

Show all headers | View raw


Hi Arne,

great! I hadn't seen that PasteSubImage function. Yes this should do the 
trick.

So many thanks!

Paul
"Arne Ortlinghaus"  schreef in bericht news:p8dhpq$1c87$1@gioia.aioe.org...

Hi Paul,

I have used something similar to resize images

oimage := IVarGet(odcgrafikori, #oGraphicscontrol):Image
if lsize .or. (nwnew > 0 .and. nhnew > 0 .and. (nwnewfirst<> nwnew) .or.
(nhnewfirst<> nhnew))
    oimageback := FabPaintLib{}
    oimageback:Create( nwnewfirst, nhnewfirst, 32, false)
    oimageback:invert()
    oimageback:PasteSubImage(oimage, 0, 0)
    if nwnew > 0 .and. nhnew > 0 .and. ((nwnewfirst<> nwnew) .or.
(nhnewfirst<> nhnew))
       oimageback:ResizeBilinear(nwnew, nhnew)
    endif
else
    oimageback := oimage:Copy(0)
endif
if frotate <> 0
    oimageback:RotateDeg(frotate, dword (RGB(255,255,255)))
endif


Paul D B wrote:
> Have looked at the FreeImage docs and the composite() method is NOT what I 
> need. I would need the EnlargeCanvas that is part of FreeImage 3.17
>
> FreeImage_EnlargeCanvas DLL_API FIBITMAP *DLL_CALLCONV 
> FreeImage_EnlargeCanvas(FIBITMAP *src, int left, int top, int right, int 
> bottom, const void *color, int options); Enlarges or shrinks an image 
> selectively per side and fills newly added areas with the specified 
> background color.
>
> However I do not know if it was already present in the FreeImage Lib that 
> Fabrice used when he build Fabpaint (2008 !!) ? And anyway he did not make 
> any function for it so I'm stuck.
>
> Paul
>
> "Paul D B"  schreef in bericht news:p8da7o$dle$1@dont-email.me...
>
> Hi all,
>
> anyone ever used the Fabpaint composite() method and would be so kind to
> share some code that shows me how to use it?
>
> But frankly I don't even knowo if this method does what I need (Fab docs 
> say
> "- Added DIBComposite() to composite a foreground image against a 
> background
> color or a background image" )
>
> What I need to do: I have images (JPG files) in mixed orientation 
> (portrait
> or landscape). I want to recreate them on a white background in a square
> shape of a fixed size.
>
> (for those who know Photoshop:  "Change Canvas size" ).
>
> So I would end up with square image files with whitespace above/below the
> picture for the landscape ones, and whitespace left/right for the portrait
> ones.
>
> Any ideas would be welcome.
>
>
> Paul 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Fabpaint Composite() "Paul D B" <pdb@NOMORESPAMhnt.be> - 2018-03-15 09:17 +0100
  Re: Fabpaint Composite() "Paul D B" <pdb@NOMORESPAMhnt.be> - 2018-03-15 09:46 +0100
    Re: Fabpaint Composite() Arne Ortlinghaus <Arne.Ortlinghaus@acs.it> - 2018-03-15 11:27 +0100
      Re: Fabpaint Composite() "Paul D B" <pdb@NOMORESPAMhnt.be> - 2018-03-15 11:40 +0100

csiph-web