blob: 8411f377028a3c80cbcf24782c585c397fc3c14f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using System.Collections.Generic;
using System.IO;
using PdfSharp.Drawing;
using System.Drawing;
using DHTMLX.Export.PDF.Scheduler;
namespace DHTMLX.Export.PDF.Scheduler
{
public class PDFImages
{
private Dictionary<string, XImage> _cache = new Dictionary<string, XImage>();
public XImage Get(string path)
{
if (_cache.ContainsKey(path))
{
return _cache[path];
}
if (File.Exists(path))
{
FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
var img = new Bitmap(fileStream, false);
_cache.Add(path, (XImage)img);
return _cache[path];
}
return null;
}
}
}
|