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


Groups > comp.lang.clipper.visual-objects > #11497 > unrolled thread

Fabpaint Composite()

Started by"Paul D B" <pdb@NOMORESPAMhnt.be>
First post2018-03-15 09:17 +0100
Last post2018-03-15 11:40 +0100
Articles 4 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  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

#11497 — Fabpaint Composite()

From"Paul D B" <pdb@NOMORESPAMhnt.be>
Date2018-03-15 09:17 +0100
SubjectFabpaint Composite()
Message-ID<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 

[toc] | [next] | [standalone]


#11498

From"Paul D B" <pdb@NOMORESPAMhnt.be>
Date2018-03-15 09:46 +0100
Message-ID<p8dbsr$ms7$1@dont-email.me>
In reply to#11497
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 

[toc] | [prev] | [next] | [standalone]


#11503

FromArne Ortlinghaus <Arne.Ortlinghaus@acs.it>
Date2018-03-15 11:27 +0100
Message-ID<p8dhpq$1c87$1@gioia.aioe.org>
In reply to#11498
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

[toc] | [prev] | [next] | [standalone]


#11504

From"Paul D B" <pdb@NOMORESPAMhnt.be>
Date2018-03-15 11:40 +0100
Message-ID<p8diiu$1j2$1@dont-email.me>
In reply to#11503
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 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web