473,480 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

auto zooming the drawing result

2 New Member
Hi

I wrote a program in VB and after runnig ,it draw a shape ,now i wonder to know how i can zoom this drawing because sometimes it become very tiny and i can not see it ,so is there any way to define auto zoom for my drawing resualt?

Regards

Ali
Feb 25 '08 #1
4 1350
debasisdas
8,127 Recognized Expert Expert
Where are you drawing the shape ?

I mean which control ? And what version of VB you are using ?
Feb 25 '08 #2
Killer42
8,435 Recognized Expert Expert
Yes, the answer would depend on how/where you are drawing the image, and in what version of VB.

For instance, in VB6, if the image is in a picturebox (with AutoRedraw turned on), it might be as simple as copying it to an image control with the Stretch property turned on.
Feb 26 '08 #3
agpkd2001
2 New Member
Hi

Thank you for considering me,actually,i wrote my code in VB 2008 as follows:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form4_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  2.         Dim ElemNo As Integer
  3.         Dim a As Integer
  4.         ElemNo = Form3.TB_ElementDataGridView.RowCount - 1
  5.         Dim ElemID(ElemNo - 1) As Integer
  6.         Dim ElNode1(ElemNo - 1) As Integer
  7.         Dim ElNode2(ElemNo - 1) As Integer
  8.         Dim ElArea(ElemNo - 1) As Decimal
  9.         Dim MatID(ElemNo - 1) As Integer
  10.         For a = 0 To ElemNo - 1
  11.             ElemID(a) = a + 1
  12.             ElNode1(a) = Form3.TB_ElementDataGridView.Rows(a).Cells(1).Value
  13.             ElNode2(a) = Form3.TB_ElementDataGridView.Rows(a).Cells(2).Value
  14.             ElArea(a) = Form3.TB_ElementDataGridView.Rows(a).Cells(3).Value
  15.             MatID(a) = Form3.TB_ElementDataGridView.Rows(a).Cells(4).Value
  16.             ' MessageBox.Show("ElemID( " & (a + 1) & ")=" & ElemID(a))
  17.             'MessageBox.Show("ElNode1( " & (a + 1) & ")=" & ElNode1(a))
  18.             'MessageBox.Show("ElNode2( " & (a + 1) & ")=" & ElNode2(a))
  19.             'MessageBox.Show("ElArea( " & (a + 1) & ")=" & ElArea(a))
  20.             'MessageBox.Show("MatID( " & (a + 1) & ")=" & MatID(a))
  21.         Next
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.         '"Starting Calculation"
  33.  
  34.  
  35.  
  36.  
  37.         Dim Nodeno As Integer
  38.         Nodeno = Form1.TB_NodeDataGridView.RowCount - 1
  39.         Dim Xcoordinate(Nodeno - 1) As Decimal
  40.         Dim Ycoordinate(Nodeno - 1) As Decimal
  41.  
  42.  
  43.         For a = 0 To Nodeno - 1
  44.             Xcoordinate(a) = Form1.TB_NodeDataGridView.Rows(a).Cells(1).Value
  45.             Ycoordinate(a) = Form1.TB_NodeDataGridView.Rows(a).Cells(2).Value
  46.         Next
  47.  
  48.  
  49.         Dim redpen As New Pen(Color.Blue, 10)
  50.         For a = 0 To ElemNo - 1
  51.  
  52.             Me.CreateGraphics.DrawLine(Pens.Red, Xcoordinate(ElNode1(a) - 1), -Ycoordinate(ElNode1(a) - 1), Xcoordinate(ElNode2(a) - 1), Ycoordinate(ElNode2(a) - 1))
  53.             Me.CreateGraphics.TranslateTransform(200, 250)
  54.             'MessageBox.Show(L(a))
  55.  
  56.         Next
  57.     End Sub
Regards,

Ali
Feb 27 '08 #4
daniel aristidou
491 Contributor
Hmmmmm.....vb2008 (my favorite so far)

Well .... you could try instead using:
Use a print previeiw dialog box
Create the graphic on print-document control
open the print dialog box and then zoom on that.....


However i'm certain there is a better way of doing it and i'll get back after some research
Feb 27 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2737
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
0
1506
by: Gopi | last post by:
Hi All I have set a BackgroundImage for windows forms and i need to implement the image zooming feature for the form ie when ever i m zooming in or zooming out the form the corrosponding...
3
19969
by: anastasia | last post by:
I get an out of memory exception when attempting to excecute the following code: original = System.Drawing.Image.FromFile(file.FileName,true); I ONLY get this exception when the file is in the...
0
1289
by: gerstla | last post by:
hi I am building a simple control to view images with zooming capabilities. i want the image to zoom when it is clicked on. after zooming i want the control to try and move the point clicked to the...
0
1774
by: pavanjosh | last post by:
Hello Frineds, Can anyone please help me in getting the code or library for written in C# for zooming in and zooming out the images in the picture box? Or is there any other way from which i can...
4
10104
by: =?Utf-8?B?U3BlZWR5?= | last post by:
Hi there, I am currently writing an application where one inspects images and annotates certain features. Thus, one has to zoom in (4x) and pan around. The features are marked with little red...
0
997
by: sorab | last post by:
I hav created a bimap image at run time using graphics object in vb.net. i display that image in the picture box i have also implemented few mouse events on that image. e.g. I can draw lines with...
0
1592
by: johot | last post by:
I am currently creating a little photo application. In this application the user is able to zoom in the image and after zooming panning around inside the zoomed image with the mouse. The strange...
4
8551
by: alarock | last post by:
how can i do Zooming of a particular area using OnMouseWheel (that is zooming a mouse wheel point that should come into view with zoom ) using C# Regards, ALGATES
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.