473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

C# - Image and Viewport - Drag Move, Pixel Positons etc

Hello everyone,

I need some help. I have been working on it for some time but havent been able to think of any solution. Even had thought of making do without it, even though it was a major part of my project. To be honest, I am a beginner and hence unawares about many of the stuff. So here is my problem:

I am working on a "PUBLIC TRANSPORT INFORMATION SYSTEM" (In India we dont have one yet for most cities). Currently I am doing it as part of my college project work, but I am interested in extending it further. Most of the stuff I have been able to do, but I am stuck at one point. I want to display the selected route between two places on the map. I want the map to be drag and move (like we have for pdf files). This is since the map of the city is extremely large (3 feet * 2 feet on paper, which I plan to scan. I may reduce the size a little, but not by much as I want the lanes and small roads to be visible with their names).

So, I want the following things to be done (in order of their priority). Please help me out, I really need it.

1> Firstly, I want the large image to be shown in a small viewport using drag and move so as to allow the user to wander through the whole map of the city.

A pic of what I mean is shown here:
http://www.geocities.com/this_is_shailesh/index.html

2> Secondly, I want to be able to move the viewport to a specific area of the map. For e.g., when the user selects a particular place on the map in a drop down list, I want the viewport to move to that part of my map which shows that location.

Currently, the only way I thought it could be done is by mapping the pixel positions for all the places in the drop down list and then moving the viewport such that the corresponding pixel position is the center of the viewport. But I admit, I really dont know how to implement this.

3> Finally, if its posible, is there any way by which I can highlight the selected paths.

My map will be static. So I was thinking on the lines of placing markers on all the stations (overlapping exactly on top), whose visibility can be adjusted on/off. When they are a part of the route, their visibility will be ON, and when not they will be OFF. The markers could be plain coloured circles, so that a series of dots (or circles) will indicate all the stops/stations along the selected path.

But this also I dont know how to implement in code. I have no clue how I can make these markers overlap the stations, esp coz the map will never be shows in its entirety at any time. I mean how do I do the pixel positioning with respect to the image rather than the viewport, which is what is generally done in case of pictureboxes etc.

So if anyone can help, I did be deeply indebted. In anyone knows of any precoded stuff or libraries i can make use of, please do inform. Or else, if you have any alternate suggestions for me, it would be great as I am anyways not making much progress right now.

Thanks a lot in advance. Waiting anxiously :-)
Dec 18 '07 #1
6 5549
Hi
U can use Graphics library like OpenGL.Using OpenGL u can do all the things.

Hello everyone,

I need some help. I have been working on it for some time but havent been able to think of any solution. Even had thought of making do without it, even though it was a major part of my project. To be honest, I am a beginner and hence unawares about many of the stuff. So here is my problem:

I am working on a "PUBLIC TRANSPORT INFORMATION SYSTEM" (In India we dont have one yet for most cities). Currently I am doing it as part of my college project work, but I am interested in extending it further. Most of the stuff I have been able to do, but I am stuck at one point. I want to display the selected route between two places on the map. I want the map to be drag and move (like we have for pdf files). This is since the map of the city is extremely large (3 feet * 2 feet on paper, which I plan to scan. I may reduce the size a little, but not by much as I want the lanes and small roads to be visible with their names).

So, I want the following things to be done (in order of their priority). Please help me out, I really need it.

1> Firstly, I want the large image to be shown in a small viewport using drag and move so as to allow the user to wander through the whole map of the city.

A pic of what I mean is shown here:
http://www.geocities.com/this_is_shailesh/index.html

2> Secondly, I want to be able to move the viewport to a specific area of the map. For e.g., when the user selects a particular place on the map in a drop down list, I want the viewport to move to that part of my map which shows that location.

Currently, the only way I thought it could be done is by mapping the pixel positions for all the places in the drop down list and then moving the viewport such that the corresponding pixel position is the center of the viewport. But I admit, I really dont know how to implement this.

3> Finally, if its posible, is there any way by which I can highlight the selected paths.

My map will be static. So I was thinking on the lines of placing markers on all the stations (overlapping exactly on top), whose visibility can be adjusted on/off. When they are a part of the route, their visibility will be ON, and when not they will be OFF. The markers could be plain coloured circles, so that a series of dots (or circles) will indicate all the stops/stations along the selected path.

But this also I dont know how to implement in code. I have no clue how I can make these markers overlap the stations, esp coz the map will never be shows in its entirety at any time. I mean how do I do the pixel positioning with respect to the image rather than the viewport, which is what is generally done in case of pictureboxes etc.

So if anyone can help, I did be deeply indebted. In anyone knows of any precoded stuff or libraries i can make use of, please do inform. Or else, if you have any alternate suggestions for me, it would be great as I am anyways not making much progress right now.

Thanks a lot in advance. Waiting anxiously :-)
Dec 18 '07 #2
Hi
U can use Graphics library like OpenGL.Using OpenGL u can do all the things.
I dont know much about OpenGL. So could you help me out by giving me some links. I will meanwhile try googling it. Please send me some links :-)
Dec 18 '07 #3
I dont know much about OpenGL. So could you help me out by giving me some links. I will meanwhile try googling it. Please send me some links :-)
Hey i tryd googling it............... but no use. the topic is too vast. I am a newbie............ so u will have to be more helpful :-)
Dec 18 '07 #4
Plater
7,872 Expert 4TB
OpenGL will do the task much faster but you have to learn it.

If you load your scanned image into a Bitmap object, it has properties/functions that could be usefull. Like the CreateThumbnail() which should allow you to create a new Bitmap object with just a smaller section of the big Bitmap
Dec 18 '07 #5
hey i am complete newbie........... could you please direct me to some pages regarding whatever methods you are suggesting........

p.s. can i not use a dll that someone has made. if yes, anyone knows of any i can use??
Dec 19 '07 #6

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

Similar topics

5
by: Aaron | last post by:
I have a div with an image which needs to appear in it's bottom left. I currently have the padding top of the image set to 100%, which should move the image to the bottom of the the div, but for...
8
by: **Developer** | last post by:
Seems that Dot.net can not handle files of Indexed Pixel Format as well as other types of formats. Given a file or and Image of type Indexed Pixel Format is there a method to convert it to some...
4
by: MrNobody | last post by:
Let's say I have an image which is monochrome with areas of white, black and shades of gray. Now I want to turn all the white parts into some RGB color but it also needs to be darkened by the gray...
10
by: Enrique Cruiz | last post by:
Hello all, I am currently implementing a fairly simple algorithm. It scans a grayscale image, and computes a pixel's new value as a function of its original value. Two passes are made, first...
3
by: Anoopnegi | last post by:
hi frds how can i access a colored jpeg image through a simple c program and i also wants to extract its pixel martix.
3
by: Martin | last post by:
I have an application that generates a page with an embedded SVG image in it. The image (the viewport) is intentionally larger than the screen (the browser's window size). I would like to provide...
5
by: kidko | last post by:
I'm just trying to move a few images around a page... The images already exist, and the following function simply assigns them an ID and sets their offsetTop/offsetLeft attributes. This works for...
1
by: GriffinWolf | last post by:
Hi, I am using VB6 for a school project. In my program, certain objects (currently Image boxes) need to be dragged to other areas of the screen. If they are placed over another image, they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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...

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.