1-) C# RMOS - WinExplorerView kullanımı gridcontrolü çeviriyor
using DevExpress.XtraGrid.Views.WinExplorer;
using DevExpress.XtraPdfViewer;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
pdfViewer1.LoadDocument("Demo.pdf");
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void pdfViewer1_DocumentChanged(object sender, PdfDocumentChangedEventArgs e)
{
IList<PdfPage> documentPages = new List<PdfPage>(pdfViewer1.PageCount);
for (int i = 1; i <= pdfViewer1.PageCount; i++)
{
PdfPage documentPage = new PdfPage();
documentPage.PageNumber = i;
documentPage.SetThumbnailImage(pdfViewer1);
documentPages.Add(documentPage);
}
grdThumbnails.DataSource = documentPages;
}
private void wvThumbnails_DoubleClick(object sender, EventArgs e)
{
PdfPage currentPage = (wvThumbnails.GetFocusedRow() as PdfPage);
pdfViewer1.CurrentPageNumber = currentPage.PageNumber;
}
}
}
----------
PdfViewer pd = new PdfViewer();
pd.LoadDocument("Demo.pdf");
PdfViewer pd1 = new PdfViewer();
pd1.LoadDocument("a.pdf");
IList<PdfPage> documentPages = new List<PdfPage>(pd.PageCount);
IList<PdfPage> documentPages1 = new List<PdfPage>(pd1.PageCount);
PdfPage documentPage = new PdfPage();
documentPage.PageNumber = 1;
documentPage.SetThumbnailImage(pd);
PdfPage documentPage1 = new PdfPage();
documentPage1.PageNumber = 1;
documentPage1.SetThumbnailImage(pd1);
documentPages.Add(documentPage);
documentPages.Add(documentPage1);
grdThumbnails.DataSource = documentPages;
-----------------------
using DevExpress.XtraGrid.Views.WinExplorer;
using DevExpress.XtraPdfViewer;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
PdfLoad();
}
public void PdfLoad()
{
string[] pdfPath = new string[43];
for (int i = 0; i < 42; i++)
{
int s = i + 1;
pdfPath[i + 1] = "al\\a ("+s+").pdf";
}
IList<PdfPage> documentPages = new List<PdfPage>(pdfPath.Length);
for (int i = 0; i < pdfPath.Length-1; i++)
{
PdfViewer pd = new PdfViewer();
string path = pdfPath[i + 1];
pd.LoadDocument(path);
PdfPage documentPage = new PdfPage();
documentPage.PageNumber = 1;
documentPage.SetThumbnailImage(pd);
documentPage.Thumbnail.Tag = i+" -> id";
documentPages.Add(documentPage);
}
grdThumbnails.DataSource = documentPages;
}
private void grdThumbnails_DoubleClick(object sender, EventArgs e)
{
PdfPage currentPage = (wvThumbnails.GetFocusedRow() as PdfPage);
MessageBox.Show(currentPage.Thumbnail.Tag.ToString());
}
}
}
-------------------------------- pdf'leri birleştirip ilk sayfasını alıp tileview de gösteriyor -------------
using DevExpress.Pdf;
using DevExpress.XtraPdfViewer;
using DevExpress.XtraPrinting.Export.Pdf;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication9
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
public void PdfLoad()
{
string[] pdfPath = new string[43];
for (int i = 0; i < 42; i++)
{
int s = i + 1;
pdfPath[i + 1] = "al\\a (" + s + ").pdf";
}
IList<PdfPage1> documentPages = new List<PdfPage1>(pdfPath.Length);
PdfViewer pd = new PdfViewer();
PdfPage1 documentPage;
for (int i = 0; i < pdfPath.Length - 1; i++)
{
string path = pdfPath[i + 1];
pd.LoadDocument(path);
documentPage = new PdfPage1();
documentPage.PageNumber = 1;
documentPage.SetThumbnailImage(pd);
documentPage.Thumbnail.Tag = i + " -> id";
documentPages.Add(documentPage);
}
grdThumbnails.DataSource = documentPages;
}
private void grdThumbnails_DoubleClick(object sender, EventArgs e)
{
PdfPage1 currentPage = (wvThumbnails.GetFocusedRow() as PdfPage1);
MessageBox.Show(currentPage.Thumbnail.Tag.ToString());
}
private void button1_Click(object sender, EventArgs e)
{
//PdfLoad();
pdfMerge();
}
public void pdfMerge()
{
string[] pdfPath = new string[43];
PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor();
pdfDocumentProcessor.CreateEmptyDocument();
ArrayList sayfalar = new ArrayList();
for (int i = 0; i < 42; i++)
{
int s = i + 1;
pdfPath[i + 1] = "al\\a (" + s + ").pdf";
pdfDocumentProcessor.AppendDocument(pdfPath[i + 1]);
// int count =Convert.ToInt32( pdfDocumentProcessor.Document.Pages.Count.ToString());
sayfalar.Add(pdfDocumentProcessor.Document.Pages.Count.ToString());
}
pdfDocumentProcessor.SaveDocument("merge2.pdf");
PdfViewer pdf = new PdfViewer();
pdf.LoadDocument("merge2.pdf");
IList<PdfPage1> documentPages = new List<PdfPage1>(pdf.PageCount);
for (int i = 0; i < sayfalar.Count; i++)
{
PdfPage1 documentPage = new PdfPage1();
documentPage.PageNumber = Convert.ToInt32(sayfalar[i]);
documentPage.SetThumbnailImage(pdf);
documentPage.Thumbnail.Tag = i + " -> id";
documentPages.Add(documentPage);
}
grdThumbnails.DataSource = documentPages;
}
}
}
-------------------------------------------IMAGE TİLE VİEW GÖSTERME--------------------------------------
jpgPage.cs
using System.Drawing;
namespace jpgTileView
{
public class jpgPage
{
public int PageNumber
{
get;
set;
}
public Image Thumbnail
{
get;
private set;
}
public jpgPage()
{
}
public void SetThumbnailImage(Image DocumentViewer)
{
Thumbnail = DocumentViewer;
}
}
}
GRİDVİEWİ WİNEXPLORER VİEW E ÇEVİR VE
//YAKLAŞIK 40 TANE JPG VAR ONLARI YÜKLEYİP GÖSTERİYOR
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace jpgTileView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
jpgLoad();
}
public void jpgLoad()
{
string[] pdfPath = new string[6];
IList<jpgPage> documentPages = new List<jpgPage>();
for (int i = 0; i < 39; i++)
{
int s = i + 1;
Image image = Image.FromFile("al1\\a (" + s + ").jpg");
jpgPage documentPage = new jpgPage();
documentPage.PageNumber = i;
documentPage.SetThumbnailImage(image);
documentPage.Thumbnail.Tag = i + " -> id";
documentPages.Add(documentPage);
}
gridControl1.DataSource = documentPages;
}
private void gridControl1_DoubleClick(object sender, EventArgs e)
{
jpgPage currentPage = (winExplorerView1.GetFocusedRow() as jpgPage);
MessageBox.Show(currentPage.Thumbnail.Tag.ToString());
}
}
}
---aşağıdakini true yaparsan hızlı olur mouse aşağı yukarı -----
private void Form1_Load(object sender, EventArgs e)
{
gridControl1.UseDirectXPaint = DefaultBoolean.True;
}