개정판 7459b663
issue #00000 markus image create 수정
Change-Id: Iadf0c79ef51726a1645f4343a4174c29c80095ce
ID2.Manager/ID2.Manager.sln | ||
---|---|---|
126 | 126 |
{83DACC10-43B1-4E38-ABEF-E5EF9492A82D}.Release|x64.Build.0 = Release|x64 |
127 | 127 |
{83DACC10-43B1-4E38-ABEF-E5EF9492A82D}.Release|x86.ActiveCfg = Release|Any CPU |
128 | 128 |
{83DACC10-43B1-4E38-ABEF-E5EF9492A82D}.Release|x86.Build.0 = Release|Any CPU |
129 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Debug|Any CPU.ActiveCfg = Debug|x64
|
|
130 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Debug|x64.ActiveCfg = Debug|x64
|
|
129 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Debug|Any CPU.ActiveCfg = Debug|x86
|
|
130 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Debug|x64.ActiveCfg = Debug|x86
|
|
131 | 131 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Debug|x86.ActiveCfg = Debug|x86 |
132 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|Any CPU.ActiveCfg = Release|x64 |
|
133 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|x64.ActiveCfg = Debug|x64 |
|
134 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|x64.Build.0 = Debug|x64 |
|
132 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|Any CPU.ActiveCfg = Release|x86 |
|
133 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|x64.ActiveCfg = Release|x86 |
|
135 | 134 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|x86.ActiveCfg = Debug|x86 |
136 | 135 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.MarkusImageCreate|x86.Build.0 = Debug|x86 |
137 | 136 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Release|Any CPU.ActiveCfg = Release|x86 |
138 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Release|x64.ActiveCfg = Release|x64
|
|
137 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Release|x64.ActiveCfg = Release|x86
|
|
139 | 138 |
{465FA895-49CF-4E6D-A0E4-D12CA03B9FD5}.Release|x86.ActiveCfg = Release|x86 |
140 | 139 |
EndGlobalSection |
141 | 140 |
GlobalSection(SolutionProperties) = preSolution |
ID2.Manager/MarkusImageCreate/MarkusImageCreate.INI | ||
---|---|---|
4 | 4 |
#ID2Manager = ZABhAHQAYQAgAHMAbwB1AHIAYwBlAD0AMQA5ADIALgAxADYAOAAuADAALgA2ADcAOwBpAG4AaQB0AGkAYQBsACAAYwBhAHQAYQBsAG8AZwA9AEkARAAyAE0AYQBuAGEAZwBlAHIAOwBwAGUAcgBzAGkAcwB0ACAAcwBlAGMAdQByAGkAdAB5ACAAaQBuAGYAbwA9AFQAcgB1AGUAOwB1AHMAZQByACAAaQBkAD0AcwBhADsAcABhAHMAcwB3AG8AcgBkAD0AZABvAGYAMQAwADcAMwAjADsAbQB1AGwAdABpAHAAbABlAGEAYwB0AGkAdgBlAHIAZQBzAHUAbAB0AHMAZQB0AHMAPQBUAHIAdQBlAA== |
5 | 5 |
#Markus = ZABhAHQAYQAgAHMAbwB1AHIAYwBlAD0AMQA5ADIALgAxADYAOAAuADAALgA2ADcAOwBpAG4AaQB0AGkAYQBsACAAYwBhAHQAYQBsAG8AZwA9AE0AYQByAGsAdQBzAF8AUwBFAEMAOwBwAGUAcgBzAGkAcwB0ACAAcwBlAGMAdQByAGkAdAB5ACAAaQBuAGYAbwA9AFQAcgB1AGUAOwB1AHMAZQByACAAaQBkAD0AZABvAGYAdABlAGMAaAA7AHAAYQBzAHMAdwBvAHIAZAA9AGQAbwBmADEAMAA3ADMAIwA7AG0AdQBsAHQAaQBwAGwAZQBhAGMAdABpAHYAZQByAGUAcwB1AGwAdABzAGUAdABzAD0AVAByAHUAZQA= |
6 | 6 |
ID2ProjectsPath = \\DOFDEVSVR\ID2_Project |
7 |
MarkusImagePath = D:\Temp\Markus
|
|
7 |
MarkusImagePath = \\markusdev\TileSource
|
|
8 | 8 |
Resolution = 250 |
9 | 9 |
FontPath = C:\MarkusFonts |
ID2.Manager/MarkusImageCreate/MarkusImageCreate.csproj | ||
---|---|---|
14 | 14 |
<Deterministic>true</Deterministic> |
15 | 15 |
<TargetFrameworkProfile /> |
16 | 16 |
</PropertyGroup> |
17 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> |
|
18 |
<DebugSymbols>true</DebugSymbols> |
|
19 |
<OutputPath>bin\x64\Debug\</OutputPath> |
|
20 |
<DefineConstants>TRACE;DEBUG;MARKUS_IMAGE_CREATE</DefineConstants> |
|
21 |
<DebugType>full</DebugType> |
|
22 |
<PlatformTarget>x64</PlatformTarget> |
|
23 |
<LangVersion>7.3</LangVersion> |
|
24 |
<ErrorReport>prompt</ErrorReport> |
|
25 |
<Prefer32Bit>true</Prefer32Bit> |
|
26 |
</PropertyGroup> |
|
27 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> |
|
28 |
<OutputPath>bin\x64\Release\</OutputPath> |
|
29 |
<DefineConstants>TRACE</DefineConstants> |
|
30 |
<Optimize>true</Optimize> |
|
31 |
<DebugType>pdbonly</DebugType> |
|
32 |
<PlatformTarget>x64</PlatformTarget> |
|
33 |
<LangVersion>7.3</LangVersion> |
|
34 |
<ErrorReport>prompt</ErrorReport> |
|
35 |
<Prefer32Bit>true</Prefer32Bit> |
|
36 |
</PropertyGroup> |
|
37 | 17 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> |
38 | 18 |
<DebugSymbols>true</DebugSymbols> |
39 | 19 |
<OutputPath>bin\x86\Debug\</OutputPath> |
ID2.Manager/MarkusImageCreate/OdReadExMgd.cs | ||
---|---|---|
3343 | 3343 |
public bool ExportPNG(Database pDb, string savePngPath,int pngWidth,int pngHeight) |
3344 | 3344 |
{ |
3345 | 3345 |
bool result = false; |
3346 |
string tempPngPath = null; |
|
3346 | 3347 |
|
3347 | 3348 |
try |
3348 | 3349 |
{ |
... | ... | |
3354 | 3355 |
|
3355 | 3356 |
string gdPath = "WinOpenGL_20.5_15.txv"; |
3356 | 3357 |
|
3357 |
string bmpPath = savePngPath.Replace(".png", ".bmp");
|
|
3358 |
tempPngPath = System.IO.Path.GetTempFileName().Replace(".tmp", ".png");
|
|
3358 | 3359 |
|
3359 | 3360 |
using (GsModule gsModule = (GsModule)SystemObjects.DynamicLinker.LoadModule(gdPath, false, true)) |
3360 | 3361 |
{ |
... | ... | |
3393 | 3394 |
helperDevice.ActiveView.ZoomExtents(pDb.Extmin, pDb.Extmax); |
3394 | 3395 |
helperDevice.ActiveView.Zoom(1); |
3395 | 3396 |
helperDevice.Update(); |
3396 |
Export_Import.ExportBitmap(helperDevice, bmpPath); |
|
3397 |
|
|
3398 |
Export_Import.ExportBitmap(helperDevice, tempPngPath); |
|
3397 | 3399 |
} |
3398 | 3400 |
} |
3399 | 3401 |
} |
3400 | 3402 |
} |
3401 | 3403 |
|
3402 |
if (File.Exists(bmpPath))
|
|
3404 |
if (File.Exists(tempPngPath))
|
|
3403 | 3405 |
{ |
3404 | 3406 |
if (File.Exists(savePngPath)) |
3405 | 3407 |
{ |
3406 | 3408 |
File.Delete(savePngPath); |
3407 | 3409 |
} |
3408 | 3410 |
|
3409 |
using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(bmpPath)) |
|
3410 |
{ |
|
3411 |
bmp.Save(savePngPath, System.Drawing.Imaging.ImageFormat.Png); |
|
3412 |
} |
|
3413 |
|
|
3414 |
if (File.Exists(bmpPath)) |
|
3415 |
{ |
|
3416 |
File.Delete(bmpPath); |
|
3417 |
} |
|
3411 |
File.Copy(tempPngPath, savePngPath); |
|
3418 | 3412 |
|
3419 | 3413 |
using (System.Drawing.Image image = System.Drawing.Image.FromFile(savePngPath)) |
3420 | 3414 |
{ |
3421 |
if(image.Width == pngWidth && image.Height == pngHeight) |
|
3415 |
if (image.Width == pngWidth && image.Height == pngHeight)
|
|
3422 | 3416 |
{ |
3423 | 3417 |
result = true; |
3424 | 3418 |
} |
... | ... | |
3431 | 3425 |
result = false; |
3432 | 3426 |
throw; |
3433 | 3427 |
} |
3428 |
finally |
|
3429 |
{ |
|
3430 |
if (tempPngPath != null) |
|
3431 |
{ |
|
3432 |
if (File.Exists(tempPngPath)) |
|
3433 |
{ |
|
3434 |
File.Delete(tempPngPath); |
|
3435 |
} |
|
3436 |
} |
|
3437 |
} |
|
3434 | 3438 |
|
3435 | 3439 |
return result; |
3436 | 3440 |
} |
ID2.Manager/MarkusImageCreate/Program.cs | ||
---|---|---|
197 | 197 |
|
198 | 198 |
foreach (var item in convertItems) |
199 | 199 |
{ |
200 |
string dwgFile = null; |
|
201 |
|
|
200 | 202 |
try |
201 | 203 |
{ |
202 | 204 |
var orgFile = Path.Combine(sourcePath, item.DOCUMENT_ID + ".dwg"); |
203 |
var dwgFile = Path.Combine(targetPath, item.DOCUMENT_ID + ".dwg");
|
|
205 |
dwgFile = System.IO.Path.GetTempFileName().Replace(".tmp",".dwg");
|
|
204 | 206 |
|
205 | 207 |
|
206 | 208 |
File.Copy(orgFile, dwgFile,true); |
... | ... | |
257 | 259 |
Console.WriteLine($"Error. {item.DOCUMENT_ID} {ex.ToString()}"); |
258 | 260 |
rep.UpdateStatusAsync(item.SERVICE_ID, item.ID,50, 1, 1, ex.ToString()); |
259 | 261 |
} |
262 |
finally |
|
263 |
{ |
|
264 |
if(dwgFile != null) |
|
265 |
{ |
|
266 |
if(File.Exists(dwgFile)) |
|
267 |
{ |
|
268 |
File.Delete(dwgFile); |
|
269 |
} |
|
270 |
} |
|
271 |
} |
|
260 | 272 |
} |
261 | 273 |
} |
262 | 274 |
} |
내보내기 Unified diff