<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title></title>
<meta content="MSHTML 6.00.6000.16945" name="GENERATOR">
</head>
<body>
<!-- Converted from text/plain format --><font size="2">
<dl><dd><br>
Hello all,<br>
<br>
I'm running into problems with my mapscript C#. I had truetype fonts, but due to some restrictions I can't use them on the system anymore, so I switched to type Bitmap.<br>
This will work, but only if I switch <u>off </u> autofollow.<br>
<br>
<br>
Case: I have lines with labels. I had these labels with truetype and with autofollow --> MS_TRUE:<br>
</dd><dd><font face="Arial">Working part:</font> </dd><dd><font face="Arial"></font> </dd><dd><font face="Arial">Mapscript:</font><br>
<br>
<font size="2">
<dl><dd>layerclass.label.color.setRGB(0, 0, 0); </dd><dd>layerclass.label.font = </font><font color="#a31515" size="2"><font color="#a31515" size="2">"Arial"</font></font><font size="2">;
</dd><dd>layerclass.label.size = 10; </dd><dd></font><font color="#008000" size="2"><font color="#008000" size="2">//layerclass.label.size = (double)MS_BITMAP_FONT_SIZES.MS_SMALL;</font></font><font size="2">
</dd><dd>layerclass.label.force = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;
</dd><dd>layerclass.label.type = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MS_FONT_TYPE</font></font><font size="2">.MS_TRUETYPE;
</dd><dd></font><font color="#008000" size="2"><font color="#008000" size="2">//layerclass.label.type = MS_FONT_TYPE.MS_BITMAP;</font></font><font size="2">
</dd><dd>layerclass.label.position = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2">)</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MS_POSITIONS_ENUM</font></font><font size="2">.MS_UC;
</dd><dd>layerclass.label.autoangle = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;
</dd><dd>layerclass.label.autofollow = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;</dd></dl>
</font><br>
<br>
</dd><dd>This works.. resulting in mapfile and image:</dd></dl>
<div><font face="Arial">LABEL<br>
ANGLE FOLLOW<br>
ANTIALIAS TRUE<br>
FONT "Arial"<br>
MAXSIZE 256<br>
MINSIZE 4<br>
SIZE 10<br>
TYPE TRUETYPE<br>
BUFFER 0<br>
COLOR 0 0 0<br>
FORCE TRUE<br>
MINDISTANCE -1<br>
MINFEATURESIZE -1<br>
OFFSET 0 0<br>
PARTIALS TRUE<br>
POSITION UC<br>
END</font></div>
<dl><dd> </dd></dl>
<div><font face="Arial">NOT WORKING PART:</font></div>
<div>However, if I change this to using the BITMAP fonttype, It gives me an error:</div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Mapscript:</font></div>
<dl><dd><font face="Arial"></font> <font size="2"> </dd><dd>layerclass.label.color.setRGB(0, 0, 0); </dd><dd></font><font color="#008000" size="2"><font color="#008000" size="2">//layerclass.label.font = "Arial";</font></font><font size="2">
</dd><dd></font><font color="#008000" size="2"><font color="#008000" size="2">//layerclass.label.size = 10;</font></font><font size="2">
</dd><dd>layerclass.label.size = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2">)</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MS_BITMAP_FONT_SIZES</font></font><font size="2">.MS_SMALL;
</dd><dd>layerclass.label.force = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;
</dd><dd></font><font color="#008000" size="2"><font color="#008000" size="2">//layerclass.label.type = MS_FONT_TYPE.MS_TRUETYPE;</font></font><font size="2">
</dd><dd>layerclass.label.type = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MS_FONT_TYPE</font></font><font size="2">.MS_BITMAP;
</dd><dd>layerclass.label.position = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2">)</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MS_POSITIONS_ENUM</font></font><font size="2">.MS_UC;
</dd><dd>layerclass.label.autoangle = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;
</dd><dd>layerclass.label.autofollow = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">mapscript</font></font><font size="2">.MS_TRUE;</dd></dl>
</font><font face="Arial">
<div> </div>
<div>Resulting mapfile:</div>
<div> </div>
LABEL<br>
SIZE SMALL<br>
TYPE BITMAP<br>
BUFFER 0<br>
COLOR 0 0 0<br>
FORCE TRUE<br>
MINDISTANCE -1<br>
MINFEATURESIZE -1<br>
OFFSET 0 0<br>
PARTIALS TRUE<br>
POSITION UC<br>
END
<div> </div>
<div>Resulting Error:</div>
<div><br>
Attempted to read or write protected memory. This is often an indication that ot<br>
her memory is corrupt.<br>
(something with P/Invoke)<br>
</div>
</font>
<div><font face="Arial"></font> </div>
<div><font face="Arial"></font> </div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Is this a bug, or is it just nog possible to get autofollow labels with bitmap type labels? Or is it Csharp errors with bitmap font?</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Greetings</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Gerben Tiemens</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial"></font></font> </div>
<br>
<font face="Verdana" color="Gray" size="1"><< Please read our E-mail Disclaimer at: Emaildisclaimer.Grontmij.com >><br>
</font>
</body>
</html>