Hi Bill, I hope you are fine !
1) Is there any way to programmatically determine in GDPicturePro/GDViewer if an "Area Selection" is active, and if so, what are the coordinates (top, left, width, height)?
Yes:
- Code: Select all
Dim nLeft As Long, nTop As Long, nWidth As Long, nHeight As Long
If GdViewer1.isRectDrawed Then 'if an area selection is active
Call GdViewer1.GetRectValues(nLeft, nTop, nWidth, nHeight) 'catch the area coordinates
End If
2) I need to overlay a bitmap image onto an image already on display with GDViewer (hopefully also being able to control percent of transparency and coordinates of overlay).
How to do or is this even currently possible?
The
DrawImageTransparency() method is your friend:
http://www.guides.gdpicture.com/v5/gdpi ... rency.htmlI give you a sample to draw the test.jpg image using semi transparency into the area delimited by the rectangle of selection of the GdViewer control:
- Code: Select all
Dim nLeft As Long, nTop As Long, nWidth As Long, nHeight As Long
Dim nImageToDraw As Long
If GdViewer1.isRectDrawed Then
Call GdViewer1.GetRectValues(nLeft, nTop, nWidth, nHeight)
nImageToDraw = Imaging1.CreateImageFromFile("test.jpg")
Imaging1.SetNativeImage (GdViewer1.GetNativeImage)
Call Imaging1.DrawImageTransparency(nImageToDraw, 125, nLeft, nTop, nWidth, nHeight)
Imaging1.CloseImage (nImageToDraw)
GdViewer1.Redraw
End If
3) I need to do quick crops on images, from within my program and also by user selection---so am wondering if there is a way to do so either by establishing an Area Selection, or failing that, by using something such as a VB6 "shape" control to draw an ellipse on an image, then crop away whatever is outside the Area or ellipse?
Now, a code snippet to crop the part of the image inside the rectangle of selection of the GdViewer:
- Code: Select all
Dim nLeft As Long, nTop As Long, nWidth As Long, nHeight As Long
If GdViewer1.isRectDrawed Then
Call GdViewer1.GetRectValues(nLeft, nTop, nWidth, nHeight)
Imaging1.SetNativeImage (GdViewer1.GetNativeImage)
Call Imaging1.Crop(nLeft, nTop, nWidth, nHeight)
GdViewer1.Redraw
End If
By email, you ask me a documentation of the GdPicture Pro SDK. You can find if from the reference guide area:
http://www.guides.gdpicture.com/If you need a .chm send me a mail & I will try to generate one for you.
Best regards,
Loïc Carrère