Page 1 of 1

Point in 3d graphics

Posted: Tue Apr 19, 2005 2:36 pm
by guibson
Hi, still trying to find waht is the problem. I think that we found something interesting.

If I move the mouse on the left upper corner of the graphic then the Y value for the mouse is not matching the VUR of the DPM object.

And the difference is matching the Offset.

Can you think about something for that ?

Also our graphics are good size in memory and we reduce them a lot when shown at screen. Can it be the reason why it is happening ?

Thanks !
________
DIGITAL VAPORIZER

Posted: Tue Apr 19, 2005 3:07 pm
by DPlotAdmin
Also our graphics are good size in memory and we reduce them a lot when shown at screen. Can it be the reason why it is happening ?
Yes. This is related to my previous reply:
The only other thing I can think of is that the lines and symbol are drawn at the correct location and it is the bitmap that is placed incorrectly (or at least not placed as the example expects it to be). When you call DPlot_GetBitmapEx, are you using the size of the PictureBox for the requested size of the bitmap, as in:

Code: Select all

ret = GetClientRect(Picture1.hwnd, rcPic)
.
.
hBitmap = DPlot_GetBitmapEx(DocNum, rcPic.Right - rcPic.Left, rcPic.Bottom - rcPic.Top, DPM)
And if not, are you centering the bitmap within the PictureBox rather than placing it in the upper left corner? (should be the latter).
If you're using StretchBlt or some other method to compress the bitmap instead of BitBlt as in the example, then nothing will work right. The DPM members are for the actual bitmap dimensions, not a picture that has been squeezed to fit in your frame. If you really want to get a large bitmap and reduce the size for display you can probably make this work if you also scale the appropriate values in the DPM structure, though you'll most likely have roundoff errors.

Posted: Tue Apr 19, 2005 3:28 pm
by guibson
Our code is matching the example sent in your reply.

I wrote in my last post :
If I move the mouse on the left upper corner of the graphic then the Y value for the mouse is not matching the VUR of the DPM object.

And the difference is matching the Offset.

Can you think about something for that ?
I made more test and I only get incorrect value for VUR with the 3D graphics.

Thanks !
________
Honda Super Cub history

Posted: Tue Apr 19, 2005 3:33 pm
by DPlotAdmin
I'm confused. If you're copying the example, then what did this:
Also our graphics are good size in memory and we reduce them a lot when shown at screen.
mean?

Also please check to make sure you're using version 1.9.9.1.

Posted: Tue Apr 19, 2005 3:52 pm
by guibson
I'm sorry but sometimes I don't know how to translate correctly from french.

We are using BitBlt to compress the graphic
Private Sub Picture_Paint(Pic As PictureBox, hBitmap As Long)
Dim bm As BITMAP
Dim hbmpOld As Long
Dim hdc As Long
Dim hdcMem As Long
Dim Ret As Long

If hBitmap <> 0 Then
hdc = GetDC(Pic.hwnd)
hdcMem = CreateCompatibleDC(hdc)
If (hdcMem <> 0) Then
hbmpOld = SelectObject(hdcMem, hBitmap)
Ret = GetObject(hBitmap, Len(bm), bm)
Ret = BitBlt(hdc, rcPic.Left, rcPic.Top, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY)
Ret = SelectObject(hdcMem, hbmpOld)
Ret = DeleteDC(hdcMem)
End If
Ret = ReleaseDC(Pic.hwnd, hdc)
'Pic.Picture = Pic.Image
End If
End Sub
Our version for DPlotJr is 1.9.9

Thanks !
________
HONDA ST SERIES

Posted: Tue Apr 19, 2005 3:57 pm
by DPlotAdmin
I'm sorry but sometimes I don't know how to translate correctly from french.
There's no reason to be sorry; your English is certainly much better than my French :D
Our version for DPlotJr is 1.9.9
This is most likely the problem. Without checking the source again I think turning off the legend ( [ContourLegend(0)] ) will solve the problem in the version you have. I'll post an update to DPlot Jr late tonight that has this problem corrected.

Posted: Tue Apr 19, 2005 4:02 pm
by DPlotAdmin
... and I owe you an apology. I confused you with another user that I earlier corresponded with by e-mail who had a slightly different but similar problem. The end result of that e-mail exchange was version 1.9.9.1 beta, and I assumed you had that version.

Posted: Tue Apr 19, 2005 4:04 pm
by guibson
YES it's working but that is causing another problem.

Color scales on the right side of the graphic disappear.

Thanks !
:D
________
Chevrolet corvette c6.r

Posted: Tue Apr 19, 2005 5:42 pm
by DPlotAdmin
Go here. Sorry for all the run-around. Please let me know if this doesn't fix the problem for you.

Posted: Wed Apr 20, 2005 9:17 am
by guibson
It looks like that with version 1.9.9.2 Beta the problem is fixed.

We'll post another topic if we need to.

Thank you !
________
Honda Silver Wing (scooter) specifications