<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — [Script] - Short guide to resizing images]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=2815</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=2815&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [Script] - Short guide to resizing images.]]></description>
		<lastBuildDate>Mon, 11 Jul 2022 14:49:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [Script] - Short guide to resizing images]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=45259#p45259</link>
			<description><![CDATA[<p>Да, это верно для бесплатных изображений. Я модифицирую их с помощью программного обеспечения для редактирования, смягчая края, это требует времени, но результат идеален, поэтому я сохраняю формат PNG.</p>]]></description>
			<author><![CDATA[null@example.com (Destiny)]]></author>
			<pubDate>Mon, 11 Jul 2022 14:49:34 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=45259#p45259</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] - Short guide to resizing images]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=45258#p45258</link>
			<description><![CDATA[<div class="quotebox"><cite>Destiny wrote:</cite><blockquote><p>I adapt the images to the color of my form so it looks like the background is transparent.</p></blockquote></div><p>That&#039;s right, it works well if the required transparency is 100%. But I was spoiled by free libraries with images of buttons with translucent elements, in PNG format. They look very good due to anti-aliasing, which is achieved by smoothly changing the transparency of the edge of the image.</p><p>I&#039;m currently working on responsive button images that will change color depending on the UI style chosen (active and passive button colors). Unfortunately, I will have to switch to the BMP format - only with it in MVDB it is possible to implement what I had in mind.</p>]]></description>
			<author><![CDATA[null@example.com (k245)]]></author>
			<pubDate>Mon, 11 Jul 2022 14:24:19 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=45258#p45258</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] - Short guide to resizing images]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=45253#p45253</link>
			<description><![CDATA[<p>I adapt the images to the color of my form so it looks like the background is transparent.</p>]]></description>
			<author><![CDATA[null@example.com (Destiny)]]></author>
			<pubDate>Mon, 11 Jul 2022 08:34:01 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=45253#p45253</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] - Short guide to resizing images]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=45252#p45252</link>
			<description><![CDATA[<p>Perfect solution! I take it in my piggy bank. It&#039;s a pity that in MVDB there is no full-fledged support for working with PNG format, so that transparency is not lost.</p>]]></description>
			<author><![CDATA[null@example.com (k245)]]></author>
			<pubDate>Mon, 11 Jul 2022 07:46:41 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=45252#p45252</guid>
		</item>
		<item>
			<title><![CDATA[[Script] - Short guide to resizing images]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=16795#p16795</link>
			<description><![CDATA[<p>Here is a quick tip for resizing images with MVD</p><br /><p>This works with jpeg, but you can easily adapt the code for whatever format you want. Just keep in mind that, for what I known now, if working with png you will loose the transparancy with this method.</p><br /><p>The code is commented, just drop that on a form with a button, correct the images paths and names (or better add an openfiledialog)</p><div class="codebox"><pre><code>procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    bmp : TBitmap;
    jpg : TJpegImage;
    scale : Double;
begin
    try
        //-----&gt; Create the jpeg
        jpg := TJpegImage.Create;
            try
                //-----&gt; assign a file to the jpeg
                jpg.LoadFromFile(&#039;.\test.jpg&#039;);
                    //-----&gt; if/else to find out which dimension is the larger and set size ratio - I chose 450 but
                    //you cna choose whatever you want
                    if jpg.Height &gt; jpg.Width then scale := 450 / jpg.Width else scale := 450 / jpg.Height;
                    //create the bitmap image
                    bmp := TBitmap.Create;
                        try
                            //-----&gt; define the size of the bitmap
                            bmp.Width := Round(jpg.Width  * scale);
                            bmp.Height := Round(jpg.Height * scale);
                            //-----&gt; resize the jpg by loading it into the bitmap with new dimensions
                            bmp.Canvas.StretchDraw(0,0,bmp.Width,bmp.Height, jpg);
                            //-----&gt; reassign the bitmpa to the jpeg
                            jpg.Assign(bmp);
                            //-----&gt; save the file
                            jpg.SaveToFile(&#039;.\test_thumb.jpg&#039;);
                        except
                            ShowMessage(ExceptionMessage);
                        end;
            except
                ShowMessage(ExceptionMessage);
            end;
    finally
        //Free all images
        bmp.Free;
        jpg.Free;
    end;
end;</code></pre></div><br /><p>Have fun all, this is what is really important after all !!</p><br /><p>Cheers</p><br /><br /><p>Mathias</p>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Sun, 23 Oct 2016 06:30:41 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=16795#p16795</guid>
		</item>
	</channel>
</rss>
