Guidance Forums / wxWidgets (wxWindows) in C++ / zoom

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. zoom
Posted by: 2004-05-06 15:43:21
I'm a student and I have to do a zoom on a wxBitmap image. So I paint it in a
wxClientDc with dc.DrawBitmap and I use dc.SetUserScale in order to zoom. But it seems that this way doesn't give an exact result: I compare my result with the result given by an other software and it's quite different.

Is there another mean to make a zoom?
Is there a bug?

thank you for your help
Message2. Re: zoom
Posted by: upCASE 2004-05-06 16:39:59
What do you mean with "the result given by an other software and it's quite different"? In how far are they different, what did you expect?
Maybe using wxImage helps. Create an wxImage, use wxImage::Scale() on it and draw the result. Just a guess, though, but I suppose that wxImage processed images may look better than just scaled bitmaps...
In general I'd advise you to use wxImage instead of wxBitmap whenever possible and convert wxImages to wxBitmaps if needed.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: zoom
Posted by: 2004-05-06 16:48:37
I mean that when I tried to view the coordinates (in pixel) of my mouse, there is a shift between what I see and what the functions GetLogicalPosition and GetViewStart give. For exemple, with an image 160x160, the last columns of pixels is the number 160 whereas it should be the numbre 159 because it starts by 0.
It seems to be as if SetUserScale was not exact.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Sun 2022-12-4  Guidance Laboratory Inc. Hits:0