Page 1 of 1
Error Messages
Posted: Mon Aug 10, 2009 2:12 am
by Zooker
Where can I find our where a deprecated function is? Half the examples and snippets of code come up with a deprecated function call or
so itseems. Also I tried the visual designer and it came up with a mountai of code to just display a simple Large bmp file; yet never showed the bmp file. This is very discouraging to a noobie like me!
Posted: Mon Aug 10, 2009 3:18 am
by Kaeru Gaman
could you pse decide using one account only?
... CreateGadgetList() should be the depreciated function...
Posted: Mon Aug 10, 2009 8:11 am
by rrpl
Code: Select all
; open bmp file
Procedure ShowABitmap()
Protected Graphic.s,Gad1,Win,OrigWidth,OrigHeight,NewHeight,NewWidth,LoadedImage,ResizedImage,Quit
Graphic=OpenFileRequester("Open a Bitmap File","","Bitmap Files (*.bmp)|*.bmp",0)
If Graphic
LoadedImage=LoadImage(#PB_Any,Graphic)
; let keep size proportions
OrigWidth=ImageWidth(LoadedImage)
OrigHeight=ImageHeight(LoadedImage)
NewHeight = (640 * OrigHeight) / OrigWidth
NewWidth = 640
If NewHeight > PicHeight
NewWidth = (480 * OrigWidth) / OrigHeight
NewHeight = 480
EndIf
; end size proportions, I hope I remembered it correctly!
ResizedImage=ResizeImage(LoadedImage,NewWidth,NewHeight)
Win=OpenWindow(#PB_Any,0,0,640,480,"Test",#PB_Window_ScreenCentered)
Gad1=ImageGadget(#PB_Any,0,0,WindowWidth(Win),WindowHeight(Win),ResizedImage)
Repeat
If GetAsyncKeyState_(#VK_ESCAPE): Quit = 1 :EndIf
If WindowEvent()=16: Quit=1:EndIf
Until Quit=1
EndIf
EndProcedure
ShowABitmap()
Heres a little example function that covers most of it, including resizing the image in proportion.
I would advise you to concentrate on starting on very simple projects at first without using a visual designer. Once you understand how the process works then you will understand the code the visual designer is generating and be able to use it properly. Also when you have a problem best to show the code that you have created/generated, so that others can tell you what is wrong with it.
Posted: Wed Aug 12, 2009 6:20 pm
by Trond
Deprecation
Posted: Thu Aug 13, 2009 1:13 am
by Hot Pockets
Mr Gaman
I do think I have that problemed solved. To all thanks fro the help. How ever I still don't know what a deprecated function is? I do beleive I have thought of away to display a Title on my bmp. I can do that easy in DB and then I will have the Title on the bmp of stars and I can load that into
my Purebasic program and it will save me time and energy!!
Re: Deprecation
Posted: Thu Aug 13, 2009 1:49 am
by Demivec
Hot Pockets wrote:I do think I have that problemed solved. To all thanks fro the help. How ever I still don't know what a deprecated function is? I do beleive I have thought of away to display a Title on my bmp. I can do that easy in DB and then I will have the Title on the bmp of stars and I can load that into my Purebasic program and it will save me time and energy!!
A
deprecated function is one that has been replaced or will be discontinued in a future version of PureBasic but still functions in the current version of PureBasic. This means it is advisable to get in the habit of not using it so that when it is done away with completely there won't be problems recompiling the code in later versions.
Deprecation
Posted: Thu Aug 13, 2009 5:38 pm
by Hot Pockets
Thanks Demivec
I guess you might say we'll have deprecated functions as long as We have progress> I understand now!!!
