DrawerEx does not keep a file locked although the bitmap it is associated with might be doing so. The error in error.txt is not caused by a file being locked but appears to be an invalid parameter error but you don't tell me which line causes the error.Is there a similar method to release a file if it locked by the DrawerEx functions?
bmpex1.New2(800,600)
bmpex1.Value = bmpex.Value
...
bmpex.Release
This is what is happening. DrawerEx is still associated with the bitmap in the file you want to delete.DrawerEx does not keep a file locked although the bitmap it is associated with might be doing so.
Drawerex.Dispose
AddObject("DrawerEx", "DrawerEx") ' add it back to use again
Solidbrush1.New1(cWhite)
Normalfont1.New1("Calibri",20,0)
FileCopy(AppPath & "\test.jpg",AppPath & "\tmp.jpg")
BmpEx2.New1(AppPath & "\tmp.jpg")
BmpEx1.New2(Bmpex2.Width, BmpEx2.Height)
Drawerex1.New2(BmpEx1.Value)
RectEx1.New1(0, 0, Bmpex2.Width, BmpEx2.Height)
Drawerex1.DrawImage(BmpEx2.Value, RectEx1.Value, RectEx1.Value, False)
Drawerex1.Font = Normalfont1.value
Drawerex1.DrawString1("AAAAAA", Solidbrush1.Value, 10,10)
Image1.Image = BmpEx1.Value
BmpEx2.Release
FileDel (AppPath & "\tmp.jpg")
@Klaus and any other power users of ImagelibEx. Have you seen any effect with DrawString like this before or can you see something obvious that I have overlooked.
Solidbrush1.New1(cWhite)
FileCopy(AppPath & "\test.jpg",AppPath & "\tmp.jpg")
BmpEx2.New1(AppPath & "\tmp.jpg")
BmpEx1.New2(Bmpex2.Width, BmpEx2.Height)
[COLOR="Green"]' comment the following line out to see the difference[/COLOR]
[COLOR="Red"]BmpEx1.Value = BmpEx2.Clone [/COLOR]
Drawerex1.New2(BmpEx1.Value)
RectEx1.New1(0, 0, Bmpex2.Width, BmpEx2.Height)
Drawerex1.DrawImage(BmpEx2.Value, RectEx1.Value, RectEx1.Value, False)
Normalfont1.New1("Calibri",10,0)
Drawerex1.Font = Normalfont1.value
Drawerex1.DrawString1("AAAAAA", Solidbrush1.Value, 0,0)
Image1.Image = BmpEx1.Value
I've done some further testing and this "problem" only happens on the desktop. Device bitmaps always seem to have the ppi of the screen regardless of the setting in the file.Is there a mean to read the ppi value from the images to eventually adjust the font size.
Obj1.New1(False)
Obj1.Value = BmpEx1.Value
msg = Obj1.GetProperty("HorizontalResolution")
msg = msg & " x " & Obj1.GetProperty("VerticalResolution")
Msgbox(msg)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?