Click here to Skip to main content
15,903,856 members
Home / Discussions / C#
   

C#

 
AnswerRe: Making the enter(return) key call a Validated event Pin
Megidolaon23-Feb-09 3:10
Megidolaon23-Feb-09 3:10 
AnswerRe: Making the enter(return) key call a Validated event Pin
Richard Dean14-Apr-09 7:28
Richard Dean14-Apr-09 7:28 
QuestionC# area map Pin
Zap-Man22-Feb-09 12:01
Zap-Man22-Feb-09 12:01 
AnswerRe: C# area map Pin
fly90422-Feb-09 12:13
fly90422-Feb-09 12:13 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 14:40
Zap-Man22-Feb-09 14:40 
GeneralRe: C# area map Pin
fly90422-Feb-09 15:06
fly90422-Feb-09 15:06 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 15:18
Zap-Man22-Feb-09 15:18 
GeneralRe: C# area map [modified] Pin
fly90423-Feb-09 0:04
fly90423-Feb-09 0:04 
GeneralRe: C# area map Pin
Zap-Man23-Feb-09 13:41
Zap-Man23-Feb-09 13:41 
QuestionPassable function Pin
Chris Copeland22-Feb-09 10:04
mveChris Copeland22-Feb-09 10:04 
AnswerRe: Passable function Pin
Jon Rista22-Feb-09 10:54
Jon Rista22-Feb-09 10:54 
GeneralRe: Passable function Pin
Chris Copeland22-Feb-09 11:02
mveChris Copeland22-Feb-09 11:02 
GeneralRe: Passable function Pin
Jon Rista22-Feb-09 11:16
Jon Rista22-Feb-09 11:16 
QuestionHow to enable auto scroll in a listbox? Pin
bar300022-Feb-09 9:20
bar300022-Feb-09 9:20 
AnswerRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 9:34
Luis Alonso Ramos22-Feb-09 9:34 
GeneralRe: How to enable auto scroll in a listbox? Pin
bar300022-Feb-09 9:48
bar300022-Feb-09 9:48 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 10:11
Luis Alonso Ramos22-Feb-09 10:11 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 10:30
Luis Alonso Ramos22-Feb-09 10:30 
AnswerRe: How to enable auto scroll in a listbox? Pin
Luc Pattyn22-Feb-09 10:11
sitebuilderLuc Pattyn22-Feb-09 10:11 
GeneralRe: How to enable auto scroll in a listbox? Pin
bar300023-Feb-09 7:08
bar300023-Feb-09 7:08 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luc Pattyn23-Feb-09 7:27
sitebuilderLuc Pattyn23-Feb-09 7:27 
QuestionIHTMLElement to Bitmap Pin
Sunset Towers22-Feb-09 9:14
Sunset Towers22-Feb-09 9:14 
After hours of searching I finally got this far and I'm not getting any errors
from this code. However I'm getting a black image. Is there something amiss here. I need to get access to this image regardless of wether it's visible on the physical montior or not and I'm assuming this may be the best way.


IHTMLElement test = (IHTMLElement)webBrowser1.Document.Images[i].DomElement;
IHTMLElementRender testRender = (IHTMLElementRender)test;

//  access desktop DC

int hScreen = GDI.CreateCompatibleDC(this.CreateGraphics().GetHdc());
testRender.DrawToDC((IntPtr)hScreen);

//  get width and height of desktop
int hCompDC = GDI.CreateCompatibleDC((IntPtr)hScreen);

int nWidth = webBrowser1.Document.Images[i].ClientRectangle.Width;
int nHeight = webBrowser1.Document.Images[i].ClientRectangle.Height;

//  create bitmap to receive the screenshot

int hBmp = GDI.CreateCompatibleBitmap((IntPtr)hScreen, nWidth, nHeight);

//  select bitmap into target DC

int hOld = GDI.SelectObject((IntPtr)hCompDC, (IntPtr)hBmp);

//  blit bits from screen to target buffer

GDI.BitBlt((IntPtr)hCompDC, 0, 0, nWidth, nHeight, (IntPtr)hScreen, 0, 0, GDI.SRCCOPY);

//  de-select bitmap

GDI.SelectObject((IntPtr)hCompDC, (IntPtr)hOld);

//  free DCs

GDI.DeleteDC((IntPtr)hScreen);
GDI.DeleteDC((IntPtr)hCompDC);

//  save image or whatever

Image img;
pictureBox2.Image = Bitmap.FromHbitmap((IntPtr)hBmp);

QuestionHow to query and execute code according to result.. Pin
High0ctane22-Feb-09 8:59
High0ctane22-Feb-09 8:59 
AnswerRe: How to query and execute code according to result.. Pin
Luis Alonso Ramos22-Feb-09 9:12
Luis Alonso Ramos22-Feb-09 9:12 
GeneralRe: How to query and execute code according to result.. Pin
High0ctane22-Feb-09 12:17
High0ctane22-Feb-09 12:17 

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.