ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 how to move backgroud grid with image?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
winner Posted - Oct 27 2012 : 06:39:27
I draw grid line in backgroud by DrawBackBuffer. then I draw some vectorial shapes such boxs /lines.I want to when the image move,for example ,I drag the scroll bar,the image can scroll,I want to the
backgroud can move together,how to do it ? thanks
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 30 2012 : 01:47:05
Hi

You are not using the values you assign to OffX and OffY to offset your grid drawing.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Oct 29 2012 : 18:52:15
I do not see any supported way to not maintain the objects postion when ViewX or ViewY is changed because it is the default behavior of the component to move the object when the view changes.

You might try repositioning all of the objects ObjLeft and ObjTop in ImageEnVect1ViewChange or in ImageEnVect1BeforeDrawObject or in ImageEnVect1AfterDrawObject.

ImageEnVect1.ObjLeft[hobj] =
ImageEnVect1.ObjTop[hobj] =

I tied to do this for awhile but I could not get the objects to maintain position.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
winner Posted - Oct 29 2012 : 14:30:08
I use follow code to draw grid


procedure TfrmMain.img1DrawBackBuffer(Sender: TObject);
var
  i,j: integer;
  pt: TPoint;
  z:Double;
  offx,offy:DOUBLE;
begin
  if not btnGridShow.down then
  begin
    z:=img1.Zoom / 100;

     if img1.Zoom<80 then
     begin

     end
     else
     begin
      with img1.BackBuffer.Canvas do
        begin
          if img1.ViewX =0 then
          begin
            offx:=0;
          end
          else
          begin
          offx:=((img1.ViewX mod 10)) ;
          end;
          if img1.ViewY = 0 then
          begin
            offy := 0 ;
          end
          else
          begin
           offy:=((img1.ViewY mod 10)) ;
          end;

          Pen.Color := clNavy;
          Pen.Mode := pmNotXor;
          MoveTo ( 0, 0 );
          for i := 0 to 120 do
          begin
            MoveTo ( 0,  Trunc(i*11.811*z) ); // draw rows
            LineTo ( Trunc(1200*Z),Trunc(i*11.811*z) ) ;
          end;
          MoveTo ( 0, 0 );
          for i := 0 to 100 do
          begin
            MoveTo ( Trunc(i*11.811*z),0   ); // draw rows
            LineTo ( Trunc(i*11.811*z),Trunc(1000*Z )) ;
          end;
        end;
     end;
  end;
end;

xequte Posted - Oct 29 2012 : 02:49:18
Hi

What is your code for drawing the grid?

Ensure that you do it relative to the scroll position using ViewX and ViewY:

http://www.imageen.com/help/TImageEnView.ViewX.html


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
winner Posted - Oct 28 2012 : 00:09:09
I want to the grid with the rule,how do I draw the grid?


4.19 KB