w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to save canvas overlay bitmap in sd-card?
When CompressFormat is JPEG its shows you black background because JPEG format does not support alpha transparency, just change CompressFormat to PNG and even save your image in png format instead jpeg. check below code: ByteArrayOutputStream objbytes = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, objbytes); While delcare path of image, use .png extension. directory + "/pics+"+System.currentTimeMillis()+".png";

Categories : Android

Bitmap not displaying in ListView: Images from SD Card
use adapter.setViewBinder(new MyViewBinder()); public class MyViewBinder implements ViewBinder { @Override public boolean setViewValue(View view, Object data, String textRepresentation) { if ((view instanceof ImageView) & (data instanceof Bitmap)) { ImageView iv = (ImageView) view; Bitmap bm = (Bitmap) data; iv.setImageBitmap(bm); return true; } return false; } }

Categories : Java

Converting a String to Bitmap, and Store it to SD Card
I have to make sure that the main folder is created first to contain the images, then after that the code below did the trick. The next thing it to create a new folder to contains the images so "/FolderName/FolderName2/" is what I need. OutputStream fOut = null; File file = new File( Environment.getExternalStorageDirectory() + "/FolderName/FolderName2/", fileN); try { fOut = new FileOutputStream(file); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace();

Categories : Java

Like box not showing photos anymore
This is "by design". The limited space of social plugins like the Like Box and Activity Feed means FB has to display 'compact' versions of large stories like photos. If you look at the CSS, you'll see the DIVs are tagged '!important' (not important).

Categories : Facebook

Blackberry App - Bitmap Picture not showing
try this public Welcome() { // Set the displayed title of the screen setTitle("Select a brand"); Bitmap bitmapImage = Bitmap.getBitmapResource("Celsian.jpg"); BitmapField fieldDemo = new BitmapField(bitmapImage); add(fieldDemo); }

Categories : Java

Missing photos when retrieving Users tagged photos facebook-graph API
The only thing that comes to mind is the settings of each user since according to the answer posted here - facebook graph api - missing fields, API access to these things can be turned off at the user's discretion.

Categories : Facebook

How can I show last saved photo in Photos app iOS via "photos-redirect:" URL scheme?
photos-redirect:// is the URL Scheme for Photo App. However, it is undocumented, thus you shouldn't use it. To view / select a photo, use UIImagePickerController .

Categories : IOS

Videoview not showing up afer loading a bitmap from asset?
Well, I found the solution... turned out that what was happening was that the GLSurfaceView in my program was actually overlaying the videoview. I'm still not sure why, since I was trying to explicitly brig the videoview to the top, but nonetheless, keeping the GLSurfacview hidden while I play videos seems to work acceptably.

Categories : Android

Flash Actionscript 3 Converting Sprite to Bitmap/BitmapData - Not showing up on stage
Your .draw() will start capturing graphics from the registration point of platformLine. It will continue to capture graphics horizontally as far as the width you give the constructor of BitmapData, same applies vertically using the height. Looking at your code, your platformLine is always at 0,0. It seems that instead of moving the sprite itself to where you need it, that you're using startX and startY to begin drawing the graphics wherever you need within that sprite. This is where you're running into a problem. What you potentially end up with here is a sprite whose graphics don't start until say 40 pixels away from its registration point. Those graphics are then 20 pixels by 20 pixels in this example, meaning the width and height you're giving to your BitmapData are also 20. You begin

Categories : Actionscript

canvas erase bitmap code android
Have a look at this method of mine. The view EditImageView is a custom ImageView that I also applied that erase function to. I had the same problem until I applied the code below inside the if statement. That fixes the problem for 3.0 and up /** * Sets the image to the view in the content view * @param view */ private void setImageView(EditImageView view) { LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); view.setLayoutParams(params); // #### THIS IS THE IMPORTANT PART ###### if (Build.VERSION.SDK_INT >= 11) { view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } LinearLayout main = (LinearLayout) findViewById(R.id.galleryImage); main.removeAllViews(); main.addView(view);

Categories : Android

Card.io usage in android. Displaying Credit card number and Expiry date
Maybe I missed it but I dont see anything wrong with the code. The problem may be in your XML so I thought I would make it easy for you. Send the user to another activity when the scan is completed. Copy this in the appropriate place. Create a new xml.file and see if this works. If you have any problems tell me. This is working fine for me. private Button scanButton; } @Override protected void onResume() { super.onResume(); if (CardIOActivity.canReadCardWithCamera(this)) { scanButton.setText("Charge"); } else { scanButton.setText("Charge"); } } final String TAG = getClass().getName(); private int MY_SCAN_REQUEST_CODE = 100; // arbitrary int public void onScanPress(View v) { // This method is set up as an onClick handler in the layout xml // e.g. and

Categories : Android

What is the difference between twitter photo card and summary with large image card?
The difference between a summary_large_image card and a photo card is what occurs when the user clicks on the image in the card: In the case of a summary_large_image card, a click on the image opens the link in a new tab (or in a browser on smartphones). In the case of a photo card, a click on the image opens a bigger version of the image in the same browser window (or displays the image full-screen on smartphones).

Categories : Twitter

Windows API Code Pack - ShellFile not generating PDF bitmap
The problem is because you have not selected the active frame that you will create the thumbnail from. I cannot verify it on my current machine, because I don't have the Windows API on it, but it's giving you the standard PDF thumbnail because in your code you have't specified which page to use for the thumbnail. Try doing something like this: Image image = new Image(); //Load image here int frameindex = 1; // Page number you want to use for thumbnail Guid guide = image.FrameDimensionsList[0]; FrameDimension fDimension = new FrameDimension(guide); image.SelectActiveFrame(fDimension, frameindex); //Then go on to extract your thumbnail

Categories : C#

Payment succeeds with wrong expiration, card verification code, name, and address
That should be all that you need to do if you are using the same type of payment service. As for the payment going through with incorrect information, this can happen. First there is no check that looks at the name that is provided. The only checks are the CSC and AVS checks. So regardless if you enter in the incorrect name or expiration date, the payment can still go throgh. For example, the exp date gets passed over to the processor and then on to the card issuing bank. So they may or may not even look at the exp date, there is no real check to make sure it matches. I have seen some cards get approved and others get declined. As for the AVS and CSC checks, keep in mind that the gateway sends them to the processor who in turns sends them to the card issuing bank. Then the respons

Categories : PHP

Im trying to figure out how to deal a card from the deck in my card game class
yeah, now that i've thinked about, "hand" was empty because you fill it from "deck" that is in turn empty. Maybe you can define a method "initDeck" in deck class that fills the deck with random cards, and call it from game constructor. or maybe you already do this out of the game class, but in that case you should pass the deck to game!

Categories : Java

Java Card: How to load SIM applet to real smart card?
It might not work because the SIM application might have dependencies to APIs that are not present in the JCOP cards (for instance ETSI 102 705). But then it is worth trying. Make sure that the file format is compatible between the tools (a cap file is not always a cap file by the way; a real cap file is a zip, some tools prefer IJC files). Try using the cap file from the Gemalto tool in the jcManager. If it does not work you can try GPShell. The main challenge is to have the keys to your target, and then the right tool.

Categories : Java

How to implemet creadit card and debit card payment in salesforce
If you are not experienced with API development, paypal API details are here: https://developer.paypal.com/docs/api/ Then the best other option is an App. I have used the connected Epos solution, which is great for taking payments from credit cards, either with the customer present (chip n pin) or by keying in the card numbers. You need to get the PayPalHere card terminal which is about $50, but it is a great all round solution. https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000qD0GEAU

Categories : Paypal

Reset Smart Card pin having Muscle card applet
MSCUnblockPIN is the function to use, but you have to know the unblock value of course. The corresponding ISO command Reset Retry Counter allows variants without unblock value, but these need another kind of protection to avoid arbitrary many retries.

Categories : Security

iOS Phonegap app crashes after Card.io scans credit card
@Paul if you using latest card.io SDK just modify the CardIOPGPlugin.m file on line 101 from [CardIOCreditCardInfo displayStringForCardType:info.cardType] to [CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]] Hope it helps.

Categories : IOS

Android App - How to save a bitmap drawing on canvas as image? Check code?
MyDrawView import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Rect; import android.util.AttributeSet; import android.util.LruCache; import android.view.MotionEvent; import android.view.View; public class MyDrawView extends View { public Bitmap mBitmap; public Canvas mCanvas; private Path mPath; private Paint mBitmapPaint; private Paint mPaint; public MyDrawView(Context c, AttributeSet attrs) { super(c, attrs); mPath = new Path(); mBitmapPaint = new Paint(Paint.DITHER_FLAG); mPaint = n

Categories : Java

Card.io SDK gives partial credit card number
Josh from card.io here. The sample code you're probably looking at reads: - (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController { // The full card number is available as info.cardNumber, but don't log that! NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv); // Use the card info... [scanViewController dismissModalViewControllerAnimated:YES]; } Note the comment above the NSLog call. What is being logged is info.redactedCardNumber. You want info.cardNumber instead. See the header files, which are pretty well documented, for more details. The older version of the SDK is has been publicly deprecated for nearly a

Categories : Iphone

Card holder's name in APDU commands (ICC Card)
Reading the card holders name and other info on a chip & pin card is not as simple as you might think. It's not as simple as just one straight forward APDU , there are several more steps you have to go through first. First you need to perform an application selection. How you do this, depends on your card and your terminal. There are 2 standard ways. 1) Application file selection 2) AID Scanning For type 1, you typically call a known file name using the select file apdu (NOTE: I'm not going to implement full apdu sentences in what I type here as there is just too much data to try and represent, if there is enough attention to this post then I might do a blog entry) The file name to select for most EMV standard cards is '1PAY.SYS.DDF01' or '2PAY.SYS.DDF01' for contactless ca

Categories : Misc

Coordinate Id of same card that is read by two different card readers
Its rather hard to understand just exactly what your wanting, but in the bottom you state: 'in other words, i want to convert this array of bytes to corresponding hex code'. You can perform that operation like so: public static string ByteArrayToString(byte[] ba) { StringBuilder sb = new StringBuilder(ba.Length * 2); foreach (byte b in ba) { sb.AppendFormat("{0:x2}", b); } return sb.ToString(); } Just pass in your Byte array and the result will be your hex conversion in string format. Edit: This will probably yield the same results, but try this: byte[ ] bytes = {0, 1, 2, 4, 8, 16, 32, 64, 128, 255 } Console.WriteLine( BitConverter.ToString( bytes ) );

Categories : C#

Adding Alpha channel to bitmap or converting bitmap to 32bit
I really recommend you use a library like FreeImage. The benefit of the library, besides it being fairly lightweight and extremely open license, is the fact that it'll handle all image types easily. Then converting from any format (including different bitmap formats) to 32bit is trivial. So is rendering and other tasks. Besides that, if you'ren't interested in using a library, is just manipulate the pixel data yourself. Converting from 24bit to 32bit is fairly trivial with two points and casting. Something like this should do: uint8_t* pArgb; uint8_t* pRgb; GetDIBits(BufferDC, hImage, 0, BufferInfo.bmiHeader.biHeight, pRgb, &BufferInfo, DIB_RGB_COLORS); pArgb = (uint8_t*)malloc(4 * BufferInfo.bmiHeader.biWidth * BufferInfo.bmiHeader.biHeight); for (int i = 0; i < BufferInfo

Categories : C++

C# .NET - How can I create a new Bitmap instance for a bitmap from native resources?
I'm not sure if I've understood you correctly. But I could imagine you are searching for something like this: System.Reflection.Assembly thisExe; thisExe = System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Stream file = thisExe.GetManifestResourceStream("AssemblyName.ImageFile.jpg"); this.pictureBox1.Image = Image.FromStream(file);

Categories : C#

how to get bitmap information and then decode bitmap from internet-inputStream?
whether you can mark / reset a stream depends on the implementation of the stream. those are optional operations and aren't typically supported. your options are to read the stream into a buffer and then read from that stream 2x, or just make the network connection 2x. the easiest thing is probably to write into a ByteArrayOutputStream, ByteArrayOutputStream baos = new ByteArrayOutputStream(); int count; byte[] b = new byte[...]; while ((count = input.read(b) != -1) [ baos.write(b, 0, count); } now either use the result of baos.toByteArray() directly, or create a ByteArrayInputStream and use that repeatedly, calling reset() after consuming it each time. ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); that might sound silly, but there's no magic. you eith

Categories : Android

C#: Dispose() a Bitmap object after call Bitmap.save()?
Yes. Better yet, you could wrap your bmp in a using block, this will take care of the disposal for you using(var bmp = new Bitmap(image)) { bmp.Save(...); } Save's sole purpose is to save the image to the specified file, it doesn't change the bitmap object

Categories : C#

Bitmap crashes with "Cannot generate texture from the bitmap" message
I run into the same problem. Didn't solve it yet but this may be usefull for anybody. Some hints are coming from google.group's thread What's interesting is that it seems to be related to the Hardware rendering introduced with Android 3.x. Setting the layer type to software for the respective View that does the drawing of the bitmap, fixes the issue. So setting view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); really worked for me, but in my app it impacted performance so I have to useView.LAYER_TYPE_HARDWARE I'm still looking for the solution and roots of the issue. Will update if found any. Also any additional information appreciated.

Categories : Java

Fastest way to load / display bitmap; best way to reuse Bitmap
Notice you can't modify views from inside threads not being the UIThread (main one), try using AsyncTasks. An easy way to use images without having to think too much is using a framework like Android Query, take a look here. If you want to do it by hand check this and this.

Categories : Android

After modifying a Bitmap, how can I modify the "modified" Bitmap and so on?
Why don't you save the filtered bitmaps in another list ? for (int i = MainActivity.LEFT_IMAGE; i <= MainActivity.RIGHT_IMAGE; i++) { _filterImageView[i] = _originalBitmaps[i].copy(_originalBitmaps[i].getConfig(), true); } Button filter6Button = (Button) findViewById(R.id.filter6_button); filter6Button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { for (int i = MainActivity.LEFT_IMAGE; i <= MainActivity.RIGHT_IMAGE; i++) { _filterImageView[i] = _BrightnessIncrease .filterImage(_filterImageView[i]); // */ } _filterImageView .setImageBitmap(_filterImageView[MainActivity.LEFT_IMAGE]); } });

Categories : Java

fast way to create a big bitmap from an array of bitmap?
By assuming that the generation part (g.FillRectangles(Brushes.White, Rect), pretty time-consuming too) cannot be avoided, the best thing you can do is avoiding a second graph-generation process (also for board) and just copying the information from _board. Copying is much quicker than a new generation (as shown below), but you have the problem that the source information (_board) do not match the destination format (board by relying on .SetPixel) and thus you will have to create a function determining the current pixel (X/Y point) from the provided information (current rectangle). Below you can see a simple code showing the time requirement differences between both approaches: Dim SquareSize As Integer = 5 Dim _board As Bitmap = Bitmap.FromFile("in.png") Dim board As Bitmap = New Bitmap

Categories : C#

Android draw a resized bitmap on another bitmap
I fixed the problem, I am using a different code completely: Resources res = ((Context)(activity)).getResources(); Drawable[] layers = new Drawable[2]; layers[0] = res.getDrawable(R.drawable.marker_report_red); layers[1] = res.getDrawable(R.drawable.report_path_merge_ic); LayerDrawable layerDrawable = new LayerDrawable(layers); layerDrawable.setLayerInset(1, 15, 10, 15, 15); Bitmap b = Bitmap.createBitmap(layers[0].getIntrinsicWidth(), layers[0].getIntrinsicHeight(), Bitmap.Config.ARGB_8888); layerDrawable.setBounds(0, 0, layers[0].getIntrinsicWidth(), layers[0].getIntrinsicHeight()); layerDrawable.draw(new Canvas(b)); With emphasis on the line: layerDrawable.setLayerInset(1, 15, 10, 15, 15); This line resized the bitmap on the second layer.

Categories : Android

Is it possible to get credit card type using card.io?
I have no experience of using card.io. But your question got me all curious about this API. In github, I found it and in there, there is a file: CardIOCreditCardInfo.h // Derived from cardNumber. // When provided by card.io, cardType will not be CardIOCreditCardTypeUnrecognized or CardIOCreditCardTypeAmbiguous. @property(nonatomic, assign, readonly) CardIOCreditCardType cardType; Hope this helps. I am trying to learn this, if it doesnot help you please tell me.

Categories : Iphone

How to convert from System.Drawing.Bitmap to grayscale, then to array of doubles (Double[,]), then back to grayscale Bitmap?
I'm sure there are loads of optimal ways to do this. As @Groo points out perfectly in the comments section, one could use for instance the LockBits method to write and read pixel colors to and from a Bitmap instance. Going even further, one could use the graphics card of the computer to do the actual computations. Furthermore, the method Color ToGrayscaleColor(Color color) which turns a color into its grayscale version is not optically correct. There is a set of ratios which actually need to be applied to the color component strengths. I just used 1, 1, 1 ratios. That's accceptable for me and probably horrible for an artist or a scientist. In the comments section, @plinth was very nice to point out to this question you should look at, if you want to make an anatomically correct convers

Categories : C#

How can I convert a GDI 8-bpp indexed bitmap to an RGB Bitmap?
Why the hazel? When you use LockBits you can use PixelFormat24bppRGB as parameter three of LockBits as the system copies the data anyway (you got never direct access to image data in GDI+). Here some of the errors I found (so far): int paletteSize =b->GetPaletteSize(); ColorPalette colorPalette; b->GetPalette(&colorPalette,paletteSize/4); Why division by four? GetPaletteSize returns the size in bytes and GetPalette awaits the size in bytes. ColorPalette is a placeholder definition, one of the darkest thinks Microsoft developers have done to us. It defines only the first color entry! use a byte pointer like: void *palette=new char[paletteSize]; b->GetPalette((ColorPalette *)palette,paletteSize); Use ((ColorPalette *)palette)->Entries[i] When You need to access the

Categories : C++

How to draw on bitmap using another bitmap as mask?
I had to change the masks as described by @Christian. Then, the wanted result could easily be produced: canvas.drawRect(rect, paint); paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN)); canvas.drawBitmap(mask, 0.0f, 0.0f, paint);

Categories : Android

Re-size bitmap to smaller bitmap
You can make image thumbnail : Bitmap thumbBitmap = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(filePath), thumbWidth, thumbHeight);

Categories : Android

PHP code showing in HTML
Your path could be printed anywhere, from a function call, from an include etc. You need to debug your own code and find where it is printed, delete parts of your code and reload your page, until it doesn't display anymore, then you will know which code prints it. We can't find it without having access to your entire code, including all your functions and includes, but for this issue it's really not necessary, you just need to learn to debug your code.

Categories : PHP

Why are the frames in my code not showing up?
If you want to place frames inside a document, then you must use <iframe>s. A <frameset> and <frames> may only appear in a frameset document, where they appear instead of the <body>. Frames (of all kinds) are, however, problematic and I recommend looking at alternatives as well as not using tables for layout (your navigation is better expressed as a list) and performing basic, automated QA on your markup.

Categories : HTML

Code Activity not showing in Toolbox?
I have found this technet blog that describes the steps that need to be taken to deploy a code activity in a Visual Studio 2012, SharePoint 2013 Workflow: http://blogs.technet.com/b/sharepointdevelopersupport/archive/2013/08/28/how-to-develop-a-workflow-code-activity-in-sharepoint-2013.aspx

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.