Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

is this group not work now days?

1 view
Skip to first unread message

Amrit

unread,
Nov 5, 2008, 8:56:59 AM11/5/08
to
hi

subject it self

coz' i post msg. here but i did not find any reply. and any new post from
other also.

thanks.


Larry Serflaten

unread,
Nov 5, 2008, 4:53:25 PM11/5/08
to

"Amrit" <ca...@wlink.com.np> wrote

> subject it self
>
> coz' i post msg. here but i did not find any reply. and any new post from
> other also.

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


Schmidt

unread,
Nov 5, 2008, 5:59:49 PM11/5/08
to

"Amrit" <ca...@wlink.com.np> schrieb im Newsbeitrag
news:OC69h50P...@TK2MSFTNGP03.phx.gbl...

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


Amrit

unread,
Nov 6, 2008, 5:42:05 AM11/6/08
to
Hi Schmidt

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
>
>


Amrit

unread,
Nov 6, 2008, 5:49:10 AM11/6/08
to
Hi

> 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.


Larry Serflaten

unread,
Nov 6, 2008, 7:33:34 AM11/6/08
to

"Amrit" <ca...@wlink.com.np> wrote

> 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


Amrit

unread,
Nov 6, 2008, 9:17:02 AM11/6/08
to
Hi Larry

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


Thorsten Albers

unread,
Nov 6, 2008, 10:48:09 AM11/6/08
to
Amrit <ca...@wlink.com.np> schrieb im Beitrag
<OBP#Rx$PJHA...@TK2MSFTNGP03.phx.gbl>...

> with out useing mapmode is work fine. but when you use mapmode. it goes
> worng.

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
----------------------------------------------------------------------

Amrit

unread,
Nov 6, 2008, 12:22:08 PM11/6/08
to

> CreateCompatibleBitmap() (and AFAIK BitBlt() too) only works with pixel
> values. You have to use DPtoLP(), etc. to get the correct values.


I know this. and i set it also. even not work. check with my code.

thanks


Thorsten Albers

unread,
Nov 6, 2008, 5:34:41 PM11/6/08
to
Amrit <ca...@wlink.com.np> schrieb im Beitrag
<#DFk1QDQ...@TK2MSFTNGP04.phx.gbl>...

> I know this. and i set it also. even not work. check with my code.

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...

Amrit

unread,
Nov 6, 2008, 7:58:54 PM11/6/08
to
> 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!

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.

0 new messages