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!
Error Messages
Error Messages
It took 73 years for me to get this Stupid!
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
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()
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.
"What you are is what you have been. What you’ll be is what you do now.” -Buddha
-
- User
- Posts: 51
- Joined: Mon Jun 01, 2009 3:56 am
Deprecation
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!!
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
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.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!!
-
- User
- Posts: 51
- Joined: Mon Jun 01, 2009 3:56 am
Deprecation
Thanks Demivec
I guess you might say we'll have deprecated functions as long as We have progress> I understand now!!!
I guess you might say we'll have deprecated functions as long as We have progress> I understand now!!!
