I have a purchased 3rd Party Source Code Plugin, will call it EW that reduced the size my project window to fit the smaller screen resolution of a computer. I now have a canvas that has been resized smaller to the AspectRatio of the reduced window size.
My old code loaded a FolderItem .png Image that had a canvas with the same dimensions of the old lager non resized window so I could get away with using the Canvas.Dackdrop property command.
My new problem is I have to use the DrawPicture Property Command to resize the .png Image to fit inside the smaller Canvas that has a Super of the EWCanvas Object Paint Event.
[code]'EWCanvas Canvas Object
'EWCanvas Paint Event Handler
Paint(g As Graphics, area() As REALbasic.Rect)
// do math
dim iNewWidth as integer = me.Width
dim iNewHeight as integer = me.Height
dim bHandleResize As Boolean = not Paint(g, areas)
if bHandleResize then
if SourceImage <> nil then g.DrawPicture SourceImage, 0, 0, iNewWidth, iNewHeight, 0, 0, SourceImage.Width, SourceImage.Height
end if[/code]
I am very new in getting my head around OOP concepts (I’m an old school VB6 procedural programmer) I am stuck with using the EWCanvas Object as my Super to the Canvas. Sorry I don’t have a clue on how to write the resize DrawPicture code from the EWCanvas Object Paint Event Above. How do I go about it with the code below. Thanks
[code]
Dim strFrtKeyBrdPath, strFrtKeyBrd As String
Dim f As FolderItem
Dim FrtKeyBrdImg As New Picture(iNewWidth, iNewHeight, 32) ’ Sorry iNewWidth & iNewHeight Integers aren’t declared
Dim
strFrtKeyBrd = “24FrtGtr6FrtBrdRsWd800x162.png” // Image File
#If TargetWin32 Then
#If DebugBuild Then
strFrtKeyBrdPath = “D:\My Data_DocsApps\Real Studio Projects\Graphics\FretKeyBrd”
f = GetFolderItem(“strFrtKeyBrdPath”).Child(“strFrtKeyBrd”)
#Else
f = GetFolderItem(“Graphics”).Child(“FretKeyBrd”).Child(“strFrtKeyBrd”)
#EndIf
#ElseIf TargetMacOS Then
#If DebugBuild Then
strFrtKeyBrdPath = “/Library/Graphics/GAGraphics/FrtKetBrd/”
f = GetFolderItem(“strFrtKeyBrd”),FolderItem,PathTypeShell)
#Else
#EndIf
#ElseIf TargetOSLinux Then
#EndIf
Old Code
'If f <> Nil Then
'cvsGuitFrtBrd.Backdrop = Picture.Open(f)
'End IF
??? Graphics.DrawPicture[/code]