|
mobius111001 wrote: is there a better solution?
I have always found using a source control product very productive.
led mike
|
|
|
|
|
Yes you can. I do. Otherwise, I can't step into that code while debugging.
|
|
|
|
|
Can anyone give me a detailed step by step procedure to deploy a C# application in visual studio 2005 with sql server 2005 databse ? I had developed an application but I can't deploy it because I don't know the procedure to deploy it. When I deploy it is working on my machine but on client's pc it throws an exception that cannto Login to the database.
|
|
|
|
|
|
i need to change mouse cursor outside form.
how can i do it?, can i use user32.dll?
please give some tip or hint or example to me.
thanks a lot....^^
|
|
|
|
|
ping_jacob wrote: change mouse cursor outside form
What do you mean?
only two letters away from being an asset
|
|
|
|
|
|
Hello,
how can I link a hscrollbar to a picturebox ? (I need to get the offset from hscrollbar.Value, so that I can calculate the horizontal coordinates of a point in the image) I believe I must use an OnPaint event, but do not know how to use it. A portion of code would be appreciated.
thanks
pcjd
|
|
|
|
|
Are you asking how to determine the clicked point on an image, even if the image is larger than the area it's being displayed in and the image is scrolled to one side??
If so, you don't need the scroll offset.
Create a UserControl, put a Panel on the UserControl and set it's AutoScroll property to true. Then put another Panel inside the first one. Expose a property in the UserControl to take an Image. In the setter for the Image, set the second Panel's size to match the image size. Now, when you click on the second Panel (the one showing the image), you handle the Click property of that Panel control. You'll get the coordinates of the click, relative to the upper left corner of the image Panel.
|
|
|
|
|
Hello,
yes I am trying to get the coordinates of a clicked image - the absolute
coordinates - not those relative to the top corner of the panel, but
relative to the top corner of the image when I've scrolled way past it. I've already tried your method, which is why I want the offset.
thanks
pcjd
|
|
|
|
|
Offset relative to what?? I don't understand your explanation.
|
|
|
|
|
Hello,
I want to get the coodinate (horizontal only) of a point on the image
after I have scrolled a certain way along the X-axis of the image. So
initially, the image is displayed (perhaps showing a range of X values from 0 to 500). As I scroll along the image, using your method, the X coordinate I want would be (clicked value of X + scroll bar offset) - as the clicked value of X only gives the coordinated relative to the panel and NOT the image. As an aside, I have already done this in Delphi 6, but this is a port to C#, and it appears that I will need to use hscrollbar and get its offset from hscrollbar.Value, as it appears this cannot be obtained from the panel scrollbar.
regards
pcjd
|
|
|
|
|
You don't need the scrollbar values. I've done the very same thing wihtout them, well getting the clicked offset anyway. Since the panel is exactly the size of the image, you get the coordinates of where the user clicked in the panel, relative to the top left corner of the panel. This translates to getting the coord's in the image itself.
I'm failing to see where the problem is and why you think this doesn't work.
|
|
|
|
|
Hello,
maybe I'm doing this incorrectly. Just to summerise, I have two panels,
the outer panel1 has Autosize = true, the inner panel2 has panel2.BackgroundImage = (Image)MyImage. I've set the width of the outer panel to 775, and the inner panel to 2000 (which is enough for all images). After I initially load an image and I click on a specific point on the right of the image I get the cursor position as 650,446. If I then scroll the image, but still keeping this point in view, clicking on it gives a cursor position of 340,446 (the point has visually moved to the left). The absolute value should be 650 + (scroll offset), not 340. Hope I'm making myself clear.
regards
pcjd
|
|
|
|
|
pcjd63 wrote: outer panel1 has Autosize = true,
Useless as you set the absolute size of the panel. Did you actually mean to say you set the AutoScroll property to true?
pcjd63 wrote: the inner panel to 2000 (which is enough for all images).
You would normally set this inner panel to the same size as the image itself when you set it's background image property to the image.
pcjd63 wrote: I click on a specific point on the right of the image I get the cursor position as 650,446. If I then scroll the image, but still keeping this point in view, clicking on it gives a cursor position of 340,446 (the point has visually moved to the left). The absolute value should be 650 + (scroll offset), not 340. Hope I'm making myself clear.
It would appear that you're handling the click event of the wrong panel. You need to handle the click of the INNER panel, not the outer one.
I've done this myself, creating a UserControl that does exactly this, and a lot more. Whenever you click on the image being viewed, it fires off an ImageClick event with the coordinates of the mouse click relative to the image, not the outer panel, and all I did was raise the new ImageClick event, reusing the MouseEventArgs.Location property given by the inner panel's Click event.
|
|
|
|
|
Hello,.
yes, sorry, it was a typo, I meant Autoscroll, not AutoSize.
All of the images are of a fixed (large) width, which is why I set the width of the inner panel to 2000.
I am handling the click event of the inner panel, and whether I use
Cursor.Position.X or MousePosition.X I get the same X values, which are relative to the panel, not the image.
if you are getting the correct absolute coords - I must be doing something wrong.
thanks for your patience
pcjd
|
|
|
|
|
If you're handling the mouse click of the inner panel, no matter where you click on it, repeatedly, the mouse coord's will not change with the scrolling of the outer panel.
Next, why are you settings the size of the inner panel so much larger than the actual image contained within?? Just set it's size to the size of the image and you won't have to do any funky math to get the coords mapped to the image.
I told you everything I'm doing. It's as simple as my description.
|
|
|
|
|
<if you="re handling the mouse click of the inner panel, no matter where you click on it, repeatedly, the mouse coord" s="" will="" not="" change="" with="" the="" scrolling="" of="" outer="" panel.="">
Eactly, this is what I'm trying to get round by using hscrollbar, as by using Autoscroll=true, there is no way to get the scrollbar position (offset)
<next,>
Doesn't make any difference whether I fix the panels width, or set it to the image width (all images have the same width anyway)
the 'funky math' is simply the addition of the scrollbar value (hScrollBar1.Value) to the X coodinate of the clicked point.
thanks for your help - lets call it a day
regards
pcjd
|
|
|
|
|
Hi guys,
I have a sql image field where I am saving pdf's to. I am now trying to archive these by converting them back to pdf's. I haven't been able to find any resources on how to do that. Please if anybody knows how to do this then I will appreciate it.
Thanks in advance
Sameer
|
|
|
|
|
Google for "save image to SQL database VB.NET". You'll find a tons of examples. A PDF file is no different than handling an image file.
|
|
|
|
|
I wasn't trying to save images/pdf's, I am doing that already, I was trying to extract them back to pdf's. I got it to work, thank you.
Sameer
|
|
|
|
|
Yep, and just about all the examples I've seen have the cofde to do BOTH sides of the operation, save and retrieve.
|
|
|
|
|
|
You are a life saver. Thank you very much.
Sameer
|
|
|
|
|
You are welcome
|
|
|
|