TroisVerites Posted July 19, 2012 Share Posted July 19, 2012 Why we can't include the w and h in the string. I think it is a good idea to save Bmp ressource in external file. Bmp := BitmapFromString(54, 37, 'beNp78uXpq69gtD6GwaLh5'...) Thanks for the answer Quote Link to comment Share on other sites More sharing options...
LordJashin Posted July 19, 2012 Share Posted July 19, 2012 Why we can't include the w and h in the string. I think it is a good idea to save Bmp ressource in external file. Bmp := BitmapFromString(54, 37, 'beNp78uXpq69gtD6GwaLh5'...) Thanks for the answer Huh? Is your question answered? Use SaveBitmap to save a bitmap to a file. Like so: [sCAR] SaveBitmap(bmp, 'C:\Bitmap.bmp'); [/sCAR] Quote Link to comment Share on other sites More sharing options...
FHannes Posted July 19, 2012 Share Posted July 19, 2012 Why we can't include the w and h in the string. I think it is a good idea to save Bmp ressource in external file. Bmp := BitmapFromString(54, 37, 'beNp78uXpq69gtD6GwaLh5'...) Thanks for the answer SCAR Divi 3.35 Beta already does this. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted July 20, 2012 Author Share Posted July 20, 2012 Scar 3.35 I have a question about the new object TSCARBitmap. Is this object managed like the previous version ? In 3.34 , we have a integer in result from BitmapFromString(...). Do you make plan to do the same change for DTM ? Because in my script 3.34 , to detect an object like (color or Bmp or Dtm ) , I just use the integer , the type of ressource. {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function OR_FindRes( const Src, SrcID, SrcTol: integer; Area:TBox; Pt: TPoint): Boolean; Contributors: TroisVerites Description: Date Created: March 01st, 2012. By TroisVerites Build 001 Last Modification: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function OR_FindRes( const Src, SrcID, SrcTol: integer; Area:TBox; var Pt: TPoint): Boolean; begin case Src of 1 : Result := FindColorTolerance(Pt.x, Pt.y, SrcID, Area.x1, Area.y1, Area.x2, Area.y2, SrcTol); 2 : Result := FindBitmapTolerance(SrcID, Pt.x ,Pt.y,SrcTol); 3 : Result := FindDTM(SrcID, Pt.x, Pt.y, Area.x1, Area.y1, Area.x2, Area.y2); else Log_Write('OR_FindRes source is not implemented'); end; end; program New; var bmp :TSCARBitmap; Pt : TPoint; Bln : boolean; begin bmp := TSCARBitmap.Create('deNq9kltOwlAURe80TJiFU2AsToGpCEYNRKNUY' + 'nwUKWp8RI0aQUGNr2gUUhWcRDnpTg8n3vbyc8LOStuPvVf6mjE5E4bhvN9Roeh' + '31airUdq712Kh8aDFYvCoxVJTjeX9Jy3KB89TxhgzsVM5fHFj4kRzOBtHc+Xo1' + 'QEkEkpWefX4zQHupDU79lCyymsn71lgmAjix4wiOmb1108/UsHNEGyja9ZyR06' + 'qZylgDmCznxRHudo4/7ShTiEJC9kgPwGFV7WLLxsq5JNIIavkH8KrzcueDRU8z' + '8uLQDh+/yQsxsQ2rLau+qlgIoVQ/ZMgmGxfhw6kECp+aYgs79x8T8Skxa7ttn6' + '08Ntq1G9/tWjcDbQIOkMtmt0/LUa2jFmg'); Bln := FindBitmapTol(Pt.x,Pt.y,bmp,0,0, 1900, 1200, 3); if ( Bln ) then begin writeln('Bmp is found at ' + inttostr(Pt.x) + ':' + inttostr(Pt.y) ); end else begin writeln('Bmp is not found.'); end; bmp.Free(); end. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted July 20, 2012 Share Posted July 20, 2012 (edited) Check this out - http://forums.scar-divi.com/showthread.php?1603-SCAR-Divi-3-35-Preview-Tutorial Here is how you use Bitmaps now. There is a TSCARBitmap object. You have to create it. Then type in its name and a dot, then hit CTRL+SPACE on your keyboard and you can see what you can do to the bitmap. For example you can save it as a png, jpeg, and bitmap. Example: [sCAR] program New; var bmp: TSCARBitmap; X, Y: Integer; begin bmp := TSCARBitmap.Create('deNpjZGBkaGxsBAADGQGG'); //Bitmap String FindBitmap(X, Y, bmp, 0, 0, 100, 100); end. [/sCAR] I don't see why you would want it as an Integer still but you can pass it as an Integer like this: [sCAR] program aaa; var bmp: Integer; bmp1: TSCARBitmap; begin bmp1 := TSCARBitmap.Create('deNpjZGBksI69CwACWwF4'); bmp := bmp1 as Integer; WriteLn(bmp1 as Integer); WriteLn(bmp); end. [/sCAR] The TSCARBitmap object has LoadFromStr procedure as well. Edited July 20, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...