-
Content Count
27 -
Joined
-
Last visited
Everything posted by wadepm
-
I see there are a couple of posts on adding the graphics32 component but they don't quite address my problem. I have done the following: 1. Downloaded the zipped file graphics32-master.zip from github. 2. unzipped to c:\program files\graphics-master. 3. added c:\program files\graphics32-master\source to the library path. 4. opened C:\Program Files\graphics32-master\Source\Packages\XE8\GR32.groupproj 5. right clicked on "GR32" and clicked "Build All" 6. Got an error when it couldn't find vcl. I assume this is vcl.dpl? 7. Not sure where to go from here. I have never one this before. I am using Seattle. I would appreciate any help you guys can provide. Thanks!
-
Hello! I am looking for a something that will scale bitmaps with a "nice" result. Something better than stretchdraw, which does exactly what I want but looks horrible. Thanks for your help. I hope I can return the favor some day...
-
I thought I needed to use the TKernelResampler to get a nice resize but TDraftResampler looks good and panning is almost as good as panning of the full size image. This is good enough for me!
-
I have it set to rmOptimized. I set the breakpoint and the program stopped at that location so I am using the latest version of the unit. The bitmap I work with in my project is 5500 by 4000. The viewport is 1700 by 1000. I am goin to try scaling the bitmap first using the drawto method and then assign it to the image for the scrolling. I think (hope) that will avoid the problem as the image will always be at full scale, as far as it knows. What do you think?
-
OK. I put the new unit in the project folder and recompiled. The new .dcu file for GR32_Image.pas is in the debug folder. But I am not seeing any change in the scrolling - still really lagging.
-
@Anders Melander Excellent! - I will try it out as soon as I can. What's the easiest way to get this into Delphi, reinstall Graphics32 from scratch? Is there a way to just recompile GR32_Image.pas? And then what - sorry I don't have much experience working with 3rd party stuff.
-
I played around with the resampler kernel and that makes a big difference. I started using Mitchell but when I switched to Box the scrolling was much smoother but the scaling wasn't as nice. I am surprised that the image is resampled when it is scrolled as the size is not changing. I am going to try scaling a bitmap and then assigning that to the image before scrolling.
-
Anders, One more question on scrolling. When I zoon in on the bitmap (scale<1) the scrolling is really slow, there is quite a bit of lag. When scale = 1 there is no lag. Is it doing a rescaling ever time it moves the image 1 pixel? I have been looking at the code and I don't see it but that would explain the lag I think.
-
Solved! This is where ControlToBitmap(Point(X, Y)) comes in handy.
-
Looking at GR32_image.pas I see properties hscroll.position and vscroll.position that should give me what I want. But I can't figure out how to get at them...
-
...of course, I have more questions! Now my problem is I need to know the location of the cursor above the image, not just the viewport. I thought I could use the offsethorz and offsetvert properties. They sound like they should give me the position of the image relative to the viewport. However, they don't appear to contain any information. Also, the manual says they are type single but in reality they are type extended. I am not sure what they are intended to provide. Is there a property of the image that contains the offsets relative to the viewport?
-
Thanks for your help. I now have a nicely scaled image that scrolls smoothly. Onwards!
-
That works very nicely, thanks! I see you removed ImgView.ControlToBitmap(Point(X, Y)). I was trying to figure out exactly what that did...
-
I have narrowed down the problem to when image.scale is less than 1. If it is 1 or larger the scrolling works very nicely, very smooth. When it is less than 1 it gets wonky.
-
I am using smScale. I'll take a look at your example though. Thanks.
-
I played around with the code by adding a couple of buttons to change the image scale. I found that when the scale is not 1 the scrolling is a mess - the image jumps around and doesn't follow the cursor. When the scale is 1 the scrolling works great. Any ideas?
-
OK, it appears TImgView32 is a combination of an image and a scroll box. Cool.
-
Thanks Anders. It seems it adds a scroll method at least...
-
What's the difference between TImage32 and TImgView32?
-
I have some routines that allow me to drag the image around inside of a scrollbox. When the image is full size it works fine, but when it is scaled its all choppy. I think your assignment will work nicely.
-
After working with it for awhile I see that the Graphics32 Image component does not respond to my code the same way the native image component does. May have to go back to working with bitmaps in the background, rescaling and then assigning to the image. Can I assign a tbitmap32 to a timage?
-
The documentation, as far as I can tell, is almost nonexistent. What I have been able to find is very spare. Did anyone ever write a tutorial of some kind? That would be helpful.
-
What I want to do is even easier than that. I do everything with the "full size" bitmap and then assign it to an image on the form and just resize the image: TKernelResampler(Image.Bitmap.Resampler).Kernel := TMitchellKernel.create; Image.ScaleMode := smScale; Image.Scale := x; Works great.
-
Thanks Anders. I will take a look at it - it uses assembler and pointers(!) - both things I need to work on.
-
I am trying graphics32 right now. We'll see how it goes...