Click here to Skip to main content
15,908,775 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sorting Array of objects Pin
Rizwan Rathore23-May-06 14:11
Rizwan Rathore23-May-06 14:11 
GeneralRe: Sorting Array of objects Pin
BoneSoft23-May-06 15:10
BoneSoft23-May-06 15:10 
GeneralRe: Sorting Array of objects Pin
Robert Rohde23-May-06 19:42
Robert Rohde23-May-06 19:42 
GeneralRe: Sorting Array of objects Pin
BoneSoft24-May-06 1:31
BoneSoft24-May-06 1:31 
GeneralRe: Sorting Array of objects Pin
Rizwan Rathore23-May-06 21:13
Rizwan Rathore23-May-06 21:13 
QuestionNovell GroupWise Pin
NewbieDude22-May-06 23:32
NewbieDude22-May-06 23:32 
QuestionListView.ShowGroups=TRUE [modified] Pin
Greeky22-May-06 23:21
Greeky22-May-06 23:21 
QuestionProblems with HDC Pin
__makaveli__22-May-06 23:16
__makaveli__22-May-06 23:16 
Hi,

I am trying to get Acrobat to draw a page into a System.Drawing.Image.HBitmap class, I have the following code which so far only grabs the desktop window, I need to get an HDC somehow but am not sure exactly where and how I should be doing it:

_pdpage = (CAcroPDPage)_pddoc.AcquirePage(page);

/// This line is the problem:
IntPtr hDC = new IntPtr();

AcroRect pdfRect = new AcroRect();

pdfRect.Left = 0;
pdfRect.right = 200;
pdfRect.Top = 0;
pdfRect.bottom = 200;

_pdpage.DrawEx(0, hDC.ToInt32(), pdfRect, 0, 0, 100);

IntPtr hMemDC = PlatformInvokeGDI32.CreateCompatibleDC(hDC);
IntPtr hBitmap = PlatformInvokeGDI32.CreateCompatibleBitmap(hDC, pdfRect.right, pdfRect.bottom);

IntPtr hOld = (IntPtr)PlatformInvokeGDI32.SelectObject(hMemDC, hBitmap);
PlatformInvokeGDI32.BitBlt(hMemDC, 0, 0, pdfRect.right, pdfRect.bottom, hDC, 0, 0, PlatformInvokeGDI32.SRCCOPY);
PlatformInvokeGDI32.SelectObject(hMemDC, hOld);
PlatformInvokeGDI32.DeleteDC(hMemDC);
Bitmap newBmp = System.Drawing.Image.FromHbitmap(hBitmap);

PlatformInvokeGDI32.DeleteObject(hBitmap);
GC.Collect();

newBmp.Save("C:\\test.bmp");

Now all that code does is draw the desktop window to the file, I need to know where I'm going wrong.

Thanks in advance!
QuestionHow to view a Flash file in C# Pin
nps_ltv22-May-06 23:12
nps_ltv22-May-06 23:12 
AnswerRe: How to view a Flash file in C# Pin
Saqib Mehmood23-May-06 1:57
Saqib Mehmood23-May-06 1:57 
GeneralRe: How to view a Flash file in C# Pin
nps_ltv25-May-06 0:22
nps_ltv25-May-06 0:22 
GeneralRe: How to view a Flash file in C# Pin
Saqib Mehmood25-May-06 0:40
Saqib Mehmood25-May-06 0:40 
Questionset tile ,author name to image in c# Pin
sreesiri22-May-06 23:00
sreesiri22-May-06 23:00 
AnswerRe: set tile ,author name to image in c# Pin
stancrm22-May-06 23:27
stancrm22-May-06 23:27 
GeneralRe: set tile ,author name to image in c# Pin
sreesiri23-May-06 21:02
sreesiri23-May-06 21:02 
QuestionWhich Port Xp uses when we Access a Shared Folder over a network Pin
majidbhutta22-May-06 21:44
majidbhutta22-May-06 21:44 
AnswerRe: Which Port Xp uses when we Access a Shared Folder over a network Pin
stancrm22-May-06 21:47
stancrm22-May-06 21:47 
QuestionHelp On Float Toolbox in C#. Pin
RezaAsAdi22-May-06 20:07
RezaAsAdi22-May-06 20:07 
AnswerRe: Help On Float Toolbox in C#. Pin
alexey N22-May-06 20:25
alexey N22-May-06 20:25 
Questioncan't add item to listbox Pin
lagumaster22-May-06 17:30
lagumaster22-May-06 17:30 
AnswerRe: can't add item to listbox Pin
leppie22-May-06 17:50
leppie22-May-06 17:50 
AnswerRe: can't add item to listbox Pin
KrIstOfK22-May-06 21:05
KrIstOfK22-May-06 21:05 
QuestionHow can i use another application outside my program? Pin
abiisalwayshappy22-May-06 17:24
abiisalwayshappy22-May-06 17:24 
AnswerRe: How can i use another application outside my program? Pin
Judah Gabriel Himango22-May-06 17:50
sponsorJudah Gabriel Himango22-May-06 17:50 
AnswerRe: How can i use another application outside my program? Pin
Saqib Mehmood22-May-06 17:51
Saqib Mehmood22-May-06 17:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.