move a bitmap

move a bitmap

Postby Silvio » Thu Sep 24, 2009 12:13 pm

I want create a test to draw a room ( wall)

look this sample



Code: Select all  Expand view

static oWnd
Function test()
Local nItem,oRBar ,oGr3,oBtn2
DEFINE WINDOW oWnd TITLE "Sala "  from 1,1 to 600,600 pixel
DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Configurazione sala" HEIGHT 160 TOPMARGIN 55

   ADD GROUP oGr3 RIBBON oRBar TO OPTION 1 PROMPT "Pannelli" width 420

     @ 2, 5 ADD BUTTON oBtn2 PROMPT "Orizontale"  BITMAP ".\bitmaps\testsmall.BMP" GROUP oGr3  ROUND SIZE 50,75 ;
     action (nItem :=1)

 SET MESSAGE OF oWnd TO " Class RibbonBar" ;
      CENTERED CLOCK KEYBOARD 2007


         oWnd:bLClicked    = { | nRow, nCol, nFlags | crea_oggetto(nItem, nRow,nCol) }

   ACTIVATE WINDOW oWnd

   oRBar:End()

   return nil




Function crea_oggetto(nItem, nRow,nCol)
   Local oSprite
   Local cBitmap


   DO CASE
   CASE nItem = 1
      cBitmap=".\bitmaps\test.bmp"
   endcase




 @ nRow, nCol BITMAP oSprite;
           FILE cBitmap;
           PIXEL NOBORDER  of oWnd

 oSprite:lTransparent = .T.

  oSprite:Move(oSprite:nTop,;
                  oSprite:nLeft,;
                  oSprite:nWidth(),;
                  oSprite:nHeight())

     oSprite:lDrag  := .T.
     oSprite:bMoved := {|| oSprite:CoorsUpdate()      ,;
                           nBmpRow := oSprite:nTop  ,;
                           nBmpCol := oSprite:nLeft ;
                            }

  return nil




test.bmp

Image




with this test I can insert a bitmap on window and move it

Image








But if I have two bitmaps (the same bitmaps ) and I must draw a line it is too hard to move them

as you can see on this picture

and when I click on each bitmaps I see a hand cursor and I see a big box

It can be hard to draw a line for a sample

How I can make to resolve it ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests