<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=006375903-13102009><FONT face=Arial
color=#0000ff size=2>Dunno about the pngs.</FONT></SPAN></DIV><SPAN
class=006375903-13102009>
<DIV dir=ltr align=left><BR><FONT face=Arial color=#0000ff size=2>Feel free to
send him my way directly if he has more questions...</FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left></SPAN><SPAN class=006375903-13102009><FONT face=Arial
color=#0000ff size=2>C.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Robert
martin<BR><B>Sent:</B> Tuesday, 13 October 2009 4:41 p.m.<BR><B>To:</B> NZ
Borland Developers Group - Delphi List<BR><B>Subject:</B> Re: [DUG] Image
manipulation<BR></FONT><BR></DIV>
<DIV></DIV>Nice !<BR><BR>I had read that since GraphicsEx loads images as
bitmaps you lost some of the advanced features of the image format. Do you
know if png files retain their transparencies?<BR><BR>This all looks very
promising. I will forward this on to the man doing the work
:)<BR><BR>Rob<BR>
<DIV class=moz-signature>
<META content=Word.Document name=ProgId>
<META content="Microsoft Word 11" name=Generator>
<META content="Microsoft Word 11" name=Originator><LINK
href="Robert%20Martin_files/filelist.xml" rel=File-List><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Wild Software Ltd</o:Author>
<o:LastAuthor>Wild Software Ltd</o:LastAuthor>
<o:Revision>6</o:Revision>
<o:TotalTime>55</o:TotalTime>
<o:Created>2009-02-13T02:47:00Z</o:Created>
<o:LastSaved>2009-02-13T03:42:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>13</o:Words>
<o:Characters>77</o:Characters>
<o:Company>Wild Software Ltd</o:Company>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>89</o:CharactersWithSpaces>
<o:Version>11.9999</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:Break
WrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<STYLE>@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; mso-paper-source: 0; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
SPAN.SpellE {
        mso-style-name: ""; mso-spl-e: yes
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
<DIV class=Section1>
<P class=MsoNormal><SPAN lang=EN-NZ><O:P><BR> </O:P></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-NZ
style="COLOR: rgb(255,153,0)"><O:P></O:P></SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-NZ><O:P></O:P></SPAN></P></DIV></DIV><BR><BR>Conor Boyd wrote:
<BLOCKQUOTE
cite=mid:F7C0AA5DD1508F4789E10B6CC9BB75DB02CE75F4@nzc-ap-xch-02.ap.trimblecorp.net
type="cite">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>Yeah, those issues are what drove my choice of
Graphics32 (image quality and scaling).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>Here's some code which uses Graphics32 to resample an
image.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>OldBitmap, TempBitmap are of type
Graphics32.TBitmap32</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>NewBitmap is of
type Graphics.TBitmap;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2> OldBitmap.Assign(a regular Graphics.TBitmap here
which you could load using GraphicEx);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2> TempBitmap := TBitmap32.Create;<BR>
try<BR> TempBitmap.Width := Trunc(OldBitmap.Width *
Scale);<BR> TempBitmap.Height := Trunc(OldBitmap.Height *
Scale);</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2> rs :=
TKernelResampler.Create(OldBitmap);</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2> if FastResamplingWanted
then<BR> rs.Kernel :=
THermiteKernel.Create<BR>
else<BR> rs.Kernel :=
TLanczosKernel.Create;</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>
GR32_Resamplers.StretchTransfer(TempBitmap,<BR>
Rect(0, 0, TempBitmap.Width,
TempBitmap.Height),<BR>
Rect(0, 0, TempBitmap.Width,
TempBitmap.Height),<BR>
OldBitmap,<BR>
Rect(0, 0, OldBitmap.Width,
OldBitmap.Height),<BR>
rs, dmBlend, Nil);</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>
NewBitmap.Assign(TempBitmap);<BR> finally<BR>
TempBitmap.Free;<BR> end;<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>I've paraphrased this from some code of mine, but
hopefully that's the gist of a high-quality resample for you using
Graphics32.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=821502303-13102009><FONT face=Arial
color=#0000ff size=2>Conor</FONT></SPAN></DIV><BR>
<P><FONT face=Arial size=2>[snip]</FONT> </P></BLOCKQUOTE></BODY></HTML>