Hope this is in the correct forum---should be in Feature Request???
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)?
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?
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?
Suggestion and comments appreciated!
Oldman
Overlay & Crop images
Re: Overlay & Crop images
Hi Loic,
Further to my previous question #2, here is the code for current experiments, but the only result is that I get a display only of the new/overlay image---the original "image1" displayed before this is completely erased/replaced which is not what I need.
The overlay image is considerably smaller than image1 and hoped for result would have been of image1 still mostly in view but with the overlay image also within the picture---somewhere.
Public Sub DoOverlay()
Dim arPixels() As Long
If oGdPicture.LoadFromPicture(Picture1.Picture) = 0 Then
Call oGdPicture.GetPixelArray(arPixels, 0, 0, 100, 100)
Call oGdPicture.SetPixelArray(arPixels, 0, 0, 100, 100)
Call RefreshPicInfo
oGdPicture.CloseNativeImage
End If
Erase arPixels
End Sub
Again & still---help, suggestions or comments from anyone really appreciated!
Oldman
Further to my previous question #2, here is the code for current experiments, but the only result is that I get a display only of the new/overlay image---the original "image1" displayed before this is completely erased/replaced which is not what I need.
The overlay image is considerably smaller than image1 and hoped for result would have been of image1 still mostly in view but with the overlay image also within the picture---somewhere.
Public Sub DoOverlay()
Dim arPixels() As Long
If oGdPicture.LoadFromPicture(Picture1.Picture) = 0 Then
Call oGdPicture.GetPixelArray(arPixels, 0, 0, 100, 100)
Call oGdPicture.SetPixelArray(arPixels, 0, 0, 100, 100)
Call RefreshPicInfo
oGdPicture.CloseNativeImage
End If
Erase arPixels
End Sub
Again & still---help, suggestions or comments from anyone really appreciated!
Oldman
Re: Overlay & Crop images
Hi Bill, I hope you are fine !
https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... rency.html
I 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:
By email, you ask me a documentation of the GdPicture Pro SDK. You can find if from the reference guide area:
https://www.gdpicture.com/guides/gdpicture/
If you need a .chm send me a mail & I will try to generate one for you.
Best regards,
Loïc Carrère
Yes: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)?
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
The DrawImageTransparency() method is your friend: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?
https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... rency.html
I 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
Now, a code snippet to crop the part of the image inside the rectangle of selection of the GdViewer: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?
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:
https://www.gdpicture.com/guides/gdpicture/
If you need a .chm send me a mail & I will try to generate one for you.
Best regards,
Loïc Carrère
Who is online
Users browsing this forum: No registered users and 2 guests