I have Bitblt 75 pictures on my form. I want to be able to get the name of each picture as I drag my pointer over it! I think it would be best to use a class module but not sure.
Please provide code for this.
Printable View
I have Bitblt 75 pictures on my form. I want to be able to get the name of each picture as I drag my pointer over it! I think it would be best to use a class module but not sure.
Please provide code for this.
I've Just got back from the pub so I'm really not in the mood to write some serious Code for you but I'm assuming you know how to use a class module and yeah, It's exactly what you need to use. set one up, give it a DC, a Rectangle (in VB Coords, let it do its own converting )a checkpoint function which checks if a point is in the classes area and make the class module subclass the form it's in to check for Paint events, It's entirely up to you whether you check for the mouse in the subclassing or use the mouse move event and check each object through a collection,If you want to re use the class It's best if you code both and let the user decide which method to use.
Hope this helps.
You don't need to subclass anything if you can make your form cowork with you classes, like sending them events.
Thanks Sam and Kedaman!
I still need your help? I am still lose on the concept of DC. Therefore, I can not assign a tooltip to my picture.
Bottom of the line, I am just pasting a bunch of pictures and want to get the name of the picture as I drag across.
Hi Nitro,
I don't know if this is gonna be be of any help but, i recall when i looked at the drag and drop samples it used a label control as the dragicon when actually (during the drag operation) dragging across, would it not be possible to set the caption property of the label (the dragicon) to the filename/picture being dragged?
Hope i'm not confusing the issue
DocZaf
{;->
Thanks for the Reply Zaf!
I want to stay away from controls because my program is dynamic. It might have load up to a hundred pictures which in return means it has to load a hundred label controls.
I was doing this before with image controls but realize it would much more efficient to just paint the picture on the form. The problem now is that I can't use the image control's "ToolTipText" property.
Thanks Again.
Sorry my Brother's down at the moment so I can't get at my machine because he's usually playing pinball. He's Going away tomorrow so I can Do some code but I'm not sure exactly what your trying to do. What you're saying sounds a lot like the image control. Especcially if you want tooltips (have you noticed that a form doesn't have a tooltiptext property and I don't know how to do it with the API which you'd have to do if you don't want to use image controls. You won't save much memory using a class rather than image controls.Post up exactly what you're trying to do and I'll see what I can suggest.
Thanks Sam!
Well basically, I have a program that is loading in a directory of picture files. I was using image control before, but by the 50 picture, it started to get tremendously slow because the use of memory. Kedaman recommended using "BitBlt". Therefore, I tried his method and true indeed the pictures get painted on much quicker.
Anyway to go into detail. When I click on an image control in my original program, it would open another form and load that picture file on to that form with the information of my colleagues on the bottom.
All I need to know is how to click on a painted picture and load it into the other form. Plus, I also need to drag the painted picture to another location. That is easy because once I get the file name, I can just "BitBlt" it into another section of the form.
Bottom of the line, I need to assign a unique name and coordinates to the painted picture and also be able to obtained.
BTW...
When I use the term painted picture means I "BitBlt" it on the form.
Truly appreciated!
[Edited by Nitro on 04-18-2000 at 04:59 PM]
Just put up a load of image controls without pictures in them where the images will be. then you can bitblt to put the pictures on the form and you can use the image controls to handle the events.
Kedaman recommend not to load so many image controls like the way I have it right now. I must agree with him because after loading 50 image controls, it would slow the program down.
I am talking about hundreds of jpg files here.
If I misunderstood you, I am sorry. Just that I am trying to create something similar to Paing Sho Pro when it does a browse on the directory.
Have you thought about using the listview control, It's exactly like the windows explorer interface but you can use it in your progect, you can set the icons to your jPegs, I think you'll have to do some skillful work with the imagelist control to pull it off but you get a nice windows interface on your program and it'l use much less memory, I'm not too hot with these controls (I had to look up what the List view control does) so I'm not the guy to explain how but that's the way to do It, If you want to do all the coding yourself you're in the wrong language.