Click here to Skip to main content
15,919,774 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: change the caller form based on the result of the called form Pin
Briga6-Dec-05 4:06
Briga6-Dec-05 4:06 
QuestionVB.Net Controls: TypeConverter Pin
vocaris2-Dec-05 5:18
vocaris2-Dec-05 5:18 
AnswerRe: VB.Net Controls: TypeConverter Pin
[Marc]2-Dec-05 6:21
[Marc]2-Dec-05 6:21 
GeneralThank you Pin
vocaris2-Dec-05 7:50
vocaris2-Dec-05 7:50 
GeneralRe: Thank you Pin
[Marc]2-Dec-05 10:06
[Marc]2-Dec-05 10:06 
QuestionCounting Records.......... Pin
daviiie2-Dec-05 5:14
daviiie2-Dec-05 5:14 
AnswerRe: Counting Records.......... Pin
vocaris2-Dec-05 5:21
vocaris2-Dec-05 5:21 
QuestionIs it possible to remove existing graphics from an image? Pin
Gulfraz Khan2-Dec-05 2:25
Gulfraz Khan2-Dec-05 2:25 
Hi
I am trying to draw a rectangle over an existing image by using the following code (pb is the PictureBox and has an image)
<br />
 Dim oGraphics As Graphics = Graphics.FromImage(pb.Image)<br />
        With oGraphics<br />
            .DrawRectangle(New Pen(Color.Red, 2), New Rectangle(5, 5, 300, 300))<br />
        End With<br />
 pb.Refresh()<br />


The problem comes when I want to draw another rectangle (at a different location) and I can't remove/clear the existing rectangle before drawing the new one.
Is there any way I can remove the existing drawn rectangle?
I don't want to use the pb.CreateGraphics() b/c the drawing is not consistent when this method is used.
I am using the FromImage() method b/c later I want to resize (zoom) or rotate the image with drawn rectangle and It won't require any further coding for rotating and resizing the rectangle.

I tried reload the Image again, but large images take to much time to load, so I want to avoid the Image reloading.
Please help!
AnswerRe: Is it possible to remove existing graphics from an image? Pin
[Marc]2-Dec-05 4:08
[Marc]2-Dec-05 4:08 
AnswerRe: Is it possible to remove existing graphics from an image? Pin
Roy Heil6-Dec-05 11:22
professionalRoy Heil6-Dec-05 11:22 
GeneralRe: Is it possible to remove existing graphics from an image? Pin
Gulfraz Khan7-Dec-05 2:24
Gulfraz Khan7-Dec-05 2:24 
QuestionIPs Pin
ADY0071-Dec-05 23:44
ADY0071-Dec-05 23:44 
AnswerRe: IPs Pin
Gideon Engelberth7-Dec-05 6:04
Gideon Engelberth7-Dec-05 6:04 
QuestionMonitor CPU Pin
nitin_ion1-Dec-05 22:25
nitin_ion1-Dec-05 22:25 
AnswerRe: Monitor CPU Pin
[Marc]2-Dec-05 3:51
[Marc]2-Dec-05 3:51 
Questionhow can i receive the ip address from a remote client? Pin
yuvalda11-Dec-05 21:16
yuvalda11-Dec-05 21:16 
QuestionDetermine Printer Port Pin
thebread1-Dec-05 20:34
thebread1-Dec-05 20:34 
AnswerRe: Determine Printer Port Pin
Duncan Edwards Jones1-Dec-05 23:08
professionalDuncan Edwards Jones1-Dec-05 23:08 
GeneralRe: Determine Printer Port Pin
thebread2-Dec-05 2:37
thebread2-Dec-05 2:37 
QuestionBinding Textbox with 2 tables. Pin
Bhavna Varshney1-Dec-05 20:22
Bhavna Varshney1-Dec-05 20:22 
QuestionProblem in Image saving Pin
Anindya Chatterjee1-Dec-05 20:18
Anindya Chatterjee1-Dec-05 20:18 
Questionhow to add a combobox to a datagrid column Pin
jayendra_wani1-Dec-05 18:53
jayendra_wani1-Dec-05 18:53 
AnswerRe: how to add a combobox to a datagrid column Pin
abhinish1-Dec-05 20:39
abhinish1-Dec-05 20:39 
Question[Message Deleted] Pin
Roy_Joseph1-Dec-05 18:26
Roy_Joseph1-Dec-05 18:26 
AnswerRe: ms-sql server database-bkp &amp; restore Using VB6 Pin
abhinish2-Dec-05 19:56
abhinish2-Dec-05 19:56 

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.