Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
AnswerRe: Regarding DropDown in Grid Pin
paas2-Dec-08 3:17
paas2-Dec-08 3:17 
QuestionGDI+ Pin
vinay_K1-Dec-08 17:39
vinay_K1-Dec-08 17:39 
AnswerRe: GDI+ Pin
V.1-Dec-08 19:58
professionalV.1-Dec-08 19:58 
GeneralRe: GDI+ Pin
vinay_K1-Dec-08 21:19
vinay_K1-Dec-08 21:19 
GeneralRe: GDI+ Pin
Christian Graus1-Dec-08 21:22
protectorChristian Graus1-Dec-08 21:22 
GeneralRe: GDI+ Pin
V.1-Dec-08 21:41
professionalV.1-Dec-08 21:41 
GeneralRe: GDI+ Pin
vinay_K1-Dec-08 22:50
vinay_K1-Dec-08 22:50 
GeneralRe: GDI+ Pin
Simon P Stevens1-Dec-08 23:18
Simon P Stevens1-Dec-08 23:18 
Your missing the point. You can't just specify that you want to zoom into an area on the form that you have already drawn, GDI doesn't support this. What you have to do, is clear the form, and redraw the area you want, but bigger.

You can capture x1,y1 x2,y2 mouse coordinates by handling the mouse down or mouse click events.

Now you have the values, clear the form. (by calling .Clear(); on your Graphics object, and redraw your sine wave, bigger, and just the bit within the mouse coordinates you found out.

E.g if your form is 1000 pixels wide and 1000 high, and you've drawn a sign wave from 0 to 360. If the user then picks to zoom in to 0,0 (top left corner) to 500,1000 (bottom in the middle). You need to then work out that 500 represents half way, which is 180 on your x axis. And that 1000 represents the whole distance (i.e. all the way from 1 to -1), you then clear the image, and redraw the sine wave from 0 to 180, but expanded to fill the whole form.

Basically, you need to store scale factors and position factors that you scale and move you sine wave by when redrawing it each time.

Simon

GeneralRe: GDI+ Pin
V.1-Dec-08 23:29
professionalV.1-Dec-08 23:29 
GeneralRe: GDI+ Pin
vinay_K2-Dec-08 0:04
vinay_K2-Dec-08 0:04 
QuestionRe: GDI+ Pin
vinay_K2-Dec-08 2:09
vinay_K2-Dec-08 2:09 
QuestionExecuteReader: Connection property has not been initialized? Pin
dec821-Dec-08 16:42
dec821-Dec-08 16:42 
AnswerRe: ExecuteReader: Connection property has not been initialized? Pin
Dave Kreskowiak1-Dec-08 16:55
mveDave Kreskowiak1-Dec-08 16:55 
AnswerRe: ExecuteReader: Connection property has not been initialized? Pin
Mbah Dhaim1-Dec-08 17:15
Mbah Dhaim1-Dec-08 17:15 
GeneralRe: ExecuteReader: Connection property has not been initialized? Pin
dec821-Dec-08 18:13
dec821-Dec-08 18:13 
GeneralRe: ExecuteReader: Connection property has not been initialized? Pin
Mbah Dhaim1-Dec-08 19:28
Mbah Dhaim1-Dec-08 19:28 
GeneralRe: ExecuteReader: Connection property has not been initialized? Pin
dec821-Dec-08 20:45
dec821-Dec-08 20:45 
GeneralRe: ExecuteReader: Connection property has not been initialized? Pin
N a v a n e e t h1-Dec-08 21:07
N a v a n e e t h1-Dec-08 21:07 
GeneralRe: ExecuteReader: Connection property has not been initialized? Pin
Mbah Dhaim1-Dec-08 23:43
Mbah Dhaim1-Dec-08 23:43 
Questionabout Microsoft Project plan files Pin
namutikare1-Dec-08 16:37
namutikare1-Dec-08 16:37 
AnswerRe: about Microsoft Project plan files Pin
Christian Graus1-Dec-08 20:41
protectorChristian Graus1-Dec-08 20:41 
QuestionDataTable.Select Pin
jesarg1-Dec-08 12:09
jesarg1-Dec-08 12:09 
AnswerRe: DataTable.Select Pin
Andrew Rissing1-Dec-08 14:16
Andrew Rissing1-Dec-08 14:16 
QuestionRe: Creation date time Pin
electriac1-Dec-08 11:50
electriac1-Dec-08 11:50 
AnswerRe: Creation date time Pin
Luc Pattyn1-Dec-08 12:18
sitebuilderLuc Pattyn1-Dec-08 12:18 

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.