×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

VC-- Coordinate transformation problem

本文发表在 rolia.net 枫下论坛Hi! every body, thanks in advance:

My problem is:

1. a new class CSeed is inherited from CObject (in order to exchange the date dynamically). there is a Draw method according to the member variable Position.

2. In my document there is a CObList member to manage the information of the seeds.

3. In my class CScrollView (multi -doc):
a)respond to the message WM_LBUTTONDBLCLK to create seeds on the screen, and store all the seeds in the CObList.
b)OnDraw to draw all the seeds by extracted the information from the COblist.

the Problem is:
All seed positions responding to left double click are changed.
for example:
when the scroll bar at middle of the window, double click to draw a seed at (x, 10) relative to the corrent view (note: the position on the canvas is not sure). when the scroll bar change position , the OnDraw methods reapint the seeds at the Point(x, 10) on the canvas, however I wish the seeds is still at the original pos relative to the canvas.

I had use the DPtoLP to change the coordinate. however it does not work.更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / VC-- Coordinate transformation problem
    本文发表在 rolia.net 枫下论坛Hi! every body, thanks in advance:

    My problem is:

    1. a new class CSeed is inherited from CObject (in order to exchange the date dynamically). there is a Draw method according to the member variable Position.

    2. In my document there is a CObList member to manage the information of the seeds.

    3. In my class CScrollView (multi -doc):
    a)respond to the message WM_LBUTTONDBLCLK to create seeds on the screen, and store all the seeds in the CObList.
    b)OnDraw to draw all the seeds by extracted the information from the COblist.

    the Problem is:
    All seed positions responding to left double click are changed.
    for example:
    when the scroll bar at middle of the window, double click to draw a seed at (x, 10) relative to the corrent view (note: the position on the canvas is not sure). when the scroll bar change position , the OnDraw methods reapint the seeds at the Point(x, 10) on the canvas, however I wish the seeds is still at the original pos relative to the canvas.

    I had use the DPtoLP to change the coordinate. however it does not work.更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • Thanks I had solve the question--forget using OnPrepareDC