Search Results

Search found 510 results on 21 pages for 'bmp'.

Page 5/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Python - wxPython custom button -> unbound method __init__()? what?

    - by Wallter
    After looking at questions like this it doesn't make sense that my __init__(self, parrent, id) would be throwing a unbound error? help? main.py import wx from customButton import customButton from wxPython.wx import * class MyFrame(wx.Frame): def __init__(self, parent, ID, title): wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, wxSize(400, 400)) # Non-important code here... # This is the first declaration of the Button1 # This is also where the ERROR is thrown. # Omitting this line causes the window to execute # flawlessly. self.Button1 = customButton.__init__(self, parent, -1) # ... finishes in a basic wx.program style... customButton.py # I've included all of the code in the file # because have no idea where the bug/error happens import wx from wxPython.wx import * class Custom_Button(wx.PyControl): # The BMP's Over_bmp = None #wxEmptyBitmap(1,1,1) # When the mouse is over Norm_bmp = None #wxEmptyBitmap(1,1,1) # The normal BMP Push_bmp = None #wxEmptyBitmap(1,1,1) # The down BMP def __init__(self, parent, id, **kwargs): wx.PyControl.__init__(self,parent, id, **kwargs) # Set the BMP's to the ones given in the constructor #self.Over_bmp = wx.Bitmap(wx.Image(MOUSE_OVER_BMP, wx.BITMAP_TYPE_ANY).ConvertToBitmap()) #self.Norm_bmp = wx.Bitmap(wx.Image(NORM_BMP, wx.BITMAP_TYPE_ANY).ConvertToBitmap()) #self.Push_bmp = wx.Bitmap(wx.Image(PUSH_BMP, wx.BITMAP_TYPE_ANY).ConvertToBitmap()) #self.Pos_bmp = self.pos self.Bind(wx.EVT_LEFT_DOWN, self._onMouseDown) self.Bind(wx.EVT_LEFT_UP, self._onMouseUp) self.Bind(wx.EVT_LEAVE_WINDOW, self._onMouseLeave) self.Bind(wx.EVT_ENTER_WINDOW, self._onMouseEnter) self.Bind(wx.EVT_ERASE_BACKGROUND,self._onEraseBackground) self.Bind(wx.EVT_PAINT,self._onPaint) self._mouseIn = self._mouseDown = False def _onMouseEnter(self, event): self._mouseIn = True def _onMouseLeave(self, event): self._mouseIn = False def _onMouseDown(self, event): self._mouseDown = True def _onMouseUp(self, event): self._mouseDown = False self.sendButtonEvent() def sendButtonEvent(self): event = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, self.GetId()) event.SetInt(0) event.SetEventObject(self) self.GetEventHandler().ProcessEvent(event) def _onEraseBackground(self,event): # reduce flicker pass def _onPaint(self, event): dc = wx.BufferedPaintDC(self) dc.SetFont(self.GetFont()) dc.SetBackground(wx.Brush(self.GetBackgroundColour())) dc.Clear() dc.DrawBitmap(self.Norm_bmp) # draw whatever you want to draw # draw glossy bitmaps e.g. dc.DrawBitmap if self._mouseIn: # If the Mouse is over the button dc.DrawBitmap(self, self.Mouse_over_bmp, self.Pos_bmp, useMask=False) if self._mouseDown: # If the Mouse clicks the button dc.DrawBitmap(self, self.Push_bmp, self.Pos_bmp, useMask=False)

    Read the article

  • ASP.NET error on Bitmap.Save "Exception (0x80004005): A generic error occurred in GDI+."

    - by Batu
    Hi, I have a function which first reads an image from disk, resizes it and then saves to another directory. when i use the Bitmap.Save(directory + theimagename) it returns the error as i stated in the question title. i checked the directory is right, and the given image name doesn't exist in that dir. what is weird, is that the same code works great on the local machine. but when i upload it to my shared server. it just doesn't work. the code is below. bmpOut = new Bitmap(Size, Size); Graphics g = Graphics.FromImage(bmpOut); g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.FillRectangle(Brushes.White, 0, 0, Size, Size); int topBottomPadding = 0; int leftRightPadding = 0; if (Size > lnNewWidth + 1) leftRightPadding = Convert.ToInt32((Size - lnNewWidth) / 2); else if (Size > lnNewHeight + 1) topBottomPadding = Convert.ToInt32((Size - lnNewHeight) / 2); g.DrawImage(loBMP, leftRightPadding, topBottomPadding, lnNewWidth, lnNewHeight); Bitmap bmp = new Bitmap(bmpOut); if (bmp != null) bmp.Save(ResizedOutput); bmp.Dispose(); bmpOut.Dispose(); g.Dispose(); loBMP.Dispose(); stack trace: [ExternalException (0x80004005): A generic error occurred in GDI+.] System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +377630 System.Drawing.Image.Save(String filename, ImageFormat format) +69 System.Drawing.Image.Save(String filename) +25 Utilities.ResizeImage(String fileName, String mode) in c:\inetpub\vhosts\batuhanakcay.com\httpdocs\App_Code\Utilities.cs:181 Link.ToProductImage(String fileName) in c:\inetpub\vhosts\batuhanakcay.com\httpdocs\App_Code\Link.cs:79 Product.PopulateControls(ProductDetails pd) in c:\inetpub\vhosts\batuhanakcay.com\httpdocs\Product.aspx.cs:37 Product.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\batuhanakcay.com\httpdocs\Product.aspx.cs:20

    Read the article

  • how to load image from file using MFC

    - by Sweety Khan
    **my browse button code is void CFileOpenDlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here CFileDialog dlg(TRUE); int result=dlg.DoModal(); if(result==IDOK) { path=dlg.GetPathName(); UpdateData(FALSE); } } and this is the code for loading an image from resource but tht does not work for loading an image from file. i know LoadImage(); is used for this but how? how can i edit this code to load image from file. Plzz help..... void CFileOpenDlg::OnBnClickedButton2() { // TODO: Add your control notification handler code here CRect r; CBitmap* m_bitmap; CDC dc, *pDC; BITMAP bmp; m_bitmap = new CBitmap(); m_bitmap-LoadBitmapW(IDB_BITMAP1); m_bitmap-GetBitmap(&bmp); pDC = this-GetDC(); dc.CreateCompatibleDC(pDC); dc.SelectObject(m_bitmap); pDC-BitBlt(200, 200, bmp.bmWidth, bmp.bmHeight, &dc,0 , 0, SRCCOPY); m_bitmap-DeleteObject(); m_bitmap-Detach(); } waiting for reply........**

    Read the article

  • Save Bitmap image in a location in C#

    - by acadia
    Hello, I have this function to store the bmp image in a desired location as shown below My question is, how do I save the image in C:\temp folder by default, instead of opening the filedialog box? I want to specify sd.fileName=picname+".bmp" and store it in c:\temp by default. I tried to specify Thanks for your help in advance. I tried to public static bool SaveDIBAs( string picname, IntPtr bminfo, IntPtr pixdat ) { SaveFileDialog sd = new SaveFileDialog(); sd.FileName = picname; sd.Title = "Save bitmap as..."; sd.Filter = "Bitmap file (*.bmp)|*.bmp|TIFF file (*.tif)|*.tif|JPEG file (*.jpg)|*.jpg|PNG file (*.png)|*.png|GIF file (*.gif)|*.gif|All files (*.*)|*.*"; sd.FilterIndex = 1; if( sd.ShowDialog() != DialogResult.OK ) return false; Guid clsid; if( ! GetCodecClsid( sd.FileName, out clsid ) ) { MessageBox.Show( "Unknown picture format for extension " + Path.GetExtension( sd.FileName ), "Image Codec", MessageBoxButtons.OK, MessageBoxIcon.Information ); return false; } IntPtr img = IntPtr.Zero; int st = GdipCreateBitmapFromGdiDib( bminfo, pixdat, ref img ); if( (st != 0) || (img == IntPtr.Zero) ) return false; st = GdipSaveImageToFile( img, sd.FileName, ref clsid, IntPtr.Zero ); GdipDisposeImage( img ); return st == 0; }

    Read the article

  • How to properly recreate BITMAP, that was previously shared by CreateFileMapping()?

    - by zim22
    Dear friends, I need your help. I need to send .bmp file to another process (dialog box) and display it there, using MMF(Memory Mapped File) But the problem is that image displays in reversed colors and upside down. In first application I open picture from HDD and link it to the named MMF "Gigabyte_picture" HANDLE hFile = CreateFile("123.bmp", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, "Gigabyte_picture"); In second application I open mapped bmp file and at the end I display m_HBitmap on the static component, using SendMessage function. HANDLE hMappedFile = OpenFileMapping(FILE_MAP_READ, FALSE, "Gigabyte_picture"); PBYTE pbData = (PBYTE) MapViewOfFile(hMappedFile, FILE_MAP_READ, 0, 0, 0); BITMAPINFO bmpInfo = { 0 }; LONG lBmpSize = 60608; // size of the bmp file in bytes bmpInfo.bmiHeader.biBitCount = 32; bmpInfo.bmiHeader.biHeight = 174; bmpInfo.bmiHeader.biWidth = 87; bmpInfo.bmiHeader.biPlanes = 1; bmpInfo.bmiHeader.biSizeImage = lBmpSize; bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); UINT * pPixels = 0; HDC hDC = CreateCompatibleDC(NULL); HBITMAP m_HBitmap = CreateDIBSection(hDC, &bmpInfo, DIB_RGB_COLORS, (void **)& pPixels, NULL, 0); SetBitmapBits(m_HBitmap, lBmpSize, pbData); SendMessage(gStaticBox, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)m_HBitmap); ///////////// HWND gStaticBox = CreateWindowEx(0, "STATIC","", SS_CENTERIMAGE | SS_REALSIZEIMAGE | SS_BITMAP | WS_CHILD | WS_VISIBLE, 10,10,380, 380, myDialog, (HMENU)-1,NULL,NULL);

    Read the article

  • i integer does not +1 the 1st time

    - by Hwang
    I have a gallery where it will load an image after a previous image is loaded, so every time 'i' will +1 so that it could move to the next image. This code works fine on my other files, but I dunno why it doesn't work for the current file. Normally if I trace 'i' the correct will be 0,1,2,3,4,5,6... etc adding on till the limit, but this files its 'i' repeat the 1st number twice, only it continues to add 0,0,1,2,3,4,5,6...etc The code is completely the same with the other file I'm using, but I don't know why it just doesn't work here. The code does not seems to have any problem. Anyway i can work around this situation? private var i:uint=0; private function loadItem():void { if (i<myXMLList.length()) { loadedPic=myXMLList[i].thumbnails; galleryLoader = new Loader(); galleryLoader.load(new URLRequest(loadedPic)); galleryLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,picLoaded); } else { adjustImage(); } } private function picLoaded(event:Event):void { var bmp=new Bitmap(event.target.content.bitmapData); bmp.smoothing=true; bmpArray.push(bmp); imagesArray[i].addChild(bmp); i++; loadItem(); }

    Read the article

  • OutOfMemoryException with Image.Clone - Only on Windows 2003

    - by Jeff Rapp
    So here's my issue. I have an image that I need to shrink. The original image is a grayscale PNG, which isn't a huge issues except that when I shrink it down, the thermal label printers pickup the artifacts and print them on the label. So, what I did was change the image to black & white (Format1bppIndexed) before resizing, like this: Dim bte() As Byte = System.Convert.FromBase64String(imgStr) Dim ms As New IO.MemoryStream(bte) Dim bmp As New System.Drawing.Bitmap(ms) Dim monoImage As Drawing.Bitmap = New Drawing.Bitmap(1200, 1800, Drawing.Imaging.PixelFormat.Format1bppIndexed) Dim rect As New Drawing.Rectangle(0, 0, 1200, 1800) monoImage = bmp.Clone(rect, Drawing.Imaging.PixelFormat.Format1bppIndexed) And then I resize it. This code works fine on my Windows 7 machine, but when I run it on the Windows 2003 Server box that it calls home, it always throws an OutOfMemoryException when it hits the bmp.Clone line. Any ideas as to what's happening, or perhaps a better solution to converting the image to B&W?

    Read the article

  • Adding image to RichTextBox programatically does not show in Xaml property

    - by rotary_engine
    Trying to add an image to a RichTextBox progamatically from a Stream. The image displays in the text box, however when reading the Xaml property there is no markup for the image. private void richTextBox3_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { FileInfo[] files = (FileInfo[])e.Data.GetData(DataFormats.FileDrop); using (Stream s = files[0].OpenRead()) { InlineUIContainer container = new InlineUIContainer(); BitmapImage bmp = new BitmapImage(); bmp.SetSource(s); Image img = new Image(); img.SetValue(Image.SourceProperty, bmp); container.Child = img; richTextBox3.Selection.Insert(container); } } } private void Button_Click_1(object sender, RoutedEventArgs e) { // this doesn't have the markup from the inserted image System.Windows.MessageBox.Show(richTextBox3.Xaml); } What is the correct way to insert an image into the RichTextBox at runtime so that it can be persisted to a data store? In the Xaml property.

    Read the article

  • Winforms Hotkey, Help?

    - by Di4g0n4leye
    namespace WebBrowser { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } int GetPixel(int x, int y) { Bitmap bmp = new Bitmap(1, 1, PixelFormat.Format32bppPArgb); Graphics grp = Graphics.FromImage(bmp); grp.CopyFromScreen(new Point(x,y), Point.Empty, new Size(1,1)); grp.Save(); return bmp.GetPixel(0, 0).ToArgb(); } void Button1Click(object sender, EventArgs e) { int x = Cursor.Position.X; int y = Cursor.Position.Y; int pixel = GetPixel(x,y); textBox1.Text = pixel.ToString(); } void MainFormLoad(object sender, EventArgs e) { webBrowser1.Navigate("http://google.com"); } } } } i want to add a hotkey that call Button1 on Press, How can that be done?

    Read the article

  • How to read pixel values of a video?

    - by vikramtheone
    Hi Guys, I recently wrote C programs for image processing of BMP images, I had to read the pixel values and process them, it was very simple I followed the BMP header contents and I could get most of the information of the BMP image. Now the challenge is to process videos (Frame by Frame), how can I do it? How will I be able to read the headers of continuous streams of image frames in a video clip? Or else, is it like, for example, the mpeg format will also have universal header, upon reading which I can get the information about the entire video and after the header, all the data are only pixels. I hope I could convey. Has anyone got experience with processing videos? Any books or links to tutorials will be very helpful. Vikram

    Read the article

  • How to loop an executable command in the terminal in Linux?

    - by user1452373
    Let me first describe my situation, I am working on a Linux platform and have a collection of .bmp files that add one to the picture number from filename0022.bmp up to filename0680.bmp. So a total of 658 pictures. I want to be able to run each of these pictures through a .exe file that operates on the picture then kicks out the file to a file specified by the user, it also has some threshold arguments: lower, upper. So the typical call for the executable is: ./filter inputfile outputfile lower upper Is there a way that I can loop this call over all the files just from the terminal or by creating some kind of bash script? My problem is similar to this: Execute a command over multiple files with a batch file but this time I am working in a Linux command line terminal. Thank you for your help, Luke H

    Read the article

  • SDL_BlitSurface() not displaying image?

    - by Christian Gonzalez
    So I'm trying to display a simply image with the SDL library, but when I use the function SDL_BlitSurface() nothing happens, and all I get is a black screen. I should also note that I have the .bmp file, the source, and the executable file all in the same directory. //SDL Header #include "SDL/SDL.h" int main(int argc, char* args[]) { //Starts SDL SDL_Init(SDL_INIT_EVERYTHING); //SDL Surfaces are images that are going to be displayed. SDL_Surface* Hello = NULL; SDL_Surface* Screen = NULL; //Sets the size of the window (Length, Height, Color(bits), Sets the Surface in Software Memory) Screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); //Loads a .bmp image Hello = SDL_LoadBMP("Hello.bmp"); //Applies the loaded image to the screen SDL_BlitSurface(Hello, NULL, Screen, NULL); //Update Screen SDL_Flip(Screen); //Pause SDL_Delay(2000); //Deletes the loaded image from memory SDL_FreeSurface(Hello); //Quits SDL SDL_Quit(); return 0; }

    Read the article

  • C# Hotkey, Help?

    - by Di4g0n4leye
    namespace WebBrowser { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } int GetPixel(int x, int y) { Bitmap bmp = new Bitmap(1, 1, PixelFormat.Format32bppPArgb); Graphics grp = Graphics.FromImage(bmp); grp.CopyFromScreen(new Point(x,y), Point.Empty, new Size(1,1)); grp.Save(); return bmp.GetPixel(0, 0).ToArgb(); } void Button1Click(object sender, EventArgs e) { int x = Cursor.Position.X; int y = Cursor.Position.Y; int pixel = GetPixel(x,y); textBox1.Text = pixel.ToString(); } void MainFormLoad(object sender, EventArgs e) { webBrowser1.Navigate("http://google.com"); } } } } How i want to add a hotkey that call Button1 on Press? How can that be done?

    Read the article

  • System context menu Icon not transparent like WinRAR

    - by Samir
    I added a icon at the system context menu(the popped up menu when we right mouse click on any file/foler). But the icon is not transparent(in xp its not notice able, but in vista/win7 it is clearly visible) there is a white background beneath the icon. But WinRAR or TortoiseSVN icons don't have any white background, they are transparent. I tried the following C++ code: #define BITMAP_MAIN 201 //in resource.h BITMAP_MAIN BITMAP "main.bmp" // in .rc file // showing icon in menu... HBITMAP imgMain = LoadBitmap( aHinstance, MAKEINTRESOURCE(BITMAP_MAIN) ); SetMenuItemBitmaps ( hSubmenu, uMenuIndex, MF_BYPOSITION, imgMain, imgMain); [main.bmp is 16X16] Also the icon(.bmp) is not shown fully in non-english OS. So is there be any special technique to make the icon in the system context menu transparent like WinRAR?

    Read the article

  • Images to video - converting to IplImage makes video blue

    - by user891908
    I want to create a video from images using opencv. The strange problem is that if i will write image (bmp) to disk and then load (cv.LoadImage) it it renders fine, but when i try to load image from StringIO and convert it to IplImage, it turns video to blue. Heres the code: import StringIO output = StringIO.StringIO() FOREGROUND = (0, 0, 0) TEXT = 'MY TEXT' font_path = 'arial.ttf' font = ImageFont.truetype(font_path, 18, encoding='unic') text = TEXT.decode('utf-8') (width, height) = font.getsize(text) # Create with background with place for text w,h=(600,600) contentimage=Image.open('0.jpg') background=Image.open('background.bmp') x, y = contentimage.size # put content onto background background.paste(contentimage,(((w-x)/2),0)) draw = ImageDraw.Draw(background) draw.text((0,0), text, font=font, fill=FOREGROUND) pi = background pi.save(output, "bmp") #pi.show() #shows image in full color output.seek(0) pi= Image.open(output) print pi, pi.format, "%dx%d" % pi.size, pi.mode cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 3) cv.SetData(cv_im, pi.tostring()) print pi.size, cv.GetSize(cv_im) w = cv.CreateVideoWriter("2.avi", cv.CV_FOURCC('M','J','P','G'), 1,(cv.GetSize(cv_im)[0],cv.GetSize(cv_im)[1]), is_color=1) for i in range(1,5): cv.WriteFrame(w, cv_im) del w

    Read the article

  • efficient way to detect if an image is empty

    - by Jos
    Hi, I need a very fast method to detect if an image is empty. Im my case then all pixels are white and transparant. The images are png's. My current method is to load them in a memory bitmap and check each pixel value, but this is way to slow. Is there a more efficient way? This is my current code: 'Lock the bitmap bits. Dim bmpData As System.Drawing.Imaging.BitmapData = bmp.LockBits(rectBmp, _ Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat) Try Dim x As Integer Dim y As Integer For y = 0 To bmpData.Height - 1 For x = 0 To bmpData.Width - 1 If System.Runtime.InteropServices.Marshal.ReadByte(bmpData.Scan0, (bmpData.Stride * y) + (4 * x) + 3) <> 0 Then Return True Exit For End If Next Next Finally bmp.UnlockBits(bmpData) End Try

    Read the article

  • Hard Coded Paths in a .NET Program

    - by maya
    I am developing an application in C#. I have a folder called myfolder it contains a file called mypoints.bmp. The folder myfolder is in my project folder it is in D drive. The path is D:\Myproject\myfolder\mypoints.bmp. Now, in my program, whereever I need mypoints.bmp I have hardcoded the whole path. When my project is copied in to a different system under C drive, I am not able to run my project because of the hardcoded path. How can I give the path so that there will not be any problem even if it is loaded in to a different system under a different drive.

    Read the article

  • Is it possible to set ContentType for a WCF WebGet method?

    - by James Cadd
    I'm working with a WCF restful/http method that returns a stream of image data. I want to make sure that the content type is marked as "image/png". The method is defined as: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class TileImageService { [WebGet(UriTemplate = "{id}")] public Stream GetTileImage(string id) { Bitmap bmp = new Bitmap(173, 173); Graphics g = Graphics.FromImage(bmp); g.Clear(Color.Blue); g.DrawString(DateTime.Now.ToLongTimeString(), new Font("Chiller", 20), Brushes.White, new PointF(10, 10)); g.Flush(); MemoryStream ms = new MemoryStream(); bmp.Save(ms, ImageFormat.Png); ms.Seek(0, SeekOrigin.Begin); return ms; } } In Firefox it looks like the content type is marked as application/octet stream. Is there a way to change the content type?

    Read the article

  • Building and rendering a bitmap from a double array

    - by Ami
    I'm new to c# and I'm sure I'm missing something simple here. I'm trying to build a bitmap from integer values (0-255) in a double array and then render it in a PictureBox. I think my Bitmap is getting generated but it isn't displaying in my PictureBox. Bitmap bmp = new Bitmap(image_width, image_height); Color pxl_color = new Color(); for (int i = 0; i < image_width; i++) { for (int j = 0; j < image_height; j++) { pxl_color = Color.FromArgb(array_bitmap[i][j]); bmp.SetPixel(i, j, pxl_color); } } PictureBox1.Image = bmp; Thanks in advance.

    Read the article

  • Custom component creation - how to add small icon representing component in Tool Palette?

    - by Wodzu
    Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette. I've read that I should name my two other BMP files which are contained in DCR file like this: MyComponentName16 [for 16x16 BMP file] MyComponentName32 [for 32x32 BMP file] Unfortunately this does not seem to work, I've tried to restart Delphi few times in hope that it might be the case of not refreshing something, but without any success. Any ideas?

    Read the article

  • Should UTF-16 be considered harmful?

    - by Artyom
    I'm going to ask what is probably quite a controversial question: "Should one of the most popular encodings, UTF-16, be considered harmful?" Why do I ask this question? How many programmers are aware of the fact that UTF-16 is actually a variable length encoding? By this I mean that there are code points that, represented as surrogate pairs, take more than one element. I know; lots of applications, frameworks and APIs use UTF-16, such as Java's String, C#'s String, Win32 APIs, Qt GUI libraries, the ICU Unicode library, etc. However, with all of that, there are lots of basic bugs in the processing of characters out of BMP (characters that should be encoded using two UTF-16 elements). For example, try to edit one of these characters: 𝄞 (U+1D11E) MUSICAL SYMBOL G CLEF 𝕥 (U+1D565) MATHEMATICAL DOUBLE-STRUCK SMALL T 𝟶 (U+1D7F6) MATHEMATICAL MONOSPACE DIGIT ZERO 𠂊 (U+2008A) Han Character You may miss some, depending on what fonts you have installed. These characters are all outside of the BMP (Basic Multilingual Plane). If you cannot see these characters, you can also try looking at them in the Unicode Character reference. For example, try to create file names in Windows that include these characters; try to delete these characters with a "backspace" to see how they behave in different applications that use UTF-16. I did some tests and the results are quite bad: Opera has problem with editing them (delete required 2 presses on backspace) Notepad can't deal with them correctly (delete required 2 presses on backspace) File names editing in Window dialogs in broken (delete required 2 presses on backspace) All QT3 applications can't deal with them - show two empty squares instead of one symbol. Python encodes such characters incorrectly when used directly u'X'!=unicode('X','utf-16') on some platforms when X in character outside of BMP. Python 2.5 unicodedata fails to get properties on such characters when python compiled with UTF-16 Unicode strings. StackOverflow seems to remove these characters from the text if edited directly in as Unicode characters (these characters are shown using HTML Unicode escapes). WinForms TextBox may generate invalid string when limited with MaxLength. It seems that such bugs are extremely easy to find in many applications that use UTF-16. So... Do you think that UTF-16 should be considered harmful?

    Read the article

  • Can i create a SDL_Surface as i do with Allegro?

    - by Petris Rodrigo Fernandes
    First of all, I'm sorry about my english (Isn't my native language) Using allegro I can create a Bitmap to draw just doing: BITMAP* bmp = NULL; bmp = create_bitmap(width,height); // I don't remember exactly the parameters I'm using SDL now, and i want create a SDL_Surface to draw the game level (that is static) creating a SDL_Surface, drawing the tiles on it, then i just blit this surface to the screen instead of keep drawing the tiles directly on screen (i believe this will require more processing); There a way to create a blank SDL_Surface as i did with Allegro just do draw before blit it?

    Read the article

  • How to load Image in C# and set properties of the Picture Box

    - by SAMIR BHOGAYTA
    Create a C# application drag a picture Box, four buttons and open file dialog on the form. Write code on btn_browse Button click ----------------------------------------- private void btn_browse_Click(object sender, System.EventArgs e) { try { OpenFileDialog open = new OpenFileDialog(); open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp"; if (open.ShowDialog()==DialogResult.OK) { pictureBox1.Image = new Bitmap(open.FileName); } } catch (Exception) { throw new ApplicationException("Failed loading image"); } } Write code on btn_StretchImage Button click ------------------------------------------------ private void btn_StretchImage_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; } Write code on btn_AutoSize Button click ------------------------------------------------- private void btn_AutoSize_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; } Write code on btn_CenterImage Button click -------------------------------------------------- private void btn_CenterImage_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; }

    Read the article

  • .htaccess file to implement multiple redirects

    - by RobMorta
    I have a dynamic site and from .htaccess file creating clean URLs: RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp)$ RewriteRule ^([a-zA-Z0-9_\-\+\ ]+)$ flight.php?flights=$1&slug=$1 This code worked fine for me but when I created a new type of page and trying to get clean URLs with the same code i.e.: RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp)$ RewriteRule ^([a-zA-Z0-9_\-\+\ ]+)$ manual-page.php?url=$1&slug=$1 it's not working and if I comment the previous two lines then its is working fine. Only one code is working at a time. For first I have a URL domain.com/flight.php?flight-san-fransisco-london-flights and I want this being redirect to domain.com/san-fransisco-london-flights & from the second one I have domain.com/manual-page.php?url=my-new-page and I want this being redirect to domain.com/my-new-page. Is these any way to get both working together?

    Read the article

  • RewriteRule causes POST data to get dumped before I can access it

    - by MatthewMcGovern
    I'm currently setting up my own 'webserver' (a Ubuntu Server on some old hardware) so I can have a mess around with PHP and get some experience managing a server. I'm using my own little MVC framework and I've hit a snag... In order for all requests to make it through the dispatcher, I am using: <Directory /var/www/> RewriteEngine On RewriteCond %{REQUEST_URI} !\.(png|jpg|jpeg|bmp|gif|css|js)$ [NC] RewriteRule . HomeProjects/index.php [L] </Directory> Which works great. I read on Stackoverflow to change the [L] to [P] to preserve post data. However, this causes every page to return: Not Found The requested URL <url> was not found on this server. So after some more searching, I found, "Note that you need to enable the proxy module, and the proxy_http_module in the config files for this to work." The problem is, I have no idea how to do this and everything I google has people using examples with virtual hosts and I don't know how to 'translate' that into something useful for my setup. I'm accessing my webserver via my public IP and forwarding traffic on port 80 to the web server (like I'm pretending I have a domain/server). How can I get this enabled/get post data working again? Edit: When I use the following, the server never responds and the page loads indefinately? LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so <Directory /var/www/> RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?82\.6\.150\.51/ [NC] RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /no-hotlink.png [L] RewriteCond %{REQUEST_URI} !\.(png|jpg|jpeg|bmp|gif|css|js)$ [NC] RewriteRule . HomeProjects/index.php [P] </Directory>

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >