ImageID
ImageID
Hi there,
Does GdPictureImaging ImageID always increment by 1 even when you close a form and open it again.
I have a list of ids, but if I reopen the form the new ids continues from the last id?
Like load 10 images the id would be 1 to 10, close form, open form ids from 11 to 20. This would continue till the programs stopped.
Is that how gdpicture works?
Thanks
pqsik
Does GdPictureImaging ImageID always increment by 1 even when you close a form and open it again.
I have a list of ids, but if I reopen the form the new ids continues from the last id?
Like load 10 images the id would be 1 to 10, close form, open form ids from 11 to 20. This would continue till the programs stopped.
Is that how gdpicture works?
Thanks
pqsik
Re: ImageID
Hi,
No this is not exactly working like that. We use a kind of internal garbage collector, so you don't have to expect to always get +1 to each new created image.
Kind regards,
Loïc
No this is not exactly working like that. We use a kind of internal garbage collector, so you don't have to expect to always get +1 to each new created image.
Kind regards,
Loïc
Re: ImageID
Thanks for the reply Loic,
I must be doing something wrong then.
I made a small program with the code I'm using, if you can have a look at please.
It crashes when the imageid gets above 6250
Thanks
pqsik
I must be doing something wrong then.
I made a small program with the code I'm using, if you can have a look at please.
It crashes when the imageid gets above 6250
Thanks
pqsik
- Attachments
-
- GDPictureTest.zip
- (514.79 KiB) Downloaded 451 times
Re: ImageID
Hi,
Problem is in this line:
the image created by CreateClonedGdPictureImage() is never released in your code.
Kind regards,
Loïc
Problem is in this line:
Code: Select all
LstImage.Add(New ValuePair(String.Format("Multiple tiff {0} of {1} {2} {3}", j, PageCount, vbCrLf, str), gdp.CreateClonedGdPictureImage(TiffOutputID), Pos))
Kind regards,
Loïc
Re: ImageID
Thanks again for your reply Loic,
I thought the code would release the image from the gdp object
Where would I call gdp.ReleaseGdPictureImage but keep the image in the thumbnail then?
Thanks
pqsik
In the FormClosing I loop though the list and call ReleaseGdPictureImagethe image created by CreateClonedGdPictureImage() is never released in your code.
I thought the code would release the image from the gdp object
Code: Select all
Private Sub frmImage_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
For Each Item As ValuePair In LstImage
gdp.ReleaseGdPictureImage(Item.ItemValueInt)
Next
LstImage.Clear()
ThumbnailEx1.ClearAllItems()
ThumbnailEx1.Dispose()
GdViewer1.Dispose()
End Sub
Thanks
pqsik
Re: ImageID
I'm added gdp.ClearGdPicture() and now the ImageID starts at 0. That's what I'm looking for. Not sure if that's the way I should be doing it.
Question.
If I use the code below. Say I have a tiff file with 3 pages and I use CreateClonedGdPictureImageI
do I get a new image with 3 pages or 1 page that's the TiffSelectPage index
Thanks
pqsik
Question.
If I use the code below. Say I have a tiff file with 3 pages and I use CreateClonedGdPictureImageI
do I get a new image with 3 pages or 1 page that's the TiffSelectPage index
Code: Select all
Dim arr as New ArrayList
For j As Integer = 1 To PageCount
gdp.TiffSelectPage(intImage, j)
arr.add(gdp.CreateClonedGdPictureImageI(intImage))
Next
pqsik
Re: ImageID
Hi,
You get 1 page that's the TiffSelectPage index
Loïc
You get 1 page that's the TiffSelectPage index
Loïc
Re: ImageID
Thanks again for your reply,
I removed most of the code and used an array list for testing and get the same results.
Can you tell me them why it's not remove a CreateClonedGdPictureImage() id from the gdp object, is it a bug in CreateClonedGdPictureImage()
I did notice that the integer added to the array list is not incrementing by 1.
it adds 2,4,6,8,10.12.....
I'm wondering if gdp creates 3,5,7,9,11..... and its that that's not getting release.
See the attachment
Thanks
pqsik
I removed most of the code and used an array list for testing and get the same results.
Can you tell me them why it's not remove a CreateClonedGdPictureImage() id from the gdp object, is it a bug in CreateClonedGdPictureImage()
I did notice that the integer added to the array list is not incrementing by 1.
it adds 2,4,6,8,10.12.....
I'm wondering if gdp creates 3,5,7,9,11..... and its that that's not getting release.
See the attachment
Thanks
pqsik
- Attachments
-
- GDPictureTest.zip
- (511.36 KiB) Downloaded 450 times
Re: ImageID
Hi,
Hum... I don't understand anything.
What do you mean by "I removed most of the code and used an array list for testing and get the same results" Which result are you talking about ?
Loïc
Hum... I don't understand anything.
What do you mean by "I removed most of the code and used an array list for testing and get the same results" Which result are you talking about ?
Loïc
Re: ImageID
Hi sorry if I'm not explaining this right,
You looked at the test code attachment and says
Now if i loop the arraylist and get the imageid and call gdp.ReleaseGdPictureImage(imageid)
it should release the image but somethings not right. I'm wondering if calling CreateClonedGdPictureImageI creates 2 ImageIDs and returns 1
Thanks
pqsik
You looked at the test code attachment and says
Then I askedthe image created by CreateClonedGdPictureImage() is never released in your code.
You repliedQuestion.
Say I have a tiff file with 3 pages and I use CreateClonedGdPictureImageI
do I get a new image with 3 pages or 1 page that's the TiffSelectPage index
So I changed the test code I uploaded to use an arraylist, I add the imageid to the arraylist from CreateClonedGdPictureImageI,You get 1 page that's the TiffSelectPage index
Now if i loop the arraylist and get the imageid and call gdp.ReleaseGdPictureImage(imageid)
it should release the image but somethings not right. I'm wondering if calling CreateClonedGdPictureImageI creates 2 ImageIDs and returns 1
Thanks
pqsik
Who is online
Users browsing this forum: No registered users and 0 guests