<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Trasparent text in AppGraphics]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=921</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=921&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Trasparent text in AppGraphics.]]></description>
		<lastBuildDate>Mon, 13 Nov 2023 12:52:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4256#p4256</link>
			<description><![CDATA[<p>Please send screenshots.&nbsp; But also be aware that the AppGraphics functions are trying to emulate Borland&#039;s BGI interface, not the Windows API.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 13 Nov 2023 12:52:29 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4256#p4256</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4238#p4238</link>
			<description><![CDATA[<p>I had thought that <strong>settextjustify</strong> is the right function. But I received so astonishing results that I prepared some simple tests. It seems an aligment and a justification are two different beasts.</p><p>The first example is a about horizontal aligment/justification. In SF the code is:</p><div class="codebox"><pre><code>    .....
    CALL settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 18)

    CALL settextjustify(LEFT_TEXT, BOTTOM_TEXT)
    CALL outtextxy(50, 50, &#039;Abcd-l&#039;)
    CALL settextjustify(CENTER_TEXT, BOTTOM_TEXT)
    CALL outtextxy(50, 70, &#039;Abcd-c&#039;)
    CALL settextjustify(RIGHT_TEXT, BOTTOM_TEXT)
    CALL outtextxy(50, 90, &#039;Abcd-r&#039;)
    CALL line(50, 0, 50, 299)
    .....</code></pre></div><p>In Delphi Pascal I call Windows API for aligning:</p><div class="codebox"><pre><code>procedure TForm1.FormPaint(Sender: TObject);
var
  h : THandle;

begin
  h:=Form1.Canvas.Handle;

  SetTextAlign(h, TA_LEFT);
  TextOut(h, 50, 50, &#039;Abcd-l&#039;, 6);
  SetTextAlign(h, TA_CENTER);
  TextOut(h, 50, 70, &#039;Abcd-c&#039;, 6);
  SetTextAlign(h, TA_RIGHT);
  TextOut(h, 50, 90, &#039;Abcd-r&#039;, 6);
  MoveToEx(h, 50, 1, NIL);
  LineTo(h, 50, 299)
end;</code></pre></div><p>The vertical line is for better orientation.</p><p>The second example is about a vertical aligment/justification.</p><p>SF code is as follows:</p><div class="codebox"><pre><code>    .....
    CALL settextjustify(LEFT_TEXT, BOTTOM_TEXT)
    CALL outtextxy(50, 50, &#039;Abcd-b&#039;)
    CALL settextjustify(LEFT_TEXT, CENTER_TEXT)
    CALL outtextxy(150, 50, &#039;Abcd-c&#039;)
    CALL settextjustify(LEFT_TEXT, TOP_TEXT)
    CALL outtextxy(250, 50, &#039;Abcd-t&#039;)
    CALL line(0, 65, 399, 65)
    .....</code></pre></div><p>Delphi code is:</p><div class="codebox"><pre><code>procedure TForm1.FormPaint(Sender: TObject);
var
  h : THandle;

begin
  h:=Form1.Canvas.Handle;

  SetTextAlign(h, TA_BOTTOM);
  TextOut(h, 50, 50, &#039;Abcd-b&#039;, 6);
  SetTextAlign(h, TA_BASELINE);
  TextOut(h, 150, 50, &#039;Abcd-c&#039;, 6);
  SetTextAlign(h, TA_TOP);
  TextOut(h, 250, 50, &#039;Abcd-t&#039;, 6);
  MoveToEx(h, 1, 65, NIL);
  LineTo(h, 399, 65)
end;</code></pre></div><p>The horizontal line is for better orientation.</p><p>If you can&#039;t run the above examples I will send you screenshots or will try to drop here.</p><p>As you can see the results are quite different. My suggerstion concerns &quot;aligment&quot; when I can draw a text that the middle point matches the required one. For example the centre of a labal fits the center of the line.</p>]]></description>
			<author><![CDATA[null@example.com (GrzegorzW)]]></author>
			<pubDate>Tue, 31 Oct 2023 12:17:24 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4238#p4238</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4235#p4235</link>
			<description><![CDATA[<p>In what particular case are you attempting to justify text?&nbsp; <strong>settextjustify</strong> works with the <strong>outtext</strong>/<strong>outtextxy</strong> subroutines.&nbsp; Are you trying to justify text within a control?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Sun, 29 Oct 2023 21:40:00 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4235#p4235</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4234#p4234</link>
			<description><![CDATA[<div class="quotebox"><cite>jeff wrote:</cite><blockquote><p>...<br />Text can be aligned with <strong>settextjustify</strong> already.<br />...</p></blockquote></div><p>May I disagree? <strong>settextjustify</strong> doesn&#039;t perform an alignment.</p>]]></description>
			<author><![CDATA[null@example.com (GrzegorzW)]]></author>
			<pubDate>Sun, 29 Oct 2023 16:42:06 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4234#p4234</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4232#p4232</link>
			<description><![CDATA[<p>AppGraphics&#039; graphical functions are actually a superset of the Borland Graphics Interface rather than a thin Windows GDI wrapper.&nbsp; I can see the need for SetBkMode when drawing dashed lines and hashes, but I&#039;d have to see about the best way to implement it.&nbsp; I actually think it should default to transparent, which makes the whole argument unnecessary.</p><p>Text can be aligned with <a href="https://simplyfortran.com/docs/appgraphics/text.html">settextjustify</a> already.</p><p>To clear a window (or region), I normally use either the combo <em>setbkcolor</em>/<em>clearviewport</em> or simply <em>bar</em>.&nbsp; <em>floodfill</em> uses a more complicated procedure because of its capabilities, of course.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Sun, 22 Oct 2023 14:18:56 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4232#p4232</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4230#p4230</link>
			<description><![CDATA[<p>As far as I understand AppGraphics is a wrapper of Windows API. May I ask to add to AppGraphics:</p><p>- SetBKMode / GetBkMode<br />- SetTextAlign / GetTextAlign<br />- FillRect</p><p>The last one I would like to use creating the window with other then default black background. FloodFill, because the algorithm, is rather unaesthetic method.</p>]]></description>
			<author><![CDATA[null@example.com (GrzegorzW)]]></author>
			<pubDate>Sat, 21 Oct 2023 16:55:38 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4230#p4230</guid>
		</item>
		<item>
			<title><![CDATA[Re: Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4227#p4227</link>
			<description><![CDATA[<p>Adding transparent text output to AppGraphics should be possible.&nbsp; I&#039;ll look at the best way to add it in a future release.</p><p>To add an image, you can use <a href="https://forums.approximatrix.com/help.php?section=bbcode">img tags</a>, but you would need to provide a URL to an image.&nbsp; We do not host any images here ourselves.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Sat, 21 Oct 2023 16:33:16 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4227#p4227</guid>
		</item>
		<item>
			<title><![CDATA[Trasparent text in AppGraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4224#p4224</link>
			<description><![CDATA[<p>I run a simple program utilizing AppGraphic:</p><div class="codebox"><pre><code>program main
use appgraphics
implicit none

    integer::myscreen
    
    myscreen = initwindow(400, 300, closeflag=.TRUE.)
    
    !CALL setwritemode(COPY_PUT)
    CALL setwritemode(XOR_PUT)
    CALL line(100, 200, 300, 200)
    CALL outtextxy(200, 200, &#039;Abcd&#039;)
    
    call loop()
    
    call closewindow(myscreen)

end program main</code></pre></div><p>The result is that the text removes a part of the line and there is a gap. I played with <em>setwritemode</em> without desired results. Is there any way to display a text transparently? If not could you please add the subroutine to toggle opaque/transparent mode?</p><p>PS. I can&#039;t catch how to add the image to the topic.</p>]]></description>
			<author><![CDATA[null@example.com (GrzegorzW)]]></author>
			<pubDate>Mon, 16 Oct 2023 16:25:19 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4224#p4224</guid>
		</item>
	</channel>
</rss>
