473,396 Members | 1,766 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,396 software developers and data experts.

resizing and zorder(vb6)

27
i have a problem regarding resizing of images that is to be displayed using the picture box.

i also have a problem about the dragging and dropping method because the images tend to drag to a different location.

this is my drag n drop code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Picture28_DragDrop(Source As Control, X As Single, Y As Single)
  2.     If X > X1 Then Source.Left = Source.Left + (X - X1) Else Source.Left = Source.Left - (X1 - X)
  3.     If Y > Y1 Then Source.Top = Source.Top + (Y - Y1) Else Source.Top = Source.Top - (Y1 - Y)
  4. End Sub
  5. Private Sub Picture28_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  6.     X1 = X
  7.     Y1 = Y
  8.     Picture28.Drag
  9.     Picture28.ZOrder
  10. End Sub
thank you for your help
Jul 31 '07 #1
4 8390
Killer42
8,435 Expert 8TB
i have a problem regarding resizing of images that is to be displayed using the picture box.
You didn't say what the problem is. I can give you two things to think about though, in relation to image resizing.
  1. Use Image control rather than PictureBox. Check out the Stretch property.
  2. PaintPicture method.

i also have a problem about the dragging and dropping method because the images tend to drag to a different location.
I think I know this one. When you drop, it just drops the image with the top-left corner at the mouse position, correct?

If you are only dragging within your application (not dropping images onto your application from somewhere else) then that's easy to get around. When you pick up (start drag), record the position of the mousepointer within the control. When you drop, offset the location by that amount (negative).

What does Zorder have to do with the question?
Jul 31 '07 #2
akynaya
27
im really sorry if my questions are to broad and not that clear... i havent had a decent sleep these days...

anyway, im going to really clear this one...

im using a picture box because most of my images are in bitmaps. although an image box is really handy and more versatile in terms of space consumption in the memory...

anyways, the problem in resizing is that my teacher wants the images that i've loaded be resizable like those images in word or in visio, edraw...

the problem with z order is that i've use it so as to prioritize the image that was being clicked by the user but unfortunately the drag n drop method is quite not in order.

i would highly appreciate your help..... THANK YOU
Aug 1 '07 #3
akynaya
27
i forgot to tell you about the drag n drop method that i've used, well, i need it so as to let the user drag or drop the object anywhere within the picturebox which is my set work area.

the drag and drops works but if you'd click another image for the same purpose of dragging n droping, that's when the problem arises...

the problem is that both of the pictures/images doesn't drag n drop to where the other image is and i am supposed to enable the images to drag n drop regardless whether another picture is in place.
Aug 1 '07 #4
Killer42
8,435 Expert 8TB
So if I'm reading this correctly, the basic problem is that when you drop a picture on top of another one, it is detected by that picture instead of the form.

If that is so, I don't know whether there's any way to avoid it (haven't had a lot of experience with D&D) but it might be possible to work around it by having the pictures detect another one being dropped on them, and pass it along to the form.

I suspect your best bet might be to set up a generic "DropImageAtLocation" sub, which accepts all the information necessary to drop the currently dragged image at the specified location on the form. If an image detects the drop, it can adjust the location based on where it is, and pass that along to the routine.

For example, say an image is sitting at location (5,5). If another one is dropped on it at location (15,40) it would adjust that to (20,45) and then tell the routine to drop it there.
Aug 4 '07 #5

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

Similar topics

0
by: Leonard Challis | last post by:
Good morning everyone I am currently doing quite a large project in VB6 and ACCESS for college, for a Photographers company assignment. I am posting here to see if anyone has any advice on what...
1
by: soorya | last post by:
Dear All VC++ and C++ Gurus ! can any one help me by coding a Dll in C++ to use in VB6 ? Since "Video Mixer Renderer 9" (VMR 9) can't be directly used in VB6, i need a wrapper dll. one...
4
by: Captain Chaos | last post by:
Hello Is it Possible to build an ActiveX Control with NET ? I want to take a NET UserControl and use it with VB6. I found a solution how to embbed a NET UserControl into a WebPage (Like it...
3
by: JeffR | last post by:
I created a user control in VB .NET and put a COM wrapper around the control so that a VB6 client could dynamically add the control to a form. The only thing I haven't figured out is if the VB...
1
by: Simon Jefferies | last post by:
Hello, How can you prevent the resizing of a custom UserControl on a form? At the moment, I am resetting the width and height in the SizeChanged event. There must be a better way, there used...
1
by: David Whitchurch-Bennett | last post by:
Hi there, I am writing an custom designer, and need a rubber band to select controls. I am drawing the rubber band by using the Graphics object on the user control where the other controls sit...
22
by: Kevin | last post by:
Hi, I'm making an administrational software program in VB6 and was wondering if there is a way to display a (borderless) form inside a frame on another form, or to load the contents of a frame...
3
by: JT | last post by:
have a VB6 project that on the form I have set the BorderStile to 2 - sizable and created a function to resize the form and its controls min or max. Although, I am trying to find a way to...
2
by: Haren786 | last post by:
VB6 Form resize diable user from manually resizing it?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.