subject it self
coz' i post msg. here but i did not find any reply. and any new post from
other also.
thanks.
Remember the people here are volunteers. They help for free.
Perhaps no one wanted to sort through your 'big headache' to find
the problem or, those that are familiar with map modes have not
yet viewed your post....
What you posted included mapmodes, creating memory DC and
bitmaps, painting with brushes, copying bitmaps and handling
mouse events. Maybe if you post a smaller demo, of just the
_problem_ you have, others might try it.
LFS
Have pasted your code into a vb-project, ...
and after fixing all the posting-linebreaks I
saw only a commandbutton and some coordinates
in the top-left-corner (only partially visible because
of the CommandButton).
What do you want to demonstrate with this example?
I have no clue - please describe in more detail what
you really want to achieve.
Olaf
Thanks for respond.
> Have pasted your code into a vb-project, ...
> and after fixing all the posting-linebreaks I
> saw only a commandbutton and some coordinates
> in the top-left-corner (only partially visible because
> of the CommandButton).
>
> What do you want to demonstrate with this example?
When user Click (Mouse Down) and Move to another Point and (Mouse Up) it
store Coordinate.
and when you click on command button it create Memory DC (mDc) by given
size. the size is MouseDown Pt and MouseUp pt.
> I have no clue - please describe in more detail what
> you really want to achieve.
the propblem is here i want to create Multipal mDc in form as per given
size and position.
the size and position come with 2 point if you see in code you can see
Point1 is MouseDownPt
Point2 is MouseUpPt
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
MouseDownPt.X = X ' <================
MouseDownPt.Y = Y' <================
ClickPt = MouseDownPt
Call DPtoLP(CurDC.mDC, ClickPt, 1&)
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y
As Single)
MouseUpPt.X = X
MouseUpPt.Y = Y
End Sub
i want Logical Coordinate Y is up so i use mapmode.
that all about it.
with out useing mapmode is work fine. but when you use mapmode. it goes
worng.
>
> Olaf
>
>
> Remember the people here are volunteers.
I know.
>They help for free.
> Perhaps no one wanted to sort through your 'big headache' to find
> the problem or, those that are familiar with map modes have not
> yet viewed your post....
Yes.
> What you posted included mapmodes, creating memory DC and
> bitmaps, painting with brushes, copying bitmaps and handling
> mouse events. Maybe if you post a smaller demo, of just the
> _problem_ you have, others might try it.
I try.
i post this subject bcoz' i did not seen any new post here.
i was aspecting if any one post similary problem and i can find my solution
from that post.
Thanks.
> i want Logical Coordinate Y is up so i use mapmode.
> that all about it.
Did you try initializing the form (in Form_Load):
Me.Scale(0, Me.ScaleHeight)-(Me.ScaleWidth, 0)
That command will cause the mouse to register greater
values of Y for higher positions of the mouse....
LFS
Thanks for reposond.
but
> Me.Scale(0, Me.ScaleHeight)-(Me.ScaleWidth, 0)
this is not for the memory DC and setmapmode
it will work if i use form hdc with not mapmode.
thanks.
Amrit
CreateCompatibleBitmap() (and AFAIK BitBlt() too) only works with pixel
values. You have to use DPtoLP(), etc. to get the correct values.
--
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------
I know this. and i set it also. even not work. check with my code.
thanks
I can't see where! In the event procedures you are converting from device
to logical coordinates. Then for all other operations you are using the
logical coordinates, also with CreateCompatibleBitmap() and BitBlt().
LPtoDP() is declared in your code but not used anywhere!
In addition:
- The map mode of the source and destination device contexts used with
BitBlt() differ; I am not sure if this is supported by BitBlt().
- You shouldn't store the device context handle retrieved with GetDC() in
your DC structure for the device context handle may change. Instead use
GetDC() instead of '.pDC'.
And like Olaf I realy don't have any idea what this is all about...
CreateCompatibleBitmap() i used int MakeMDC function
and BitBlt(). i have use in UpdateDC Function
Yes LPtoDP is just declared for future use.
> In addition:
> - The map mode of the source and destination device contexts used with
> BitBlt() differ; I am not sure if this is supported by BitBlt().
Yes it support.
> - You shouldn't store the device context handle retrieved with GetDC() in
> your DC structure for the device context handle may change. Instead use
> GetDC() instead of '.pDC'.
>
if you debug. you can see handle is there.