Click here to Skip to main content
15,887,283 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Help for Packet drop/pass Pin
Dave Kreskowiak14-May-07 8:38
mveDave Kreskowiak14-May-07 8:38 
QuestionHow to Hide Members of Base Class Pin
Probeer Das14-May-07 7:16
Probeer Das14-May-07 7:16 
AnswerRe: How to Hide Members of Base Class Pin
nlarson1114-May-07 8:30
nlarson1114-May-07 8:30 
GeneralRe: How to Hide Members of Base Class Pin
Probeer Das15-May-07 3:21
Probeer Das15-May-07 3:21 
QuestionSetting value for resources Pin
ctlqt1214-May-07 5:45
ctlqt1214-May-07 5:45 
AnswerRe: Setting value for resources Pin
Dave Kreskowiak14-May-07 8:36
mveDave Kreskowiak14-May-07 8:36 
QuestionStretchBlt to a PictureBox ? Pin
Beginner_HC14-May-07 4:24
Beginner_HC14-May-07 4:24 
AnswerRe: StretchBlt to a PictureBox ? Pin
Dave Kreskowiak14-May-07 4:43
mveDave Kreskowiak14-May-07 4:43 
Beginner_HC wrote:
Public Class Form1
Dim srcImage As New Bitmap("MyPicture.bmp", True)
Dim Graph As Graphics = Me.CreateGraphics
Dim desHdc As IntPtr = Graph.GetHdc()

Dim srcHdc As IntPtr = CreateCompatibleDC(IntPtr.Zero)
Dim hBitmapSrc As IntPtr = srcImage.GetHbitmap()


This is a REALLY bad idea. Make this stuff class-scoped will cause you severe problems later on. You should ALWAYS Create, Use, then Destroy your graphics object only when you need them and only for as long as you need them. Caching one like this doesn't do you any good because some operations will only be commited when the Graphics object is finally destroyed.

What are you trying to do with this code again? You OP wasn't very clear about what your doing with this. What's the ultimate goal here?


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: StretchBlt to a PictureBox ? Pin
Beginner_HC14-May-07 5:34
Beginner_HC14-May-07 5:34 
GeneralRe: StretchBlt to a PictureBox ? Pin
Dave Kreskowiak14-May-07 8:34
mveDave Kreskowiak14-May-07 8:34 
GeneralRe: StretchBlt to a PictureBox ? Pin
Beginner_HC15-May-07 8:51
Beginner_HC15-May-07 8:51 
QuestionOOPS Pin
Rafeeque Ahmed14-May-07 4:03
Rafeeque Ahmed14-May-07 4:03 
AnswerRe: OOPS Pin
Dave Kreskowiak14-May-07 4:37
mveDave Kreskowiak14-May-07 4:37 
GeneralRe: OOPS Pin
leckey14-May-07 9:26
leckey14-May-07 9:26 
GeneralRe: OOPS Pin
Dave Kreskowiak14-May-07 9:48
mveDave Kreskowiak14-May-07 9:48 
GeneralRe: OOPS Pin
Paul Conrad14-May-07 9:54
professionalPaul Conrad14-May-07 9:54 
GeneralRe: OOPS Pin
leckey14-May-07 10:32
leckey14-May-07 10:32 
GeneralRe: OOPS Pin
Rafeeque Ahmed14-May-07 19:32
Rafeeque Ahmed14-May-07 19:32 
GeneralRe: OOPS Pin
Dave Kreskowiak15-May-07 12:48
mveDave Kreskowiak15-May-07 12:48 
GeneralRe: OOPS Pin
Rafeeque Ahmed15-May-07 19:59
Rafeeque Ahmed15-May-07 19:59 
GeneralRe: OOPS Pin
Dave Kreskowiak16-May-07 13:24
mveDave Kreskowiak16-May-07 13:24 
Questionapplication slow Pin
Rafeeque Ahmed14-May-07 4:02
Rafeeque Ahmed14-May-07 4:02 
AnswerRe: application slow Pin
Dave Kreskowiak14-May-07 4:35
mveDave Kreskowiak14-May-07 4:35 
AnswerRe: application slow Pin
Paul Conrad14-May-07 6:28
professionalPaul Conrad14-May-07 6:28 
QuestionWebbrowser Reporting from VB Pin
Kumaran21cen14-May-07 3:32
Kumaran21cen14-May-07 3:32 

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.