GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop
GDI+ Drag and Drop GDI+ Drag and Drop
GDI+ Drag and Drop
Go Back  Xtreme Visual Basic Talk > > > GDI+ Drag and Drop


Reply
 
Thread Tools Display Modes
  #21  
Old 07-06-2006, 06:46 AM
jo0lsGDI+ Drag and Drop jo0ls is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Feb 2005
Location: London
Posts: 1,050
Default


I tried the code that you sent on four computers and it worked.
I think it must be due to graphics card driver differences. To see if this is the problem, you could try disabling graphics card acceleration:

right click desktop, properties, settings, advanced, troubleshoot -> slide the slider to disable acceleration. (It works without acceleration on my computers).

You could update your graphics card driver, and try that.

Better though would be to simplify the routine that creates the cursors so that it works without asking the users to mess about with drivers.
At the moment we pad the cursor with transparency to get the hotspot at the point clicked on the image. I'd bet that the transparency is causing the problem with the driver, or possibly it is because the padded image creating the cursor is not always square.
It will be worth trying two approaches:
- Discard all the padding and hotspot stuff, the custom cursor will be the same size as the image, with the normal cursor on top. The image will jump when you start the drag, but the drop will be precise.
- Keep the padding, make sure the cursor is square. (It might need to be even more complicated - make sure it is a certain size of square).

The framework definately needs better support for cursors (and icons, cursors are just icons with hotspots).

The previous selection rectangle does persist sometimes with your code.
I'll fix the problems in my example and attach it later...
Reply With Quote
  #22  
Old 07-06-2006, 01:38 PM
jo0lsGDI+ Drag and Drop jo0ls is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Feb 2005
Location: London
Posts: 1,050
Default

Ok, here's the simplified version. I've stopped using the drawReversibleRectangle, instead we just draw a rectangle in the paint event. Doing it this way means it gets redrawn when required.
The cursor is just the image...
Attached Files
File Type: zip DragDrop2.zip (37.7 KB, 568 views)
Reply With Quote
  #23  
Old 07-06-2006, 02:23 PM
furjaw furjaw is offline
Regular
 
Join Date: Mar 2006
Location: Painesville, OH
Posts: 51
Default

It works perfectly, now!!!

In DragObject.vb, I commented out CreateCursors() and added the 2 lines after it.

Public Sub New(ByVal hotspot As Point, ByVal image As Bitmap)
m_image = image
m_hotspot = hotspot
'CreateCursors()
m_normalCursor = New Cursor(m_image.GetHicon)
m_size = m_image.Size

End Sub

This program does it all! And it works perfectly! GREAT JOB!!!
Reply With Quote
  #24  
Old 07-18-2006, 10:57 AM
furjaw furjaw is offline
Regular
 
Join Date: Mar 2006
Location: Painesville, OH
Posts: 51
Default

When my objects are rotated, they lose some of their sharpness. Can bicupic interpolation be specified? That would solve the problem.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop GDI+ Drag and Drop
GDI+ Drag and Drop
GDI+ Drag and Drop
 
GDI+ Drag and Drop
GDI+ Drag and Drop
 
-->